Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to have a USB powered device (lets just say a USB lamp, for example) be automatically turned on at a certain time of day, and then automatically turned off at a time later in the day. I want to leave the device plugged in and switched on at all times. It would be like the USB/computer approach to achieving what one of those wall-plug timer units does, the ones that you plug your lamp into when you go on vacation so that it looks like someone is still home due to the light turning on and off during the day.

I was wondering if it is possible to set a specific USB port (just one, so that all the other ports behave normally) to be turned on and off on a schedule (probably making use of the Task Scheduler)? The computer is on 24/7, however, the user may be logged off. So I would also want this to work when no user is logged in (so this would also have to be set to be a service as well).

share|improve this question
    
Is it possible to disable/enable the device via the devicemanager? maybe you could find a Batch or Powershell-Script to enable/disable the hardware-ID. Google says that Maybe DevCon msdn.microsoft.com/en-us/library/ff544707(v=vs.85) can enable devices easily, so you need to run devcon as a task –  Crujach Aug 14 '12 at 8:14
add comment

2 Answers

I have had similar project in mind, and I must say you need an extra circuit involving relays (arduino is nice and easy to progam) to accomplish this. the problem is that you can reset specific usb ports but the usb ports will provide +5v as soon as pc in ON, and no way (I didn't find out till now) to turn the USB port voltage OFF Hope it helps a bit! Kind Regards

share|improve this answer
add comment

You would need to place a logic circuit on the data connection of the USB port in the device in question (the lamp for instance). You would also need to have a program running on the computer (a small one). It would say when X user is logged in send a signal to the USB port the device is on saying "on" (opposite for off of course). When the logic from the USB device receives the signal from the computer it would throw a switch (a relay maybe). This would be VERY easy to build out of an Arduino Nano (and simple to program). Use the Nano as the logic device, and connect it to a relay circuit to throw the switch.

It might be more effective to build this into a surge suppressor so that you can control every plug. This way you can turn on/off multiple items, and even have multiple users able to have multiple items turned on and off at login/out.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.