Using an SPST knife switch to power on/off a PC

switchestoggle switch

The title is it in a nutshell

I've got an antique knife switch that I'd like to use to power up (and down) an embedded PC.

The PC power switch is essentially two wires, a ground and +5v (measured with a voltmeter). Normally, a momentary pushbutton is used. You press it for a short time and the PC powers up. Press and hold while the PC is on and it powers down.

I'd like to use a knife switch, so the action would be

1) knife switch disengaged, pc is off
2) engage knife switch, PC powers up, which required a +momentary+ contact, but the knife switch is a constant contact.
3) PC is on while knife switch is engaged.
4) disengage knife switch, PC powers down, which requires another momentary contact, but a little longer duration.

I've found a simple circuit with a 5v reed relay and a 470uf capacitor that could work.

But….

I was really hoping to only connect the circuit to the PC's power switch wires, and not require a separate power supply line.

Is something like that even possible?

EDIT
I don't believe I can add images to the comments so I'm adding the circuit I mention below here. I was mistaken about the 2 capacitors though. It's two relays to control 2 separate buttons, one for the engagement of the toggle, and one for the disengagement.
enter image description here

see this post

http://www.simprojects.nl/toggle_to_momentary.htm

I originally thought I could use something like this, till I realized I'd have to run a completely separate power (and possibly ground) line for it.

I +could+ run the additional lines. I'm really just wondering if the circuit I'm describing is even possible. It seems like it should be, but my EE background is pretty limited.

EDIT: Switch is SPST.

Best Answer

I was really hoping to only connect the circuit to the PC's power switch wires, and not require a separate power supply line.

Is something like that even possible?

Converting a toggle or latching switch, into a momentary output, typically requires some active parts, like logic ICs, a 555/556 timer, a microcontroller or dedicated IC.

Your capacitor + relay circuit is one of the simpler methods, but the pulse will be equal length on both connect/disconnect of the knife switch.

A microcontroller with a simple interrupt code would be easy to setup for your requirements, and only need the microcontroller, a capacitor, and power.

Honestly though, you are already running two wires, one of which is either ground or VCC, a third wire would be trivial.