[Boolean90] hacked a cheap USB car charger into a variable power supply. His proof of concept is to use this as a variable-speed motor controller. The best part is that nothing is being abused, the regulator inside is still running within manufacturer’s spec.
While we’ve seen similar hacks before, [Boolean90]s video is pretty cool and provides a nice insight into the components used in these cheap devices. Rather than a linear regulator, which would dissipate too much heat the device uses a common jelybean MC34063A (PDF) switching DC-DC converter which costs about 10 cents on eBay (about two dollars for twenty, shipped). Here it’s used to step the car batteries 12 volts down to 5, but can also be used in step-up and inverting configurations.
Like all switching buck converters the MC34063A uses a PWM (pulse width modulated) signal to drive an inductor and capacitor, which effectively form an LC filter. By controlling the pulse width, the output voltage can be regulated. [Afrotechmods] has a great tutorial on the basic principle. The regulation is controlled by feedback resistors. [Boolean90] simply added a variable resistor to allow the output voltage to be controlled.
Neat hack [Boolean90]!
23 thoughts on “Crack Open A USB Car Charger To Make It A Variable DC-DC Converter”
Would it be a good idea to put a diode across the output from ground to output voltage to handle voltage spikes using a motor like that?
” MC34063A uses a PWM (pulse width modulated) signal to drive an inductor and capacitor, which effectively form an LC filter.”
No, that is not what is going on here. Here’s a good description:
Thank you. I had the same thought.
Meh, I feel like this is an argument of semantics. It alternatingly connects power then ground to an inductor and capacitor. Thinking of it like a PWM signal with an LC filter isn’t a terrible way of thinking about it. It might be a little misleading, but it gets the general point across.
…Actually, I suspect that’s not a terrible model for this topology of buck converter. True, it’s controlled per-cycle, but considering it as a voltage source switching between gnd and Vin fed to a relatively extreme lowpass LC filter is not particularly inaccurate.
The car USB charger is a bit more complicated than the one featured in HAD a while back that used only a resistor and an LED? B^)
I mean this one…
if it turns out to be a double post, I’m sorry, but my browser hung while posting (MS Explorer)
Now someone should just figure out how to do this for ATX power supplies, and then for car alternators.
Car alternators are actually very easy to control, people often build welders using them. You just remove the regulator and build your own system to control the field coil. 12v into the field coil = 100% output, 0v into the field coil = 0% output, and of course you can do any voltage in between. Then you just either need an analog circuit or a microcontroller to measure the output voltage and adjust the field coil accordingly. Or if you want a constant current power supply you can measure the current output and use that to adjust the field coil.
You can and people have done both. This page describes how to modify it to put out +-40V from the +-12V lines. Google translate does wonders.
Don’t forget the minimum load.
As for alternator control, decades ago you could buy plans from the back of magazines on how to rewire an alternator to run a 120V drill. It only works with universal motor drills, which are AC or DC, but fortunately most handheld 120V drills are universal motors.
I have been doing this a couple of times i.e. converting an ATX (or other format) PC supply to an adjustable supply.
One of them I made almost 20 years ago, and it still functions as a nice car-battery charger which I use regularly (I added a constant-current feedback loop). It’s only 200W though.
Currently, I also have a nice 2.5V to 20V, 700W adjustable supply (ATX) on my bench.
Takes quite a lot of reverse engineering and modifications though.
Things to consider:
– Make sure to replace the capacitors if aiming at >16V output (you need low ESR models)
– Even greater voltages might require re-winding the trafo and replacing the schottky diodes too.
– Rework/remove the safety circuit (if fitted). Normally, it monitors all the supply voltages and will shutdown the PSU in case of irregularities
– Rework how the regulator circuit gets supplied as it is typically supplied by e.g. the +5V. Possibly add a small external supply for this purpose, depending on how the PSU is designed.
– If you like adjustable current limit and/or constant-current capability, you need to add another feedback loop. Might be tricky depending on the design and will require some effort to get stable.
– You’ll easily see some instabilities/oscillation depending on how you rework the feedback loop.
All in all, if you want a good result, it is quite complicated. But you might learn a lot about PSU design along the way :-)
Might be easier to get a 24v laptop PSU and simply down convert the output.
Or you can redo the connection of the windings – they have a lot of finer magnetic wires in parallel for the secondary side. So if some of them are connected in series, you’ll get a higher output range without stressing the primary side. You can’t exactly make a 24V from a unmodified 12V winding without giving the primary side a very hard time.
I did a workshop for OlyMEGA where I did a teardown of several 12V cigarette lighter to 5V USB charger connector. I found that the longer ones use the MC34063 and are a great deal from dollar stores as you get rewindable inductor and shottky diode, too.
But there are a new set of charges so small that they fit flush in the socket, and they are fixed 5V output. Not as useful.
Did you ever write it up? I’d be interested in seeing a comparison of the various topologies!
A bit older on the same topic: http://hackcorellation.blogspot.de/2013/07/experiment-usb-from-1v-instead-of-12v.html
The inductor is not designed for boost operation and probably is at the limit for a bux converter (get it?).
TLDR; is to read the datasheet, they most of the times get it right, otherwise it’s a dirty hack that will not last.
Good hack; I like this one.
…and now as I look around I begin to realize how many USB car chargers I have lying around (2-in-1 deal, I got car & wall chargers for about $2 a pair), and I want to know what’s inside them…
Good hack? Where’s the Arduino? B^)
Been doing, and documented that /years/ ago [ http://bliterness.blogspot.co.uk/ ]. You can get much, much smaller DC-DC than this article shows too. However, these days you can get tiny Dc-Dc by packs of 5 from china that are a lot easier to purpose, as you can change the output voltage.
Those car chargers typically have “2A 5V” rating, but they mostly use MC34063A, chip that can deliver about 750mA. And they don’t have external MOSFET for inceasing current.
the MC34063 is really really old part. It runs at 100kHz, so it requires huge inductors values, doesn’t have MOSFET drivers nor uses sync rectifiers. There are plenty of single chip solution that have internal MOSFET and much higher current and cheaper than it when you add a MOSFET and additional support parts to the BOM,
The chip itself is pretty much a no good for anything more than 250mA.
34063 is a crap converter for a 5V usb car charger. Todays handphone needs the least 1 ampere to charge and play. Most of the market car charger usb socket listed up to 4 amperes has this cheap 34063 and cannot even supply 1 ampere. This 34063 also has no protection against reverse voltage and damages easily. Why still emphazied on such an old lousy chip? It does not even save cost and none satisfatory charging. This 34063 is only good for very small application which needs less than 500mA. But for 500mA and below, I rather use a simpler and cheaper design using voltage regulators.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)