Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

USB removal detection using circuit

Status
Not open for further replies.

rrsuj

New Member
Hi,
I would like to detect usb removal using electronic circuit. I have already checked the power line of the usb port. The difference in volt and current between the usb stick present on the port or not present on the port is only 0.09V and 500 microamp. So how can I use these values to generate logic 1 (usb stick present) or 0 (usb stick not present) by electronic circuit?

Any ideas???

regards,
rrsuj
 
When the usb is removed the data line has a rise in data amplitude above 625mV because of the 5 NRZI bytes - 01111111 - 11111111 - 11111111 - 11111111 - 11111111, but how could this little rise can be detected using circuit? How can I achieve logic 0 (no usb stick present) from there?
 
I don't know what you want to do with your logic signal, but here's a circuit which will light a LED when a current (e.g. 500uA) greater than a threshold (set by R1) is drawn :-
CurrentMonitor.gif
The 100 Ohm current sense resistor R3 does, however, drop the voltage by 0.1V per mA current drawn, so would need to be replaced by a lower value if the USB port load draws significant current.
 

Attachments

  • CurrentMonitor.asc
    1.6 KB · Views: 119
hi rrs,
Could you tell why you need to detect the USB connection in this way.?
Is it for only for use on one PC or many.?
E
 
The 100 Ohm current sense resistor R3 does, however, drop the voltage by 0.1V per mA current drawn, so would need to be replaced by a lower value if the USB port load draws significant current.
I really don't like adding 100 ohms in the ground lead.
You can check by software.
 
Hi alec_t,
I was on holiday, Sorry for late reply. Thank you for your circuit. I am not an electronic expert, correct me if I am wrong. The circuit shows that +USB is connected to 5V (Vusb) external source. Does it not affect the USB port in any way?
 
Hi ericgibbs,
I want to check the presence of USB device in a port of a host computer from another machine, because I have no access to the host computer software.
 
The circuit shows that +USB is connected to 5V (Vusb) external source. Does it not affect the USB port in any way?
The 5V external source was just for the simulation. In practice it wouldn't be used. The circuit isn't ideal, because some voltage is dropped across the current-sense resistor R3.
 
Each USB hub will have PTC current limiters or current shunts that are be used to report consumption on SMB bus to Windows on demand. A Mod similar to what alec_t suggested would work or locate the sense amp signals. Then port out via serial, RF, piezo audio or hard wired logic level.

They can also be disabled with Administrator pw and disabled for other users in admin group.
 
Hi alec_t,
I also tried your circuit and the led on the circuit works. But now the operating system does not detect the USB any more. Also the led embedded inside USB stick is continuously blinking. So it is possible to detect a USB stick present or not with your circuit, but this feature is not beneficial if we cannot use the USB stick from the PC. Do you or others have any solution for that?

 
You could try reducing both R2 and R3 by a factor of ~3, but there's no guarantee that will overcome your problem. Or you could try the alternative that Tony suggested in post #10.
 
Good to hear it's working for you.
 
Hi alec_t,
Sorry for my late reply. I forgot my password for this site, but could not recover due to problem of the password recovery functionality.

Anyway, the circuit also perfectly worked for me. Thank you so much for your help.
 
Last edited:
You're welcome.
 
Hi alec_t,
I was trying to send you a private message, but I think you blocked any personal message. Is there any place where I can put a private message for you?
 
Sorry, but I prefer to keep things in the forum.
 
I understand it. But it is about patent related issues, so it is not possible for me to discuss in public.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top