Electrical Issue: PIC input false triggering, Signal Noise suspected.


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: Electrical Issue: PIC input false triggering, Signal Noise suspected.

    another way is to filter the input with a software routine

    Code:
    reeds var byte
    reeds_flg var byte
    reed_1_active var reeds_flg.0            
    reed_2_active var reeds_flg.1
    reed_3_active var reeds_flg.2
    reed_cnt var byte[3]
    reed var byte
    define reed_threshold 64
    
    chk_reeds:
    reeds=portc & $70  ;c4 c5 c6  active low
    if reeds < 112 then
    reeds=reeds >> 4
    for reed = 0 to 2
    if ! reeds.0 then
            reed_cnt[reed]=reed_cnt[reed]+1 
            if reed_cnt[reed]> reed_threshold then reeds_flg.0[reed]=1
    else
            reed_cnt[reed]=0
    endif
    
    reeds=reeds>>1
    next
    endif
    return
    if you call the chk_reeds subroutine regularly (must be regular) say in this case 100 times per second, then if a reed input is consistently low for 64 (counts in a row the reed_threshold) then the reed_x_active flag will be set.
    Last edited by richard; - 12th February 2016 at 11:26. Reason: correction

  2. #2
    Join Date
    Jun 2015
    Posts
    18


    Did you find this post helpful? Yes | No

    Default Re: Electrical Issue: PIC input false triggering, Signal Noise suspected.

    Thanks Richard.

    This has great potential in my code because as you commented, once I set close the realys to the trolley power all I have to do is loop through the routine that checks for a low sensor. To make it easier, the trolley dbeing on a track can only go in on direction at a time so in each stage of travel I know exactly which sensor to poll. Not like I would need an interrupt to see which of the three sensors went low. The time the magnet is over the reed switch is eon's compared to the rate at which the pic can poll the sensor line.

    As I mentioned to one other reply, the pic advances to the next logical set of events just when the trolley gets moving and is several feet away from any sensor. This is what leads me to think some DC motor noise or even arcing of the pickup on the overhead wire is being picked up at the sensor pins and causing a false signal.

    I will study your code and possibly with it and many of the other outstanding suggestions here, find a solution which I will gladly report on.

Similar Threads

  1. Intermittent reset of 16C6440 - possible noise issue
    By Christopher4187 in forum General
    Replies: 4
    Last Post: - 16th May 2012, 12:43
  2. Noise on input signal
    By fanman in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 28th February 2012, 02:55
  3. Electrical noise problem with PIC 16f84
    By Snap in forum General
    Replies: 11
    Last Post: - 26th September 2007, 09:36
  4. Input Noise
    By PJALM in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 28th February 2006, 19:26
  5. False Triggering I/O
    By pdegior in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th July 2005, 09:02

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts