I'm working on a project in which I need to be able to toggle the power to a USB device connected to my laptop. My original intention was to reduce the 5V USB power to 3V, and then toggle the USB on and off with a program I would write. However, after some research it would appear that it is not possible to turn USBs on and off with code.
With that in mind, I'm wondering if it would be possible to use the D+/D- lines as a togglable "power source" for my device. I've read in several places that the data lines on USB's are 3.3V? Is that true for all data USBs, or am I missunderstanding? If its true, then I could theoretically reduce those 3.3V to 3V and it would solve my issue (as I could send/not send data).
I'd also like to importantly point out that I say "power source" because it doesn't have to be constant, just a short on/off pulse with a high enough voltage.
Also I realize that there are products that exist on the market that I could buy to simplify my issue, but the idea of my project is to use things I already have available to me (just the usb device, resistors and cables).
I also should have noted exactly what my project is - its very much a patchwork project. I've hijacked the remotes for two strings of Christmas lights. I've hardwired one to be permanently on and other permanently off. Each remote originally contained a 3V Lithium coin battery (CR2025). Instead of hijacking the IR system, I decided it would be easier to hijack the power one. So I decided to replace the battery with USB power, which is where I ran into my problem I stated above.
Pulsing the USB power to the ON remote will simulate me pushing the ON button, and likewise for the OFF remote.