Drawing current from a laptop computer... USB port?

So here's what i want to be doing. I want to be able to draw current from my laptop's USB port, and control how much and for how long.

Something on the lines of hitting keys on the keyboard to be able to turn on a wired device and turn it off, not like a charger which is always on.

sort by: active | newest | oldest
Yes, easy. Use an Arduino
Arduino seems the exact thing i needed!

now off to code it, while i wait for my device to be shipped :)
Though if you really want to control "how much", you'll need some analog circuitry in there to provide the programmable current limiter, rather than just a simple on/off switch.

"Hitting keys on the keyboard", of course, will require PC programming to recognize those keys and send the commands to the Arduino. How complicated that is depends on exactly how you want the controls to behave and whether you want them to be active while working with other programs or just in the device-control application.
It can be done in software to enable/disable the port - but generally only in lower level operating system like linux, not windows or macos.
oreodjr6 years ago
I'm not 100%, but the power given by the USB port can't be controlled by the laptop's hardware - save turning it on and off.

you'll need something between the USB port and whatever you want to power, like an Arduino