Page 1 of 1

Interrupt routine calling randomly

Posted: Fri Mar 03, 2017 7:42 pm
by nullacht15
Hi,

i am using a RPI3 with a rain gauge.
If there is enough water in it, it will go from High to Low.
If i test it by tipping the rain gauge it works perfectly, but sometimes it calls the interrupt routine by mistake.

Code: Select all

GPIO.setmode(GPIO.BCM)
GPIO.setup(8, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.add_event_detect(8, GPIO.FALLING, callback=InterruptRoutine, bouncetime=200)
We already use a 95kOhm resistor at the 3,3V.
Any idea?

Re: Interrupt routine calling randomly

Posted: Fri Mar 03, 2017 7:58 pm
by ghp
Hello,
shorts between cables, bad solder junctions.
Long wires will collect all sort of radio or magnetic influence. Use twisted wires, perhaps shielding; RC low pass filter, protection schottky to VCC, GND.
If "tipping the rain gauge" results in signals, perhaps there is a bug crawling around ? Storm, or a pecker or racoon ?

Regards,
Gerhard