Power on - momentary on, power off - momentary on

Thread Starter

Powerin

Joined Jul 29, 2023
9
Hi All,

I want to embed a computer into an electronic keyboard and want to power up the computer (via its power switch) when the KB is switched on and shut down the computer (again via the power switch) when the KB is switched off. So I need a momentary switch when power is applied and a momentary switch again when power is removed.

The switch on is easy - KB power to relay coil with a capacitor in series and relay contacts to the computer pwr switch. Coil will energise as the capacitor charges and de-energise when charged. I thought it would be easy to use the charge in the capacitor to again cycle the relay when power is removed to turn off the computer. But after some experimenting I can't figure out how to do it so maybe I'm on the wrong track. Any ideas?
 

MisterBill2

Joined Jan 23, 2018
27,231
The simple solution is to use a double pole momentary switch, with one section for the keyboard and one for the computer.
And I am trying to imagine what sort of computer can be embedded into an electronic keyboard.
 

MisterBill2

Joined Jan 23, 2018
27,231
OK. If the existing switch is part of the keyboard assembly, then a small double pole relay can be used instead.
I was thinking about larger computer boards that support drives and video and the whole package.
 

BobTPH

Joined Jun 5, 2013
11,474
Are you keeping power on to the "computer" at all times? Are you willing to change that?

Assuming you can apply power to the "computer" along with the keyboard, do you still need to "push the power button?" This could be as simple as a capacitor across the power button leads.
 

Thread Starter

Powerin

Joined Jul 29, 2023
9
It's actually an organ console. I'm putting a little Intel NUC in it but a full size mobo would fit :)
The organ console has spare interior AC oulets plus 12V and 5V power supplies. There's any number of ways to turn the computer on, but I would prefer to shut it down gracefully (close down the OS) rather than just cutting the power. You can do that by pushing the power button.

So my thought was to leave the computer with power and have a circuit that could momentarily "push" the computer power button when the console is powered up and again when it's powered down. I know it's a bit silly...but for me it's more elegant to have the whole system run with one button.
 

MisterBill2

Joined Jan 23, 2018
27,231
I already suggested using a double pole relay for the momentary closure of both momentary button circuits. That will keep the two totally isolated from each other, if that is important, and it will keep them triggered at the same time. And no complicated electronics involved.
 

crutschow

Joined Mar 14, 2008
38,348
use the charge in the capacitor to again cycle the relay when power is removed to turn off the computer
The problem with the capacitor to the relay is that the discharge requires a switched path to ground to give a rapid discharge when power is removed and the (apparent) single-pole power switch doesn't do that.
I need a momentary switch when power is applied and a momentary switch again when power is removed.
Below is the sim of an added XOR gate circuit (one IC) and MOSFET driver to give a pulse to the relay for both the on and off switching of the power.
The relay momentary closes (red trace) at the application and removal of power (green trace).

I assumed the power was 5V.

I believe that does what you want.

(Rsim and the Vdd connection to the relay is just to show the operation of the relay and is not used in the actual circuit).

1690730647553.png
 

AnalogKid

Joined Aug 1, 2013
12,063
So I need a momentary switch when power is applied and a momentary switch again when power is removed.
1. How long is "momentary"?

2. Do the computer and the keyboard share a common ground?

If yes, they you probably can get away with a transistor switching the computer's on/standby control input. IIRC, typically the control input is pulled high on the board, and you activate it by pulling it to GND. This can be done with an open-collector transistor driven by a timed pulse circuit. If the grounds might not be common, they a low-power reed relay contact (or an optocoupler) gets you complete independence.

Crutschow shows V1 as a battery that stays up after the switch is opened, and your post is not clear about the +5 V and +12 V being available after the console is turned off. My read of post #1 is that the keyboard's power switch kills all power in the keyboard but not the power to the computer, which is why the computer needs a standby control signal.

If all of that is correct and there is no battery, then missing from crutschow's schematic is a diode and capacitor to power the 4093 circuit after the power switch is opened. The capacitor is the power source for the timer circuit and the relay coil (or whatever the output is), so it stays energized throughout the "momentary" period.

ak
 

AnalogKid

Joined Aug 1, 2013
12,063
To clarify more . . .

What does the keyboard power switch switch? What does it turn on and off?

