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 Power Detect...

Status
Not open for further replies.

AtomSoft

Well-Known Member
Hello all again im working on something yet again. Its has to do with USB but thats all i can say for now. Nothing serious. I made a schematic and wanted to know if its plausable. Im hoping since most devices included cell phones have usb connections and since they are most likely large companys they ground the USB connector to the board.

Hoping that the connector is grounded. I was going to use a 100k or more pullup on the casing on my USB connector to detect when its grounded so i can tell when a USB device is inserted. Do you think this will work?

usbpower-jpg.43519
 

Attachments

  • USBPOWER.jpg
    USBPOWER.jpg
    41.9 KB · Views: 535
Where does your detector circuit go? Inside the host (computer) or in the slave?
 
The device im making will connect to a cell phone or camera ... the CELL OR CAM will connect to my device via USB cable ... now the cable plugs into my device which i want to detect when it does.
 
I thought USB communication is a bit more subtle, isn't it? A 2550 unprogrammed according to the USB firmwares will render it undetectable, therefore I don't think the circuit you made will make it detectable by the PC, it's probably just like plugging in a laptop cooler.
 
ok a simpler question would be are most USB connector chasis grounded?

@ Vizier87

I want to detect the cable being inserted into my device NOTHING ELSE. just when its plugged in... DONT CARE ABOUT USB PROTOCOL.
 
Last edited:
USB has a 5V and GND pin, as well as the shield. Never used the shield, I just presume its grounded PC end, and I dont want any currents flowing in the shield due to any ground potential differences (bad for EMC).

Why not just detect 5V from the host?
 
my device powers the OTHER device. I want to simply have it turn on or off automatically when wire is inserted. I think most devices have a grounded chasis and if thats true this should work. Ill make a test run on it... something small and inexpensive like a cheap MP3 player.
 
Last edited:
Sorry I misunderstood the problem :), your idea works as long as the far end shield is grounded. If not you may have detect the increase of current due to the new device across a small valued resistor.

On a side note I thought shorting D+ and D- would be a bad idea. I have used 18F2550's and the USB PIC32's as of today, but never really looked into how USB really works the libraries are really good.
 
in all electronic devices i have seen that use USB, i.e Mobile phones, cameras, etc the shield on the usb connector is grounded. I belive it is done like this in case the +5v touches the casing of the connector it will not allow the device to power up. this is what i have found in my experience.
 
ok it wont work like that im making a new test now. I forgot i have to use the transistor to connect VCC not GND lol
 
Last edited:
@RichTheDude:

I read somewhere that when you short the D+/D- lines most devices see that as a charger and request more current from the device so charging is initiated...
 
ok it did work but i realized a simpler method to stay off untill connection... just connect ground to housing and when the wire is plugged it will short housing and ground on other side turning it on :D
 
Nice to hear you got it working :), generally I just use USB to get data in and out of embedded systems. I will keep the info in mind, thanks.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top