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


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1
    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.

    Heckler,

    The reed switches are different ones but I have rigorously tested the ones under the track including the lead wire to the location of the new controller. This was easily done by rolling the trolley with magnet over the switch and checking the continuity. All 3 worked well.

    Vibration seems to be unlikely but I would have to devise a test to confirm that.

    I have worked with hall sensors before and considered it in concept but the most distant of the 3 track sensors is about 7 feet away from the controller. The advantage of the reed switch is that it does not require the additional complexity of getting 5vDC power to each sensor location and in the end, the the signal is still traveling along an antenna-like lead wire parallel to all this noisy DC motor operation and an arcing power connection (the trolley catenary.)

    Bypass caps as you suggest are a recurring theme in all the posts I have read. I assume you mean putting them on the control board trace at the node where the the input pin and pullup intersect? That would make it parallel with the pullup to ground?

    As I mentioned in a previous reply, I had read about dual sampling and think the idea has merit. I understand the concept in the code you provided, thanks. I will try this if external shielding fails to solve the problem. It is a bit of a hassle getting back into the control enclosure to get things ready for ICSP (some dis-assembly required.)

    I have a clunky old Tektronix scope with a CRT output and one channel fried but I could always make a project out of dusting it off and remembering how to use it again!

  2. #2
    Join Date
    Feb 2013
    Location
    Quebec, Canada
    Posts
    67


    Did you find this post helpful? Yes | No

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

    I've found that: Basic Electrical Parameters of Reed Switch (PDF).

    You'll see on page 3 they bounce a lot for a few miliseconds. I suggest you lower the pullup to 1k to improve noise immunity. If you're going to use LinkMTech's circuits think about using a Schmitt Trigger input your PIC.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

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

    I understand what you suggest about too weak a pullup, I had wondered about that myself, but I am unsure of how high a pullup current the pin should see, in other words how "stiff" the pullup should be. The spec sheet says the source current max on any port pin is 25mA. My gut tells me the reed switch should be able to handle that at 5vDC but I would hope that it would not be necessary to max out the current to mask the noise.

    Any thoughts?
    The 25mA source/sink current doesn't apply here. That's what the pin can source or sink when it's configured as an output - that's not what you're doing. When the pin is configured as an input you can, in this case, pretty much ignore the current flowing into it (it's about 100nA on the 16F722).

    Your pin is held high, at 5V (?), by the 47k pullup. The only current that's flowing is the 100nA (max) into pin and any leakage current thru the switch. The reed-switch, when activated, pulls the pin to GND, ~100uA is flowing down thru the pullup resistor causing a voltage drop of ~5V across the resistor, the input is now low. All is well, on the drawing board - and in your testup.....

    Que long leads, aka antennas. With such a weak pullup as 47k it doesn't take much noise on the long wires to start "yanking" on that logik level '1' provided by the 47k resistor.

    Although there are reed-switches available (I quickly browsed Digikey) that can only handle around 100uA, some 1mA most of them are capable of 100mA or more. If I were you I'd lower that pullup by an oder of magnitute (or two even) and add a small cap as per previous suggestion - then try again. Even a 470ohm resistor will still only give ~10mA thru the switch.

    /Henrik.

  4. #4
    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.

    Henrik,

    I over thought the issue and had a "brain-fault" when I got to thinking of the output parameters instead of the pin configured as imput. I appreciate your pointing that out and following it up with a very comprehensible explanation and calcs. I follow how the noise might be more influential on the signal if the pullup is not adequate.

    Thanks for the clear explanation and for pointing out my error in thinking about the pullup currents.

  5. #5
    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.

    Michel,

    At present I'm not so concerned about reed switch bounce (although that may become a later issue) since the jumping to the next set of operations in the PIC program behavior occurs without switch activation, before the magnet gets anywhere near it. That is why I suspect some sort of EMF is being picked up by the switch leads which run the length of the track above.

    I am aware however that there may be several things acting here so I am willing to give all theories consideration.

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