Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 can enable devices easily, so you need to run devcon as a task – Crujach Aug 14 '12 at 8:14

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .