Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I have very small and simple electronic projects that I power up using the USB power connectors plus a resistor. For one project I require to use more than 100ma, however the USB port requires an enumeration process to be done before giving more than that (up to 500ma).

I've browsed TI.com looking for some IC that can help me with this task, however I'm not sure I'm on the right track (I've pre-selected LM3526 and BQ2402x ICs, but I don't fully undertand how to use them... I'm still learning....).

Is there any simple example circuit design that I can use to solve this? Ideally, it should be something that I can connect to an USB port and that will just give me an output of 500ma and more than 4.5V.

Thanks for the help,

share|improve this question
3  
Have you experienced a power that refuses to deliver more than 100 mA, or just read somewhere that a port might do that? In practice, USB porst that limit the current are rare. –  Wouter van Ooijen Apr 15 at 7:09
    
Agreed with @wouter . USB specs dictate that a device shouldn't pull more than 1 power block (100mA) before enumeration. But 99% of pheripherals ignore this, as do hosts. Occasionally you get things like the first generation raspberry pi, but that had hardwired fuses for 200mA on usb, a bad design. –  Passerby Apr 15 at 15:35
    
The other option you have is skipping the computers, and using a usb wall charger. No enumeration required. There is rarely any that come with charger side current limiting. –  Passerby Apr 15 at 15:39
    
Re: "experienced a power that refuses to deliver more than 100 mA": One of my circuits pulls 130mA with no issues... however, as this time I'm going to reach 400mA, I was curious about how I can "play it safe, by the rules", to avoid any possible damage to the computer and/or the circuit. –  Sebastian Apr 17 at 23:28
    
Thanks all for the help. It seems that I will just try to pull +100mA, and switch to a wall adapter in the worst case scenario, unless there is s simpler ICs (BTW, I haven't seen any comment about LM3526 and BQ2402x ICs... aren't they a good fit?... I don't mind about the cost). Samuel and Spehro answered exactly what I've asked, I'm not sure what's the best answer so I'll wait for more community votes to decide. –  Sebastian Apr 17 at 23:39
add comment

3 Answers 3

Consider Atmel's ATtiny85 with V-USB. It's an 8 pin AVR chip that you would have to program with V-USB, which is a software-level USB implementation that would enable the Enumeration Phase, which would allow you to use the entire 500mA available.

It's about a $1.50 in SOIC packaging, pictured below, which saves both space and cost:

ATtiny85 in SOIC packaging

Easily programmable and inexpensive, whereas the FTDI chip above (FT232R) is about $6 for one.

If you want to communicate with the chip, using V-USB also gives you the ability to act as a CDC-class USB device, which is akin to a serial port (UART), just like the FTDI chip.

share|improve this answer
    
It may be worth adding that the free V-USB is published under the terms of the GNU General Public License Version 2 what may require to purchase one of the commercial licenses if commercial use is intended. Its not expensive though. –  Rev1.0 Apr 15 at 6:48
1  
@Rev1.0 First of all, the GPL does not in any way or form forbid commercial use. It only (basically) requires that all derivatives of the GPL licensed software be free software as well. I really don't see a reason why would that be a problem if the AVR is only used to ask for 500 mA and perhaps UART use. Furthermore, there's no need to even post the modified source code on the Internet. It's enough to just make it available and it's allowed to charge reasonable price for the expense of sending the source code. That's how GNU financed itself back when GCC was on tapes. –  AndrejaKo Apr 15 at 9:00
    
@AndrejaKo: My comment wasn't meant to be specific to the use case of the original question and I just wanted to point out that the software MAY require licensing. For my own understanding: What if I use this firmware (maybe slightly modified) for a product that also uses a second (main) controller? Would I have to make both firmwares or even the whole product public if I don't want to buy a license or only the potentially modified V-USB firmware? –  Rev1.0 Apr 15 at 10:02
    
@Rev1.0 GPL only applies to software that is licensed under GPL. GPL wouldn't "infect" the other controller and it would definitely not "infect" the rest of the hardware. It only applies to the "slightly modified" code. You need to make the modification available under terms of the GPL and that's it. You don't have to host it somewhere (but that's the usual way) and you don't have to share modification at all if the product is internal to your organization. That's how Google gets away with not sharing GPL licensed and modified software. It's only for internal use. –  AndrejaKo Apr 15 at 10:08
1  
Also, you need logic to power up your application only after enumeration has completed and the host has switched to a configuration with 500 mA current. In order to test this, you can connect to a bus powered hub, which should not have sufficient power reserves to enable your device. –  Simon Richter Apr 15 at 11:47
show 2 more comments

You can use a FT232R USB-UART chip, as so:-

enter image description here

You'll connect your load on the other side of the p-channel MOSFET power switch.

They're easily available through distribution, and in not too intimidating a package.

The default power setting is 100mA, so you'll have to use a utility to program the 500mA you want into the USB power setting. FTDI has MPROG, which can be used for this purpose.

enter image description here

share|improve this answer
4  
And as an added bonus you get a full logic-level RS-232 connection. –  Ignacio Vazquez-Abrams Apr 15 at 3:02
add comment

While USB does specify no more than 100 mA are to be taken by the device, there is no USB host that actually implements such restriction.

You can easily pull even slightly more than 500 mA (before polyfuse or something similar kicks in) from any computer built in last 5 years. Yes, OS will be unaware of such pull but current going out will be perfectly fresh. :)

Based on your project description, you are not actually interested in USB device but just using it as a power source. While ignoring any specification might not be best approach, I am yet to see any computer that limits current under 500 mA.

share|improve this answer
    
At my previous job (GPS devices) a prototype managed to trip the 100mA protection on a Toshiba laptop. Probably something to do with its power management. I agree that desktops just won't care, 2.5W is peanuts for them. –  MSalters Apr 15 at 9:18
    
As @MSalters implies, this is more of an issue on laptops, and many cheap devices take account of this. You can't guarantee that just because a machine sits permanently on a desk it doesn't use a laptop motherboard though (some of the all-in-one PCs do). So it's fine for a hobby-project, but don't bank on it working in another machine. –  Chris H Apr 15 at 11:48
    
I personally have yet to come to see a working machine (including laptops) that actually enforces such low limits. Hell, most modern laptops easily go even over 1 A. And let's not forget that there are plenty of "professional" devices that use USB way over 100 mA (remember all those LEDs and glass warmers and god knows what else). I do agree with you that proper power enumeration is the way to go. But cheap bastard in me cannot get over getting a chip into device just for that purpose... –  Josip Medved Apr 15 at 14:52
    
On the other hand, many do have protection for over 500mA pulls. MacBook Pros and IMacs. –  Passerby Apr 15 at 15:36
    
@Passerby: Yes, most laptops do have over 500 mA protection. But I am yet to see one that offers over 100 mA protection that question refers to. –  Josip Medved Apr 15 at 15:54
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.