I have recently finished working on a project that would use my raspberry pi to operate my doors deadbolt. There is an RFID reader connected though USB, a servo on port 18, a reed switch on 24 and a button to manually trigger the deadbolt on the inside of the house on port 23.

The problem is not the code for the system, but rather the GPIO ports. Occasionally the GPIO port that triggers a manual unlock for the door will randomly fire causing a major security breach. And looking from the logs, it looks like occasionally the GPIO port for the reed switch fires as well within 2 seconds. But not always. So as a temporary countermeasure, I have put a timer on how long the door can be left unlocked. But this is a poor excuse for a fix. The issue happens around three times a day.

I am not sure if anyone has any history of using this module, but I am using the RPIO module. The exact method I am using to unlock the door is: RPIO.add_interrupt_callback(23, self.e_inside_unlock, debounce_timeout_ms=1000). The log is created from the event calling self.e_inside_unlock and the callback can only be triggered by the interrupt. The GPIO ports have resistors to limit current and is set up as follows (The second illustration is the one I have configured):

Picture illustrating the resistors used with a button.

Thank you for your time. Any suggestions would be appreciated.

  • could you also include a schematic of your output that operates the servo (unlocks door).
    – Marla
    Jul 7, 2014 at 1:26

1 Answer 1


Even though you are using a "de-bounce" in your software, there is no protection against a false input trigger. Assuming that your switches are remote from the GPIO pin leaves you a little vulnerable to outside interference. Long wires have a bad habit of picking up on external electromagnetic interference.

A small capacitor (.01 uf would do) from the left side (non GPIO) of R2 to ground could help.

The "3 times a day" gives me reason to suspect the cause is external glitch (noise)

  • You know, that is a really good idea. Thanks, I'll try it and let you know. Jul 7, 2014 at 4:00
  • How did you get on? I'm looking to build something similar myself.
    – Goober
    Jan 8, 2015 at 23:41

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.