diyAudio

diyAudio (http://www.diyaudio.com/forums/)
-   PC Based (http://www.diyaudio.com/forums/pc-based/)
-   -   How to power on/off an embedded pc?? (http://www.diyaudio.com/forums/pc-based/171513-how-power-off-embedded-pc.html)

cuibono 7th August 2010 11:30 PM

How to power on/off an embedded pc??
 
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?

wwenze 8th August 2010 12:23 AM

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.

phofman 8th August 2010 12:39 PM

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.

stratus46 8th August 2010 06:45 PM

Quote:

Originally Posted by wwenze (Post 2265946)
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.

G

Speedskater 8th August 2010 11:25 PM

Don't some UPS units output a control signal to the PC to shut-down when incoming AC fails?
If so you could hook-up this control signal from the UPS but not connect the PC AC power to the UPS.

cuibono 9th August 2010 02:27 AM

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!

stratus46 9th August 2010 08:40 AM

Quote:

Originally Posted by cuibono (Post 2266920)
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.

G

phofman 9th August 2010 09:30 AM

Quote:

Originally Posted by cuibono (Post 2266920)
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.

cuibono 10th August 2010 03:17 AM

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...

phofman 10th August 2010 08:35 AM

Quote:

Originally Posted by cuibono (Post 2267914)
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.


All times are GMT. The time now is 01:37 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio


Content Relevant URLs by vBSEO 3.3.2