nullacht15
Posts: 7
Joined: Wed Nov 23, 2016 8:14 am

Interrupt routine calling randomly

Fri Mar 03, 2017 7:42 pm

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?

ghp
Posts: 1498
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: Interrupt routine calling randomly

Fri Mar 03, 2017 7:58 pm

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

Return to “Interfacing (DSI, CSI, I2C, etc.)”