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.

New product - USB charging, drawing 500ma from host (various headaches).

Status
Not open for further replies.

SammyG14

New Member
Hello all,

First post on here so Hi to everyone!

I am a product designer developing a project that will be on Kickstarter hopefully pretty soon. I am currently finishing off improving the design and have various parts coming in for the prototype. Some improvements I am currently doing is refining the program for the product, and making tweaks to the electrical circuit. Now bare with my electronics isn't my strong point, so please correct mistakes so I can learn!

Ok, so basically at the moment the product can charge via USB. It basically has a USB mini B connector with + and - wired up. + is wired to a diode to drop the voltage and then a resistor to drop the current to a battery (1/10). D+ and D- lines are not connected. I quickly learnt that USB hosts vary in the power. So a dedicated USB wall charger will give 500ma due to shorted D+ and D- lines which is fine, that is exactly what the circuit is designed for, pulling 5V 500ma down to 3.6V 200ma. However, as soon as you start looking at USB buses and hosts on computers the current gets more complicated. So all USB 2.0 will give your device 100ma when plugged in. However, it will not give more than 100ma until enumeration which configures it as a high power device which can then draw 500ma.

How does one make my USB design to be able to be enumerated into a high power device once connected to a USB bus. A lot of people charge things via USB from computers making it a much needed feature. Are there any shortcuts? I have read you can use power management chips although these are expensive. I have also read that the host realises that a device is high speed by using a pull up resistor from d+ on the device, although I am not sure wether this effects power or data speed.

The USB port on the device will only be used for battery charging and direct power. No data transfer is required.

So to sum up, how would I make the device able to withdraw 500ma from a computer powered USB host.

Any help and pointers in the right direction will be massively appreciated! This is the last little hurdle until Kickstarter now!

Many thanks,
Sam
 
...A lot of people charge things via USB from computers making it a much needed feature....

But it is such a stupid idea to do so. Lets see, lets leave a 400W computer running (doing nothing else)for several hours just so we can charge a 5W thingy...
 
But it is such a stupid idea to do so. Lets see, lets leave a 400W computer running (doing nothing else)for several hours just so we can charge a 5W thingy...

Not necessarily, depends on the product. If the product works alongside a computer it makes sense for someone to charge it whilst using a computer. I do completely agree that one option I do have is to sell it with a USB wall charger. However, as so many people do charge things running off a computer (regardless if its a good idea or not) its a good idea to incorporate such a function into the product regardless. People are not just suddenly going to stop using computers to charge devices through USB.
 
You state that you need 200mA at 3.6V which is 0.72W. The USB will supply 100mA at 5V which is 0.5W. I suggest an efficient power supply and the charge time will increase by 50%.

Mike.
 
I can gain that 50% through enumeration, I am going to look into the USB tiny code that looks like a good starting point.

I think supplying a 500ma USB wall charger with the product is also going to be a good idea.

I should probably tell you guys about the batteries, they are 3 x AA rechargeable NiMH batteries in series, giving 2000mah at 2.6V (this is why 200ma is ideal, I could go higher but then I would have to have some intense battery management software and wiring I believe due to the current been over 1/10th of capacity).

USB power for charging also provides the device with direct power as well for continued use whilst charging.

Still looking for more suggestions...

Thanks guys!
 
Hey guys, an update.

Ok, so from doing ALOT of reading over the last few days, usb enumeration is no simple task. For a standardised connector, it really isn't that standardised! So I decided to start from the basics again and wire up a simple usb circuit to see how much current I can actually pull from my computer without enumeration.

So from my mac mini, with a 13 ohm resister in series with the + wire from the USB, I can pull 320ma. It should be 385 but I guess the current drop is from a slightly smaller voltage than 5v. This is great, I don't need USB enumeration.
So from what I have read and learnt, most mains powered computers will deal with pulling 500ma no problem without USB enumeration. It would make this slightly less, say 450ma to ensure the USB port does not shut down.

The problem comes when you start to use a laptop USB port for charging as many of these are limited to 100ma due to shared USB buses. This is when enumeration comes in handy as you then communicate with the device and request 5 packets, or 500ma of power. This communication goes back and forth from the host to the device about 8 times (simplified) until the host resolves the device and allows it to withdraw the connected current. This involves coding a small IC to communicate, or I could maybe add the code lines to the main IC, problem is I am not experienced with C code, I use flowed and learning it is going to take too much time. If I try and withdraw 500ma from these devices using the same method as above, the USB port will shut down due to the 100ma cap before enumeration, which obviously isn't good enough for a product to be sold.

I think for the prototype I will just withdraw the 450ma straight off, and use a zener diode as a voltage regulator, stepping the 5V to 3.6V. Only me and my business partner are actually going to own a prototype so this is fine, I am thinking if I get the required funds from Kickstarter that I will just pay for someone to code and wire the charging aspects of the device before the final mass production design gets made. This to me seems sensible as I think experience is very important, something I lack of in the electronics field, especially charging circuits and battery management. I have got a lot of design work to get on with anyway. USB enumeration done by a professional would also open up the opportunity to do data handling etc, which would open up some new areas for the product which would be great.

Do you guys agree with this approach and what I have just said? I know I could learn it all and implement it, but running a business and designing the whole thing, time is of the essence.
 
But it is such a stupid idea to do so. Lets see, lets leave a 400W computer running (doing nothing else)for several hours just so we can charge a 5W thingy...
The PC does not need to be running in order to charge devices via the USB ports. The USB ports are supplied via the +5VSB rail which is "live" all the time.
 
The PC does not need to be running in order to charge devices via the USB ports. The USB ports are supplied via the +5VSB rail which is "live" all the time.
None of my computers do that, not even the laptops...

maybe that is why your devices never charge up:D
 
None of my computers do that, not even the laptops...

maybe that is why your devices never charge up:D

Any modern PC with an ATX power supply but not laptops. I charge my phone and e-cig batteries all the time via USB on my PC when shut down.
 
Status
Not open for further replies.

Latest threads

Back
Top