Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4899

Beginners • Re: GPIO pins false positives due to digital noise on Buttons

$
0
0
A good reference for protecting GPIO inputs is https://www.digikey.de/en/articles/prot ... lectronics
In this document, there are buttons used from GND to GPIO, using pullup resistors. Also to note that you should replace the 5V in the doc to 3.3V for RPi.
My favorite is Figure 8: Low pass filter protection for an input.

In addition to this: use for each button a pair of twisted wires. Does not need to be an industrial product, for short lengths I usually twist two strands manually. For your 5 buttons, there will be 5 pair of twisted wires leaving the RPI, each pair going to one button.

Using the ubiquitous RPi.GPIO add_event_detect-method, I found spurious events in some of my setup using very short wires to a button. It was a python code managing the shutdown of the RPi, and from time to time the RPi did shut down... Fixed this by not using the add_event_detect and polling the GPIO and having an additional mean value filter.

Statistics: Posted by ghp — Sat Mar 30, 2024 11:50 am



Viewing all articles
Browse latest Browse all 4899

Trending Articles