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).
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!
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).
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!