I have a device which outputs pulses at 5V. I want to detect these pulses with my Raspberry Pi later. The problem is that my Raspberry Pi script will be doing other things that take time, and I'm worried that it will not be able to pick up on the pulses (it will not check the state of the GPIO pin when the pulses occur).

Is there some way to take 5V pulses and not only turn them into a solid logical on, but also extend the length? My dream would be that whenever the pulses happened, I could have a 3.3V signal be on for a minute or so.

  • 1
    \$\begingroup\$ An extended pulse might cover up a possible second or third pulse; is that tolerable? \$\endgroup\$
    – Whit3rd
    Jun 6, 2017 at 3:33
  • 1
    \$\begingroup\$ Typically I would use an edge triggered interrupt and the code clears the interrupt when it gets around to it \$\endgroup\$
    – sstobbe
    Jun 6, 2017 at 3:40
  • \$\begingroup\$ electronics.stackexchange.com/questions/231280/… \$\endgroup\$
    – Fredled
    Jun 6, 2017 at 8:00
  • \$\begingroup\$ some answers there: electronics.stackexchange.com/questions/231280/… \$\endgroup\$
    – Fredled
    Jun 6, 2017 at 8:03
  • \$\begingroup\$ you can buy cheap "timer relay" modules to do just that. i like 555-based solutions as well... \$\endgroup\$
    – dandavis
    Jun 6, 2017 at 8:44

1 Answer 1


For a software solution: use interrupts http://wiringpi.com/reference/priority-interrupts-and-threads/

As a bonus: Extending a short pulse can be accomplished using a monostable circuit like this: http://www.talkingelectronics.com/projects/555/imagesP1/555-one-shotPosTrig.gif


Your Answer

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

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