I have some pins in GPIO.IN mode reading buttons/alarm circuits. Since recently 2 of them started to trigger without a reason. I believe this all started after I changed power supply. However, changing it back didn't resolve the problem. 3 other pins are working as expected. Here's how my pins are set up in my python script:

GPIO.setup(11, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.add_event_detect(pin, GPIO.RISING, callback=alarmTriggered, bouncetime=300)

GPIO.setup(19, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.add_event_detect(bellPin, GPIO.FALLING, callback=bell_pressed, bouncetime=300)

Both pins are connected to the triggers like shown here: enter image description here

I have RPi3 model B. Any thoughts?

2 Answers 2


To prevent false alarms you need to make sure all inputs are pulled low or high (which way depends on the alarm situation, active high pull low and vice versa).

If you have pulls enabled and you still get false alarms you need stronger pulls.

Long wires act as aerials and can induce signals. If you do have long wires you could consider using twisted pair to provide some shielding.

  • What cable length is considered as long? For one pin I have ~12 meters telephone cable, for another - ~30 meters shielded twisted pair cable.
    – madfatcat
    Mar 26, 2017 at 3:08
  • Anything over a foot or so.
    – joan
    Mar 26, 2017 at 3:24

Okay, I found out that those false triggers are because of inductions caused by my new power supply which is 50 cm away from my pi. I reverted to my old power supply and still experienced those false triggers, but my new power supply with powerful transformer was still on. Turning it off fixed the things. Now I'm going to take it away from pi and alarm cables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.