Detect when Host PC is on

Status
Not open for further replies.

gggggggg

New member
I am brand new to Teensy, but have Arduino experience.

I am wanting to use S5 power mgmt, and a Teensy to turn a PC on/off.

Turning on looks easy, configure S5 power on USB, then this - http://rasterweb.net/raster/2011/05/09/the-button/
Once its on, I am presuming off will be simple enough, calling a API or powershell or similar command/utility.

The PC that I am turning on and off is under a desk. I would love a way to power a LED when it wakes up to giver some user feedback. Ideally the moment power turns on, not waiting for windows to power up.

Does anyone know of a way to do this?

thanks
 
You could try sensing the state of the PCs power light either by adding wires to the LED assembly or if making modifications inside the pc isn't an option you could position a photodiode over the light.
 
This button is the most expensive space bar I've ever seen :eek:
For power off: If you are using Windows you can bind key-presses like "CMD-ALT-{any character key}" to batch scripts, that should do the trick with Teensy acting as a keyboard.
Regarding power on/off detection: photodiode for the PCs power LED is a good idea, maybe using an LDR is even better as you don't need a signal amplifier. (Or maybe there are photodiodes with some sort of TTL output? IDK.)
 
You can't just send some keypress to wake up the PC. What you are looking for is USB remote wakeup. It should work with the Teensy:
https://forum.pjrc.com/threads/26649-I-woke-my-Mac-from-sleep-with-a-teensy-3-0

USB should be suspended when your PC is off and get resumed by the BIOS reasonably soon after it's turned on. usb_private.h has a usb_suspended variable that may work for detection. (Note that Windows does a suspend/resume cycle as part USB enumeration.)
 
Regarding power on/off detection: photodiode for the PCs power LED is a good idea, maybe using an LDR is even better as you don't need a signal amplifier. (Or maybe there are photodiodes with some sort of TTL output? IDK.)
You can connect a cheap little photodiode between two pins of the Teensy with no additional components and use analogRead(). An LDR would work too, but they're annoyingly slow for this application. As an added bonus(?), If the photodiode isn't enclosed, you'll be able to read the light level in the room as well. :)
 
You can connect a cheap little photodiode between two pins of the Teensy with no additional components and use analogRead(). An LDR would work too, but they're annoyingly slow for this application. As an added bonus(?), If the photodiode isn't enclosed, you'll be able to read the light level in the room as well. :)

Oh that's interesting, thanks for sharing this piece of information! I thought the Diodes impedance and the ADC input impedance wouldn't work well together.
 
THanks all for your help.

My job just got easier, the newest model Intel NUC has a IO Header I can just plug into. Solves all my problems.

That aside, I have still ordered a Teensy, now I just need to think of a new project to use it for!
 
Status
Not open for further replies.
Back
Top