Using a 555 timer as a timed switch for a USB device?

Thread Starter

Dowapa

Joined Sep 3, 2021
13
Some times, simple and reliable is better if you don't know what you're doing. What about using a daily timer and a USB Charging Adapter. You an get the timer from Amazon, and plug it into wall power:
not relevant for this application since I’m plugging this USB device into my PC so my PC can read data from the device? And I need it to power for 30 seconds at a time at will… not on a schedule?

I believe you’ve misunderstood what I’m trying to do here.
 

MisterBill2

Joined Jan 23, 2018
18,462
not relevant for this application since I’m plugging this USB device into my PC so my PC can read data from the device? And I need it to power for 30 seconds at a time at will… not on a schedule?

I believe you’ve misunderstood what I’m trying to do here.
OK, if there is anything like the old batch file available in current windows that may do what you want. But if it is MAC, then no clue here. Batch files were very handy.
 

Thread Starter

Dowapa

Joined Sep 3, 2021
13
OK, if there is anything like the old batch file available in current windows that may do what you want. But if it is MAC, then no clue here. Batch files were very handy.
Yeah I don’t think changing the software is much of an option… I think to do what you’re describing I would have to change the initial handshake between the USB device and the windows OS… which I believe would involve editing the driver for the device. I don’t even know if if windows would let me edit it, and even if it would I don’t think I have the required knowledge in programming (most likely C or assembly) to make an edit like that… so I think that’s out as an option unfortunately~
 

eetech00

Joined Jun 8, 2013
3,934
Without getting too into the weeds of my project; what I am attempting to do is to control the plugging in and removing of a basic USB device. To accomplish this, I have cut open the USB cable of my USB device and have cut the 5V line. I plan to connect the two sides of the 5V line to two switches in parallel (such that either switch can be used to activate the USB device and simulate the device being plugged in).

The first switch is a simple toggle switch. When closed, the first switch would simply connect the line and the USB device would act as it normally would and stay powered as long as the switch is closed.

The second switch is the part where I'm having trouble and need advice. I want the second switch to be on a timer circuit such that when I press a pushbutton, the switch closes for <~30 seconds allowing the USB device to be connected and detected by my PC. Then, after the ~30 seconds open again, disconnecting the device.

Here is a rough drawing of the circuit. The bit on the bottom left is the male USB plug that plugs into a PC, the top left is the simplified USB device, with the Gnd, Data+, Data-, and 5V terminals. (I apologize for the low quality, I drew it quickly on my whiteboard just to illustrate my idea).
View attachment 256875

My original plan was too use a 555 Timer as a one shot to accomplish this, but I started to get confused because I didn't know how to handle my USB device being both the load and the voltage supply for the circuit. I'm also aware that the USB device probably expects a full 5V upon being plugged in, and I'm worried that undervolting the device (due to charging/discharging a capacitor in a 555 circuit for instance) could cause damage to the device or my PC (I don't know a lot about how USB ports and devices function and want to be safe).

This got me thinking that I might be approaching this circuit from the wrong direction and wanted to see if anyone could help me reevaluate my design. I am not tied to the 555 timer and am open to any ideas, criticisms, ect. I'm also not opposed to connecting the timer circuit to a separate, external power supply, but I feel there's probably a simpler solution that doesn't involve another set of wires.

Thanks in advance!
Here's one possibility.
If you can find a small powered USB hub, then you could use an inexpensive DC timer module of appropriate voltage, and a selector switch, to either turn on the hub for a short time, or bypass the timer. Its preferable for the "Selector" components to match the AC adapter DC output voltage that powers the USB hub.
1641877564657.png
 

sparky 1

Joined Nov 3, 2018
756
A USB device like an external audio soundcard could have special circuitry such as sleep/wake that is found in cameras.

https://rocelec.widen.net/view/pdf/jbi5fb48db/FAIRS27808-1.pdf?t.download=true&u=5oefqw

A USB external sound card would wait for the computer to boot up. A microcontroller listens for a USB signal.
The program does need to be loaded but the programming already exists. An led could indicate that the hub has made a
successful connection to the PC via USB then the switch can activate.
https://www.deviceplus.com/arduino/how-to-control-an-arduino-from-a-windows-computer/
 
Last edited:
Top