How to power on/off an embedded pc??

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I'm embedding my old desktop pc into my power amp - basically bringing it all 'under one roof'. I'm using the pc to do active crossover/EQ duty, and I am completely ditching the monitor, keyboard and mouse - its 'headless'...

I'd really like to use one switch to turn the whole thing on - but how do I do it elegantly? I could hotwire the PSU to automatically switch on when the wall AC is turned on by connecting the black and green wires in the power harness, but when I switch the AC off, the computer will just die. Is that okay?

Is there a better way to do this? It seems like the only option is some sort of sensor that knows how to boot the PC when the power amp is turned on, and then turn off when the power amp is turned off. Sounds complicated. How does commercial equipment with embedded PCs handle this?
 
You can set the PC to switch on automatically every time the wall AC is turned on, using the "Power after AC back" setting which is somewhere in the BIOS options.

For shutdown you'll need some kind of relay that is unconductive with AC on and conducts for a second when AC switched from on to off... interesting thing to think about.

If you can live with a double-pole triple-throw switch then you can have the amp on at the lowest position, the middle position of the other pole is connected to the power button header of the mainboard. The PC will be eternally connected to AC though.
 
The PC power button generates an ACPI event. In linux you can hook any script to this event. If the script calls the halt command, the system shuts down correctly upon pushing the power button. Or even better, instead of shutting down the system can be suspended to memory, for faster startup later on. I would be surprised is there was no third-party tool handling ACPI events in windows.

A simple relay activated by your PC PSU output lines can switch the power for your amp.
 
You can set the PC to switch on automatically every time the wall AC is turned on, using the "Power after AC back" setting which is somewhere in the BIOS options.

For shutdown you'll need some kind of relay that is unconductive with AC on and conducts for a second when AC switched from on to off... interesting thing to think about.

If you can live with a double-pole triple-throw switch then you can have the amp on at the lowest position, the middle position of the other pole is connected to the power button header of the mainboard. The PC will be eternally connected to AC though.

I've been running a PC with an external power on timer but manual shutdown for years. This last vacation I added external off but it isn't elegant. It does the same as you pressing and holding the power switch for 5 seconds - a forced crash. I suspect it would take a small logic system to power it down nicely. Trigger the 1 second event - which _should_ shut it down - but might not if the PC had severely crashed. Wait 30 seconds and verify the PC is off so no more to be done. If the PC is still on after 30 seconds (arbitrary number I made up), then force a 5 second button press.

My power device is very simple with a relay powered by the PC which 'enables' one of 2 timer controlled power supplies (start time and end time) to a second relay that actually parallels the PC power switch. At power on the a timer turns on a 'wall wart' to activate the second relay. As soon as the PC turns on the wall wart is disconnected so it will no longer do anything at all.

The logic would actually be very simple consisting of a counter/divider to generate a 1 second pulse followed 30 seconds later by another pulse but at least 5 seconds long. If the PC shuts down normally with the 1 second pulse, the PC powered relay will disable the later 5 second pulse but if still on, the 5 second pulse will finish the job.

You could likely use 3 555 timers for this but I tend to not use 555s.

The 'installation' is very simple. The case 'power switch' connector plugs onto the board and a new 2 wire connector plugs onto the motherboard.

 
So I've been looking at a lot of different options, and I think I have things sorted out...

The main thing I'm looking for is a 'soft shutdown' for the pc - something to initiate a regular shutdown sequence. This has to be done in the software somehow, and the easiest way to do it just hold the power button for 4 seconds. So what I've decided is to rig a relay off the computer's +5v that switches on/off the AC to the power amp. So I only need one switch for the whole thing, and it should be a pretty easy solution to implement.

Thanks for all the ideas!
 
So I've been looking at a lot of different options, and I think I have things sorted out...

The main thing I'm looking for is a 'soft shutdown' for the pc - something to initiate a regular shutdown sequence. This has to be done in the software somehow, and the easiest way to do it just hold the power button for 4 seconds. So what I've decided is to rig a relay off the computer's +5v that switches on/off the AC to the power amp. So I only need one switch for the whole thing, and it should be a pretty easy solution to implement.

Thanks for all the ideas!

Your 4 second hold is what I called the 'forced crash'. It doesn't seem to bother Win XP but it doesn't strike me as the best method as it never reports "windows is shutting down". It just stops.

 
The main thing I'm looking for is a 'soft shutdown' for the pc - something to initiate a regular shutdown sequence.

As I told you pushing the power button is handled by SW (even your existing configuration does so) and can be used to shut down your system properly, no user intervention (confirmation) required. I think it is even the default behaviour in WinXP.

Did you consider suspending to memory instead? That would make turning the combo on MUCH faster.
 
I'd be interested in that (suspend to memory), I just don't immediately know how to automate it. The main concern I have is that I've seen, a number of times, where a computer has been left on for a couple of days, and starts acting funny - and a quick off/on always solves it. So turning the whole thing off may help in terms of reliability - but, yeah, it does take a little longer...
 
I'd be interested in that (suspend to memory), I just don't immediately know how to automate it. The main concern I have is that I've seen, a number of times, where a computer has been left on for a couple of days, and starts acting funny - and a quick off/on always solves it. So turning the whole thing off may help in terms of reliability - but, yeah, it does take a little longer...

