Morning everyone!
I'm modding my monitor and need a motor to start when the PC turns on (monitor moves into working position) and when it turns off (return to resting position).
My plan was to read the USB voltage. When the PCs mainborad gets power, the USB port gets power. That in turn switches a relay which adds a 9V power source on Vin (USB alone doesn't provide stable enough current).
This ist the first problem. How do I detect that the PC is powering up to start the motor? I need no communication at this point, just a "Ah! PC has power!" type thing.
Second problem is moving the monitor back. If I wait for the PC power to turn off, the monitor won't start returning to resting position until after shutdown (which is too long and not cool), but I would like it to be simultaneous. Best idea I've had to far was a sending a signal to the Arduino to shut down by adding an .exe file to the Windows shutdown batch. I'd write the file in C++ or java (I know, java and USB...).
Upon getting said signal from the computer the monitor should move to resting position, then switch off the relay to the 9V source, powering down the Arduino completely.
Is that even possible? Is there (as usual) a much smarter idea I haven't thought of?
I hope the question is understandable. I can gladly provide code and wiring, but I figured this is more of a general question not only referring to my particular setup.
Thaks a bunch,
M