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 powering PIC circuits

Status
Not open for further replies.

Hippogriff

Member
For years I have been using PICs at 5V and RGB LED strips at 12V. Sometimes I power my circuits from AA battery packs (12V) and sometimes from a wall-wart PSU (also 12V), so I have made great use of voltage regulators like the 7805, MAX667 and ADP667 (when I couldn't get the MAX667) for the PIC.

I've now moved wholly over to the WS2812B RGB LED strips... individually addressable, seemingly just as bright, initial PITA to get working... but 5V! Yay!

Thinking how ubiquitous USB is, I've just ordered some USB female sockets and I've going to try and use these for power in the next circuit. Different USB ports seem to provide 500mA, 1A and 1.5A (and you may never know what you're gonna get) - but they all should push out 5V. My question is - if I create a circuit designed to be powered by USB - whether that be something from a USB wall-wart, a PC's USB port or even one of those household plug sockets with USB sockets built into them... can I get rid of my voltage regulators? Is there anything (gotchas?) that I need to be aware of before I rush headlong into this?
 
hi,
I use USB from PC's and Laptops to power PIC equipment and other circuits, if you keep the current drain less than 500mA most PC's will be OK.
E
 
Lovely.

One thing I was kinda worried about... and please forgive my terminology here... is the "cleanness" of the power supply... my previous wall-warts were always the switching regulated kind (I just thought they were required) and I also thought that the voltage regulators always did something to make sure there were no "ripples?" or suchlike in the power supply etc. - so the thought is that I can trust the power supply coming down a USB cable (from anywhere?) to be good enough for my PIC... I can dispense with the 7805s and the 667s and nothing extra will be required?

BTW... around a metre of this WS2812B LED strip at full white can be around 1A, so I'm going to need the appropriate USB wall-wart or wall socket (I've seen these at 1A, I think there might be ones that go to 1.5A).
 
This link shows the voltage range for USB
https://en.wikipedia.org/wiki/USB

Its wise to add decoupling at the driven PIC end of the cable, I use 10uF thru 22uF and a couple of 100nF on the power rail,
 
iPhones and iPads charge at as high as 2.1 amps, so USB "wall warts" that can handle this much current are getting common.

I frequently use USB wall warts (with a USB socket) or other wall warts salvaged from phones to power my PIC boards. No special steps taken and I've never had any problems.
 
I've ordered some USB sockets... going for the bigger sized Type B and Type A in the first case. Although most plugs you see nowadays end in the smaller types (I think there was a standardisation drive - good on Europe! - for phones). I am not sure if I can get the smaller types of USB socket that aren't designated "SMD" when I want the through-hole type for cramming in breadboards and soldering to veroboard. Some of the actual wall-warts I have have a USB socket on them so any cable can go in there... looking forward to trying this. Once I say to someone "my circuit is powered by USB" it will bring a whole new air of acceptability and respectability to them - no longer will they be Frankenstein monsters that people shun.
 
Using a USB socket does make it easy to connect power, that's for sure. The battery "power banks" for extending cell phone talk time work great to power a PIC circuit too, so you can easily make something portable or take it for show & tell.

Most of the time, for more quick & dirty development work, particularly with a breadboard, I usually just cut the end off a wall wart and graft DuPont connectors to each wire. If you do this to a USB cable, you can still plug in into a USB wart wart, computer, or battery for power.
 
Another tip, for using a breadboard. Search on "breadboard power supply" on eBay. For a couple bucks, you can buy a circuit board like the one shown here. It plugs into the power rails of a breadboard, and provides 5v (directly from USB) or 3.3v from a regulator to each power rail. One rail can even be 5v while the other is 3.3v. These boards are offered by many vendors but all seem to be built by the same company. The price on these things is insane – cheaper than you can even buy the parts. Do note....not all breadboards use the standard rail – rail spacing.

image.jpg
 
The recommended value is 10uF thru 22uF as I posted, plus the 100nF's
 
I was scrutinising my Asus Nexus 7 tablet's USB PSU... it's 5.2V and 1.35A... do differences like this matter? As I said before, I thought USB was 5V all the way, but I read the link provided by ericgibbs. Will I still need / should I still have a voltage regulator in my circuits? I know PICs can handle a bit higher than 5V (5.5V) as the datasheet is explicit... I did not think I'd get much info. on the WS2812Bs, but that seems OK to 5.3V too.
 
A nominal 5 volts will be fine.

The current can be anything greater than your circuit needs – the circuit will only draw the current it needs.

Here's an article that may be helpful: AC-DC Power Supplies – Using Wall Warts

One thing I found while researching this article – most switching supplies will take care of themselves. If you draw too much current from them (over their rated limit), the output voltage falls off.
 
So, my USB type A sockets arrived and, yes, they work... but I'm quickly coming around to the belief that I should be using a 5-pin Micro B socket / receptacle on any board that I knock-out, for the simple fact that this is what all the phone chargers will have on the end of them due to the European Union standardised External Power Supply directive. I'm definitely struggling to find an appropriate through-hole variant of this receptacle at the moment (on eBay at least)... one that I can work with. Due to the size most seem to be SMT.
 
I don't think I found any that were through-hole when I was looking. If I recall correctly, the best option was a connector with a couple bumps on the bottom. Two holes in the circuit board receive the bumps to help position it during soldering. But the leads are accessible, so it's not too difficult to solder them with a fine-tipped iron.
 
For a recent design, my client wanted to use a micro-B connector for power. This stack of boards is installed in a thick panel, with no clearance on the sides. As far as I can find, vertical mini-B connectors do not exist. To ensure enough room for the cable, I would have had to notch my board almost all the way through. That wasn't going to work!

We settled on a full-size vertical B connector, a standard USB cable and wall warts with a USB connector. These are available for less than US$5 new.

image.jpg
 
And I might have to settle for something different too... probably the type A receptacle, I think... but it would be very cool to have a Micro B receptacle I could work with bearing in mind the fact that these adapters (whether with detachable cables or captive) will be everywhere (over here)!

https://en.wikipedia.org/wiki/Common_external_power_supply#Cabling.2C_connectors_and_adapters

I've already had to use a gender changer dongle on my USB charger and a found cable - cable was type A plug at the wall-wart end and type A socket at the other... needed to get it to type A plug so it'd go into my socket. If I gave the circuit to someone I can't really expect them to have a type A plug / type A plug USB cable I reckon... they seem like hen's teeth, I've certainly not found one in all my miscellaneous cables, or a type A gender changer... much better if I can fit in with everyone else... I don't want to be unique - just like everyone else!

The search continues, for now...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top