I do not know which OS your embedded PC uses, but e.g. in winXP you just change the power button action to "Standby" on the power settings panel.

You can always hard-reset by pushing the button for a few secs.
 
As phofman has said, pushing the power button momentarily will initiate a controlled shutdown, where the computer closes all open files and saves it's settings.

Pushing the button for ~5 secs forces the PSU off and is normally only used when the PC locks up and refuses to do anything including shut down, this leaves files open and although XP and later systems almost invariably cope with it, it runs the risk of something being corrupted if a write to the hard disk is interrupted. Start-up is protracted anyway due to the disorganised state of the file system if you force the machine off like this and in the worst case a re-install may be required.

Have you checked that you can actually get the machine to start without the keyboard, mouse and monitor? Some PCs may refuse to do so, and although there may be BIOS settings that will allow it, it'd be better to check now than discover later that you have a problem.

w
 
what powersupply are you using in your pc?

with many of the mini-box powersupplys you have a ACC trigger ,which will shut down the pc after a certain amount of seconds and after a minute or so it cuts power completely.

M3-ATX-HV, intelligent ATX automotive power supply, 12/24V - power your PC in a car

I have been doing tests using a atom pc with a 4gb flash drive. with no monitor attached and 1 gigabyte of ram it only draws 900mA from a 12V powersupply.

The 2A 9V transformer you will use for this can be always on or you can add a lm555 circuit to switch that off also with a relay.

It can from 6V to 34V DC

Not sure what your pc specs are you might use a much smaller one.
 
Questions:

  • What OS do you want to use?
  • What kind of switch are you using? (SPST, SPDT, DPST, DPDT, momentary?)
  • What are the details on your BIOS (manufacturer, revision)
  • Which motherboard are you using? (manufacturer & model #)
  • Have you looked through your BIOS options for power options, which ones are available?

Note: You should never do a 'force shutdown' on a computer because it increases the risk of losing data and corrupting your file system. In windows, if the system doesn't shutdown nicely, it will boot into the your computer wasn't shutdown properly last time screen which may delay boot times or halt boot completely.

Always opt for the soft shutdown method.

And the method to achieve that depends entirely on the OS and BIOS (manufacturer & version) that you have on the PC.
 
Actually, it just dawned on me that you're probably trying to mate the computer on/off behavior to the enclosing devices power switch (which is probably SPST).

Try going the other way. Mate the device's on/off behavior to that of the computer. Hook a 12v relay up to one of the power plugs on the computer's PSU that triggers the power to your device. That way, when the computer turns on, it turns on your amp (or whatever).

Then, replace the switch in your chassis from the one in your computer case and wire it to the mobo. Then it's just the software that handles the soft shutdown or suspend to memory features.

Actually, you don't even need one of the PSU plugs; just wire it to the Case Fan or Alt Fan port (also 12v).

Cheers,
Dave.
 
Last edited:
PS - You'll never make this completely headless. Neither OS will ever boot perfectly every time. There will be times when you need to hard-reset your system which will require you to interceded with windows.

Similarly, with linux, you will need to set the 'disk check boot interval' setting using tune2fs. Otherwise, your system will automatically do a filesystem check every 20-100 boots (thereby delaying boot time).
 
Also, I just realized that I'm assuming too much about your amplifier. If it's the kind that turns on when it gets power then the above will work.

However, if it's like my Denon, which has a power switch plus a soft switch, you'll need to design a circuit that generates the momentary press of the power switch to the amp.

I've no idea if this can be achieved with some simple gates, caps, or whatever (probably with some caps to delay the momentary press; shrug) but it can be achieved with a timer circuit and, optionally, an ALU (though it would take me a few months to design the circuit as I really don't remember all that much from the classes where I built the PDP-11 CPU.

Cheers,
Dave.
 
Last edited:
Questions:

  • What OS do you want to use?
  • What kind of switch are you using? (SPST, SPDT, DPST, DPDT, momentary?)
  • What are the details on your BIOS (manufacturer, revision)
  • Which motherboard are you using? (manufacturer & model #)
  • Have you looked through your BIOS options for power options, which ones are available?

Note: You should never do a 'force shutdown' on a computer because it increases the risk of losing data and corrupting your file system. In windows, if the system doesn't shutdown nicely, it will boot into the your computer wasn't shutdown properly last time screen which may delay boot times or halt boot completely.

Always opt for the soft shutdown method.

And the method to achieve that depends entirely on the OS and BIOS (manufacturer & version) that you have on the PC.

And I'm working on a very simple soft shutdown that simply activates the power button for a half second, waits 45 seconds and then activates it again for 5 seconds. I have a whole bunch of Motorola (Freescale) 68HC908JK1 processors from a different project that would do this just fine. Should only take 3 resistors, 3 capacitors and a 2N7000 and a crystal.

 
And I'm working on a very simple soft shutdown that simply activates the power button for a half second, waits 45 seconds and then activates it again for 5 seconds. I have a whole bunch of Motorola (Freescale) 68HC908JK1 processors from a different project that would do this just fine. Should only take 3 resistors, 3 capacitors and a 2N7000 and a crystal.

Why don't you use the PC power button as the primary shutdown button and operate the rest of the chain with a relay hooked to the PC PSU line, e.g. 5V?
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.