Go Down

Topic: attachInterrupt debounce or Dirty Power supply? (Read 2956 times) previous topic - next topic


Well, it seems I was wrong about needing the pull down resistor.  If memory serves, I installed the pull down at the same time I cleaned up the power supply, so probably falsely believed I needed it.  The system seems to work exactly the same without it. 

I tried the "now minus then" concept and it helped significantly.


After more testing today, I think I've got it.  It appears that during some "pulses" the signal would have an occassional very fast glitch below the high threshold, and the Arduino was fast enough to see the glitch and count it as a second pulse.  Measuring the length between RISING interrupts didn't solve it because the glitch might occur in the middle of a pulse such that both segments of the pulse were long enough to consider valid pulses.  The solution was to keep track of the time between the last FALLING and the next RISING, so that momentary drops in the pulse could be disregarded.   Just FYI for the curious and a big thanks to all who helped!


Would a cap or a small RC network get rid of the glitch?


Go Up