# USB Power(5 Volt) Switching Off/On?



## mbzadegan (Jan 13, 2014)

Hi,

I have a project that need_s_ to switch USB power (5 Volt) Off/On every 1 minute periodically. Now I'm using the poweroff command at startup, but I must turn on the PC every minute and It's very hard   Is there any way to perform this procedure automatically?


----------



## Crivens (Jan 13, 2014)

A mobile phone charger could also supply the power, but you would need some means of switching it. Maybe there is some way along the `apropos lspci` things which can allow you to turn the power to some device on and off. Script away as needed.


----------



## mbzadegan (Jan 13, 2014)

Thanks, I'm trying with `apropos lspci` now. I read/write on my USB but need to switch it periodically.


----------



## kpa (Jan 13, 2014)

Maybe usbconfig(8) can do that?


----------



## Crivens (Jan 14, 2014)

kpa said:
			
		

> Maybe usbconfig(8) can do that?


Thank you, that was what I was trying to remember and tried to point to with the "apropos".


----------



## mbzadegan (Jan 14, 2014)

Thanks to *a*ll,

I tried all of the suggestions but all of them could not completely switch off/on the USB Power. I must completely power down and then power on my PC every minute! Is there any command to power down the PC and then automatically power on?


----------



## Crivens (Jan 14, 2014)

Not really, if I remember correctly. The system can allow you to power off any PCI endpoint which has no driver attached. So you would need to load the driver and unload the driver, and then check if the power is also following this. I would need access to my laptop to check this out.


----------



## pboehmer (Jan 14, 2014)

What about using WoL (wake on LAN) to power the PC back up?  

Have you considered looking into something like an Arduino to do what you want?  Not sure what your skill set or budget is, but I'd imagine that you could easily build a circuit that switches on/off using a USB port or phone charger, parts from DigiKey, and a schematic found online for under $20.00.  Think along the lines of a simple LED blinking circuit, but with longer pauses between cycles.  Just a thought.


----------