Specifically, does it affect the power source for the computer? If yes, how much holdup time does the computer need to put itself away nicely?

ak
 

MisterBill2

Joined Jan 23, 2018
27,231
Referencing the quote I see in post #12, a double pole normally open pushbutton will work, or a button operating a double pole relay.
If the keyboard does not use a momentary switch, then a switch designed for a single small florescent tube, with one section on/off alternate and also a normally open set of contacts, would work. No complicated electronics and good isolation.
 

Thread Starter

Powerin

Joined Jul 29, 2023
9
The problem with the capacitor to the relay is that the discharge requires a switched path to ground to give a rapid discharge when power is removed and the (apparent) single-pole power switch doesn't do that.

Below is the sim of an added XOR gate circuit (one IC) and MOSFET driver to give a pulse to the relay for both the on and off switching of the power.
The relay momentary closes (red trace) at the application and removal of power (green trace).

I assumed the power was 5V.

I believe that does what you want.

(Rsim and the Vdd connection to the relay is just to show the operation of the relay and is not used in the actual circuit).

View attachment 299465
The problem with the capacitor to the relay is that the discharge requires a switched path to ground to give a rapid discharge when power is removed and the (apparent) single-pole power switch doesn't do that.

Below is the sim of an added XOR gate circuit (one IC) and MOSFET driver to give a pulse to the relay for both the on and off switching of the power.
The relay momentary closes (red trace) at the application and removal of power (green trace).

I assumed the power was 5V.

I believe that does what you want.

(Rsim and the Vdd connection to the relay is just to show the operation of the relay and is not used in the actual circuit).

View attachment 299465
Yes that does exactly what I want. Thanks for that!
 

Thread Starter

Powerin

Joined Jul 29, 2023
9
To clarify more . . .

What does the keyboard power switch switch? What does it turn on and off?

Specifically, does it affect the power source for the computer? If yes, how much holdup time does the computer need to put itself away nicely?

ak
The actual console power switch switches 120V AC which goes to a multiple bank of 120V outlets inside the console. In turn the main amplifiers and several different power supplies are plugged into these outlets. The PSUs output both 12VDC and 5VDC which power different subsystems in the organ (we're talking 80's technology here). I was thinking of powering the "switch on/off circuit" from one of the PSUs and having the computer on a constant power source (the organ has both switched and constant AC power outlets inside it).

The original "computer" (hardware/firmware based) which produces the sounds has died and is too expensive to replace/repair. I am substituting it with a regular PC running MIDI sample based software. Even though it would probably be just fine powering the computer from one of the organ's switched power outlets, there is always the very slight chance that the computer might be doing something like writing to disk when you suddenly turned off the power and could corrupt the system. It's a church organ so I want it to be as reliable as possible.
 

Thread Starter

Powerin

Joined Jul 29, 2023
9
1. How long is "momentary"?
As long as it takes for a computer to sense a button push. I'm guessing 1/4s would be enough. It could be miiliseconds I suppose?
2. Do the computer and the keyboard share a common ground?
No.
Crutschow shows V1 as a battery that stays up after the switch is opened, and your post is not clear about the +5 V and +12 V being available after the console is turned off. My read of post #1 is that the keyboard's power switch kills all power in the keyboard but not the power to the computer, which is why the computer needs a standby control signal.

If all of that is correct and there is no battery, then missing from crutschow's schematic is a diode and capacitor to power the 4093 circuit after the power switch is opened. The capacitor is the power source for the timer circuit and the relay coil (or whatever the output is), so it stays energized throughout the "momentary" period.
Yes, that is all correct. At least that is how I planned to do it...there may be better ways.
 

Thread Starter

Powerin

Joined Jul 29, 2023
9
The whole aim of this is to have an instrument that any (non-tech-savvy) organist can walk up to and just switch it on and off using the existing console power switch.
 

Thread Starter

Powerin

Joined Jul 29, 2023
9
Thinking aloud here...it may be possible to replace the existing organ SPST 120V power switch with a DPDT and use one pole for the 120V and the other for 12V to power a relay with a capacitor in series. One throw +12V and the other ground with common going to the cap. Power on energises the coil only until the cap is charged. Power off grounds the cap which discharges via the coil. Is it too risky to have 120VAC and 12VCD on separate poles of the same switch?
 
Top