0
\$\begingroup\$

I am looking at using a latching switch (SPDT) to momentarily connect two pins. This is for a power button for a raspberry pi, so to power the machine from a hold state you have to momentarily short pins 5 and 6. Then to power the machine down I will switch it back to the other switch state and send a signal to a GPIO executing a shutdown script. I have done some research and found that the monostable multivibrator with 555 (one shot switch) might do the trick but a lot of the literature shows the trigger as a negative pulse? I will be latching the switch to 5v but only require a momentary switch, I was considering using an xor and flip flop but it seems like a lot of hassle.

Can anyone recommend another way or help me to understand if the monostable multivibrator will work for the application?

\$\endgroup\$
0
\$\begingroup\$

Since the power-down signal comes through a GPIO pin, your code can interpret either a high or low as the power down command. With the right code, a GPIO low means power down. Now the center (pole) of the switch can be tied to GND, both throws are pulled high with resistors, waiting to be pulled low, and you now have the correct signal polarity to trigger a 555.

\$\endgroup\$
  • \$\begingroup\$ I haven’t worked with NE555 before, do they trigger on falling edge or rising edge? So if the pin is high and I ground it, it will trigger once and not again until I send the pin high and ground again? Might be a stupid question but I just want to make sure I understand the function of a 555. \$\endgroup\$ – Grant Dare Mar 7 at 8:00
  • \$\begingroup\$ Yes, negative edge. BUT, it's not that simple. A 555 is not a true monostable. If you hold the trigger low past the normal pulse width, the output stays high until the trigger is released. \$\endgroup\$ – AnalogKid Mar 7 at 12:14
  • \$\begingroup\$ yeah see I’m using a latching switch so it will be held in that state, hence why I need a circuit. So I did research into a monostable multivibrator circuit using a 555, are you saying that the output will remain high as long as the switch remains GND even with the monostable multivibrator circuit (one shot switch circuit)? \$\endgroup\$ – Grant Dare Mar 7 at 12:52
  • \$\begingroup\$ With the standard datasheet circuit, yes. There is a way around it, by adding a coupling capacitor that differentiates the signal coming from the switch. The 555 sees a short pulse no matter how long the switch is closed. \$\endgroup\$ – AnalogKid Mar 7 at 13:31
  • \$\begingroup\$ To be sure you’re saying to add a capacitor in series with the trigger pin of the 555? \$\endgroup\$ – Grant Dare Mar 7 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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