2
\$\begingroup\$

Basically I want to use a toggle switch to turn on my computer. I need some sort of circuit so that the toggle switch will act like a push button. IE, I turn on the toggle switch but it only sends a pulse rather than keep the circuit open.

Thanks in advanced.

\$\endgroup\$
3
  • \$\begingroup\$ How long a pulse? What voltage level? \$\endgroup\$
    – tcrosley
    Jan 31, 2015 at 11:34
  • \$\begingroup\$ What would happen if the toggle switch remained closed and you didn't use a pulse generator circuit? \$\endgroup\$
    – Andy aka
    Jan 31, 2015 at 11:57
  • \$\begingroup\$ Maybe you can get away with a suitable high pass filter and a comparator, depending on the required length of the pulse. \$\endgroup\$ Jan 31, 2015 at 19:47

2 Answers 2

1
\$\begingroup\$

The simplest hardware-wise is:

Just one small chip with its bypass cap.

The internal pullup on GP0 is enabled, so GP0 will be low when the switch is closed and high when open. The rest is firmware. At its simplest, the firmware can just produce a fixed size pulse on GP1 whenever it sees a transition on GP0. However, unlike dedicated analog solutions, you can apply different policies that might be useful. For example, when a pulse turns off the system, this could enforce a minimum time to let the system fully shut down before attempting to start it up again.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Olin,I like your solution but gotta tease you just a little bit. You broke one of your "soft" schematic rules -- no 4 way junctions. "Do as I say, not as I do." \$\endgroup\$
    – tcrosley
    Jan 31, 2015 at 17:32
  • \$\begingroup\$ @tcrosley: Yeah, you got me. Fixed. \$\endgroup\$ Jan 31, 2015 at 17:42
  • \$\begingroup\$ @Olin: do you have any strong reasons of the "soft" rule?Or maybe a post on stack exchange? \$\endgroup\$
    – iggy
    Jan 31, 2015 at 17:57
  • \$\begingroup\$ Isn't that because there is no way to tell for sure which wire is effectively connected to the net? \$\endgroup\$ Jan 31, 2015 at 19:49
0
\$\begingroup\$

This will work by allowing the 555's trigger input (pin 2) to go high, even if the switch is held closed, in less time than it takes for the 555's output pulse to time out, as long as R3C2 is greater than R2C1.

enter image description here

\$\endgroup\$

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.