# 12v to 5v DC high efficiency SMPS buck converter using 34063 IC.

#### Mr RB

##### Well-Known Member
(Inspriation come from ETO member Mr Al who mentioned his interest in a high efficiency 5v supply to power his Tablet PC during power blackouts etc, see his thread here;

This project is a simple converter from 12v DC to a regulated 5v DC output at up to 1.8 amps, suitable for driving a tablet computer from a 12v car battery in a power blackout etc.

The circuit for this buck converter is nothing original, basically it is the circuit from the 34063 IC datasheet, and all I did was to use an external PFET instead of the external PNP transistor shown in the datasheet. The external PFET allows currents up to a few amps at good efficiency, however I have used hard current limiting at 1.8A for safety and good performance in this prototype.

Energy conversion efficiency is very high due mainly to the choice of external components used with the cheap 34063 SMPS IC.

PCB layout.
The prototype was tested in hardware, please excuse the messiness. The layout is far from ideal, I did it this way to allow easy swapping of parts and just to be lazy, to save the effort of making a PCB. However it still works pretty good, and a proper PCB would improve performance a little bit.

PFET choice.
I did not have a lot of PFETs in my parts box so I used a 100v 8A rated part. This was an SMD PFET so I just tacked it on the bottom of the PCB. It is efficient enough to not need a heatsink even at 5v 1.5A continuous output. The PFET I used was not ideal, it's "Rds on" value is about 0.3v at 1.5A (0.2 ohms) which is too high and costs efficiency. Going to a 50v >20A PFET with an RDS <0.1 ohms or <0.05 ohms would give a noticable increase in efficiency.

Schottky diode choice.
I used a TO-220 60v dual 10A schottky diode pack (total 20A). This is a no-brainer, although this is overkill these diodes are only $1-$2 and can also be pulled for free from any old PC PSU and most commercial SMPS supplies. Besides the safety of being very large and over-rated, the main benefit is these diodes have a very low forward voltage drop of <0.3v at 1.5A or 2A and this equates to reduced losses (more efficiency).

Inductor choice.
This is just a commercial "3 amp" 24mm total diameter inductor/choke available from hobby suppliers like Altronics Australia. I think it is a 220uH or 330uH value, but sorry I lost the paperwork. A few other powdered-iron toroid inductors were tried and it is not that critical. It has 51 turns of 1.0mm diameter wire if that helps. The inductor measured 0.32mV at exactly 1A DC, so DC resitance was measured at 32 milliohms.

Note re inductor value! A calculation based on the rate of current rise over time (seen on the 'scope) seems to indicate an actual inductand value of 191uH, so this would have been a 220uH 3A commercial inductor. (They usually measure less than the stated inductance).

Schematic and operation.
Sorry for the hand-drawn schematic! As you can see the circuit is minimum parts. It uses just two resitors to drive the PFET from the IC (same as the datasheet), this is not ideal but was done to test the concept and see if a PFET can be driven as easily as the PNP transistor normally is. PFET turnon is good at 0.07uS, but turnoff is not great taking 0.8uS. This costs about 1-2% efficiency. The 560 ohm resistor could be reduced to speed up the turnoff, but this would increase losses in that resistor so it is a tradeoff.

34063 SMPS IC.
The 34063 IC does all the clever stuff, mainly it regulates voltage at 1.25v on VFB pin5. Because of the 6k8:2k2 voltage divider on the output, this gives very close to 5v, I actually saw about 5.01v-4.99v Vout in testing, very nice.

Max current limit resistor.
The resistor between Vin and pin7 sets the max inductor current limiting, this was set by me to roughly 0.18 ohms to give 1.8A current limiting. (Imax = 0.32v / R = 0.32v/0.18 = 1.78A). The current limit is best at slightly above the max required current. This gives better safety and also helps stabilise oscillation.

Caps etc.
CT used the datasheet value of 1nF. That gave oscillator value of 26.2kHz measured on pin3 (with no load), however the whole circuit usually operated at 29-33kHz because of the way the regulation works in the IC. The filter caps; 680uF on the input and 1000uF on the output were chosen to be "good enough". Output ripple was approx 25-30mV which is fine.

Measured efficiency!
Code:
[b]Vin    Iin    Pin        Vout  Iout   Pout      Eff %[/b]
12.5v  670mA  8.375W     4.99  1.53A  7.63W     91.1%
12.5v  430mA  5.375W     5.00  1.00A  5.00W     93.0%
12.5v  210mA  2.625W     5.00  0.50A  2.50W     95.2%
Note! Readings were taken from meters with only 2 decimal point resolution and were not lab grade accuracy, so there may be a couple of percent error in readings.

Calculating efficiency (at 1.5A output).
The static power losses were seen on the 'scope and can be calculated;

PFET Rds on period loss = 0.3v / 12.5v = 2.4% loss

DIODE Vf off period loss = 0.28v * 1.53A * 0.56 offduty = 240mW = 2.8% loss

Inductor resistance loss = 1.53A squared * 0.032 ohms = 75mW = 0.9% loss

560 ohm resistor loss = 10.5v squared / 560 * 44% onduty = 87mW = 1.0% loss

Total static losses at 1.53A output = 7.1%
Calculated other (switching) losses = 100% - 91.1% - 7.1% = 1.8%

Last edited:

#### Mr RB

##### Well-Known Member

Scope current L1 inductor (on period) at 5v 1.5 amps.
(Measured on the current sense resistor). Above is the on period current through the PFET and L1 inductor. As it is a PFET this is inverted so the pointy bit at the bottom is the max current, the top is zero current. At 1.5A and 32kHz the SMPS is very stable, as switching period is reduced becuase the peaks just hit the 0.32v max current limit set by my choice of 0.18 ohm resistor. (However voltage regulation is still the main regulation).

Duty cycle is about 44%, and current ripple in the inductor is nice and low with inductor current averaging 1.5A (ripple of 0.56A, between 1.22A and 1.78A). The noise spikes I suspect are from from my messy PCB with power and load wires everywhere and 'scope leads laying around next to the PCB and wiring.

Scope current L1 inductor at 5v 1.0 amps.
Same thing but at 1A. Frequency dropped a bit, closer to the 34063 oscillator freq of 26.2kHz, but still (just) triggering on the max current peaks. Current ripple now larger from approx 0.5A to 1.6A (average output 1A). Timing is still 20uS/hdiv but says 40uS on the screen as I had zoomed my h-axis (sorry).

Scope current L1 inductor at 5v 0.5 amps.
Here the L1 current has gone "discontinuous" meaning the L1 current is reduced to zero during the end of the off period, and has to start from 0 amps again during every on period. Typical of the regulation system used in a 34063 IC, the timing will "stutter" as needed to maintain Vout regulation at a steady 5.0v. This does not matter and the 34063 can be quite energy efficiency when "stuttering" in discontinuous mode like this. At less than 0.5 amps the stuttering can become very erratic looking, but this is all normal.

PFET drain/source voltage (main switching waveform).
(The PFET on period is the top of the waveform). Above you can see the PFET turnon (through a 10 ohm resistor) is nice and fast, It was about 0.07uS turnon time. However the turnoff is poor, because the turnoff is from a 560 ohm resistor and is slow at 0.8uS. This costs significant efficiency.

Using an external digital driver (like a 12v CMOS digital buffer/inverter chip?) to drive the PFET would improve turnoff time a lot and increase efficiency, but this was a test of using the simple datasheet example circuit with an external PFET (instead of the suggested external PNP) and as proof of concept it still works well enough.

5v DC output showing voltage ripple.
Because it is a switching regulator there will always be some ripple on the DC output voltage. This is shown when running at 5v 1.5A and the ripple is typical and acceptable enough at 30-35mV.

Improving efficiency.
This circuit was thrown together very quickly to show how to use a cheap common 34063 IC to get a high efficiency supply from 12v->5v DC at 0-1.5A or so. If you want to invest some effort it can be improved further;

1. My PFET is not a good choice, using a better PFET will give an easy 1% more efficiency, and would be the first choice.

2. The inductor is just an ordinary "off the shelf" type. A properly selected inductor or a good core hand wound for best performance could allow lower operating frequency and less current ripple, and maybe less DC ohms, and maybe pick up another 0.5% efficiency or so. (For lower operating freq CT should also be increased to 1.2nF or 1.5nF etc).

3. The PFET turnoff is too slow. Adding a cheap digital buffer IC could pick up 0.8-1.2% efficiency there from reduced switching losses and reduced loss from the 560 ohm resistor.

4. My PCB has very thin long tracks. Using a well designed PCB with thick short tracks for the main current paths might save 30 milliohms and give maybe 0.5% or more efficiency.

Bill of materials.
* 34063 SMPS 8pin IC (Fairchild/ON Semi/AIS etc, ie MC34063A or NCV34063A).
* 8pin IC socket (optional).
* PFET, rated more than double the input voltage and a few times the desired output current, preferably well under 0.1 ohm Rds on.
* Inductor L1 is a powdered iron toroid of 20-30 mm diameter, with thick wire >1.0mm preferred, 3A rated for a 1.5A capable supply. Value in the 150-470uH range, you may need to try a couple of different types. Ideally current ripple will be <50% at full output current.
* Schottky TO-220 dual 10A or dual 16A diode pack. Choose for low forward voltage, most brands are very good, parts can be found in any old PC PSU.
* 470-1000uF 35v electro cap.
* 1000uF 16-25v electro cap (25v will be larger and generally have a longer life).
* CT 1nF 25-50v ceramic or greencap.
* some 1/4W resistors; 560 ohm, 10 ohm, 6k8, 2k2.
* If you need a test load then a large 10W 4.7 ohm resistor will do.

Modifying the circuit for 12v car operation.
This circuit was designed for a car battery, generally 13.8v to 12.0v when running. If used in a car the circuit needs more protection as the Vin might be >15v at times. I would use a 100 ohm resistor instead of the 10 ohm resistor. Also a 13v zener diode across the 560 ohm resistor will add safety for the PFET. A 12v line filter might also be advised, they can be bought from auto stores.

Modifying the circuit for 24v operation.
Use 560 ohms instead of 10 ohms, so it now has two 560 ohm resistors. And again a 13v zener from PFET gate to source pin. With a 24v Vin you should use a higher inductor value and larger inductor core, 470uH and up are recommended.

Modifying the circuit for high output currents.
The circuit is meant for 5v out, 0-1.8A. It will do ok up to 2.5A just by changing the current limit resistor (at 2.5A the resitor should be 0.12 ohms or so).
Currents up to 5 amps or more should be ok, but use a larger inductor core size rated for more than the max amps you need, and a larger inductor value might help >330uH is good. The diode pack will be fine, but the PFET should be rated for a few times more current than your max current. If needing 5A output I would use a 40-50v 60A TO-220 PFET which are a common size.

Changing output voltage.
Just change the 6k8 resistor, to change the output voltage to something other than 5.0v. Like most SMPS circuits it works best with roughly 2:1 Vin:Vout ratio, if using different ratios then again increasing the inductor value >470uH will help.

Last edited:

#### MrAl

##### Well-Known Member
Hello MrRB,

Thanks for posting that circuit, it looks very promising. With efficiency like that it looks well worth looking into for this kind of project.
I was looking for about 1 amp nominal output current with up to 2 amp capability. Since the efficiency is 93 percent at 1 amp out this should work nicely.

I'll have to dig out my parts and build up a breadboard too next. I might have a couple 200uH inductors around already but my PMOSFETs are all high voltage so i might have to order a couple first.

BTW, when you look at the output waveshape for a while do you see any quick jumps once in a while? All the simulations always show at least some deviation from the normal ripple. This would be easier to see with a wider time period for looking at the output ripple voltage.

Last edited:

#### Mr RB

##### Well-Known Member
Hi Mr AL, thanks. It went together pretty quick in about an hour, I think it took a couple more to write it up and photos, scan the schematic etc.

Re the waveform skipping etc, that was not happening at currents over 0.8 or 0.9A. The 34063 has two types of regulation; the normal voltage regulation has a fixed on period and fixed frequency, and will skip on periods or cut some on periods in size to maintain voltage out. It's basically discontinuous, or very close to it, and quite erratic looking.

The other regulation occurs from the current limit sense resistor. This actually reduces the length of the on period. So with the parts values I chose it was peaking on the current limit and in sync with the inductor ripple and the internal oscillator. Basically it used the current limit peaks to shorten the osc period from 26.2kHz to 32kHz (at 1.5A) and everything runs nicely and synchronous.

In effect the turnon occurs based on the normal voltage regulation when the voltage is <1.25, but the turnoff occurs when the current peak hits >1.8A and the current limit ends the on period prematurely (cuts short the oscillator cycle). To get this effect you need the current limit set to about 1.5 times your normal output current, and a large enough inductor value so it is not discontinuous, and TC cap value giving an osc freq a bit lower than the resulting regulating freq.

#### MrAl

##### Well-Known Member
Hi MrRB,

Well, i am aware of how a peak current limit works in regulators but that's not really the kind of regulation i would need for this project. That's basically good when we have a constant load. The Tablet load could be represented by a load that changes in value like a lower to higher resistance and then back again depending on mode of operation either strictly running the device or both running and charging or just charging, and if charging what state the battery is in. All the time however we need 5v regulation, so that means we absolutely have to use the voltage regulation mode of the ic chip. No way around it.
Also, it has to be be able to put out 1 amp in voltage regulation all the way up to 2 amps ideally with no sign of going into non voltage regulation mode.

So could you do a quick scope shot of this thing in voltage regulation? That would be nice to see too and i could compare with my notes.

#### fernando_g

##### New Member
There is a VERY simple way to speed up the Mosfet's turnoff time without a high current penalty using a NPN tansistor and a smalll signal diode. Unfortunately, I can't draw the circuit in my phone and won'T be back home until the 2nd of Jan.

Otherwise, excellent project.

#### Mr RB

##### Well-Known Member
...
Well, i am aware of how a peak current limit works in regulators but that's not really the kind of regulation i would need for this project. That's basically good when we have a constant load.
...
All the time however we need 5v regulation, so that means we absolutely have to use the voltage regulation mode of the ic chip. No way around it.
...
I really need to work on my communication skills!

It is in voltage regulation at all times, at exactly 5v. I tested the vreg dropout and that occurs at >1.81 amps with the parts values shown. All data and scope waves shown above are in 5.0v vreg mode.

Regarding the current regulation, all that does in vreg mode is to limit the peak inductor current. So when the peak L1 current hits 1.8A it ends the ON cycle of the regulator and causes turnoff.

The 34063 is designed to work like that, at lower currents it runs discontinuous in vreg, at medium/high currents it runs as vreg, but peak L1 current is limited by the current reg pin. And finally at overload currents (where it is permanently below vreg) it runs as a constant current supply based on the current limit reg.

The reason I used a lowish peak current limit is to 1. provide safety and 2. have a big effect on stabilising the oscillation.

Hi Fernando_g, thanks for the tip. The PFET turnoff losses are much lower than the combined other I2R and diode losses etc so I was happy to leave it at that for now. I'm still interested in your turnoff circuit and will look it up, thank you.

#### fernando_g

##### New Member
Just FYI... There is a TI app note, SLUP169, look at fig 13.
It is shown for a N-chan Fet, reverse the diode and transistor polarity.

Last edited:

#### MrAl

##### Well-Known Member
Hi again MrRB and fernando,

Thanks for clearing that up MrRB so it looks like this may be doable. Im going to be looking into this more and finally i'll be building up the circuit. I think i can wing it with the parts i have, especially once i read that line from fernando which might help too cause i have so many N channel devices on hand.

fernando:
Thanks for the link, this should help too because i have a lot of good N channel (low Rd) devices already on hand. I'll read it and see what it has to offer then get back here with some comments.

LATER:
Oh ok, that's an app note about gate drivers
I thought it was an app note that pertained directly to that 34063 chip. But thanks anyway and maybe i'll use something from it.
What i'll probably do is just convert MrRB's circuit to use an N channel device if that's possible, otherwise just bite the bullet and get a P channel device with decent characteristics

LATER LATER:
Oh ok, they also include home made boot strap drivers, which is a nice change. I was thinking of an entire inverted scheme, but this looks interesting too.

Found some P channel devices, price range 1.50 to 3.00 USD, with Rd 50mOhms to 10mOhms.

Last edited:

#### Mr RB

##### Well-Known Member
To Fernando; thanks for pointing out the TI appnote on gat edriving, I downloaded a copy. The fig13 example should be workable fine for the PFET, it just needs to be inverted and then driven from the junction between the two resistors.

To MrAL; after some more digging through my junkbox I found some SI4435DY PFETs at 30v 8.8A and 20mOhm Rds on @10v gate drive. The bad side is they are SO8 pack SMD but at 1.5A with such low Rds they would run very cool and not need a heatsink so SMD is fine. You might be able to get similar specs in something convenient like a TO-220 pack but since it doesn't need heatsinking you could use any package really.

#### Mr RB

##### Well-Known Member
Just an update for MrAl, re an earlier conversation where I was going to build a 6v 10Ah sealed lead acid battery charger for a robot project.

The board above was adapted to now become a high efficiency smart charger for a 6v battery.

It uses a PIC 18F1320 on internal osc at 8MHz, and the PIC PWM module to generate 18.2kHz fixed frequency with variable pulse width. Inductor was upped to 330uH 3A type, and the same SMD PFET and TO-220 diode were used. I added a brass angle shim and large sloder blob to cool the PFET (which now never gets much warmer than body temp).

Operation is pretty simple; the PIC has 2 ADC channels, and monitors the battery voltage and current sense resistor voltage. These are stacked so to get battery voltage it reads the current then subtracts that reading from the voltage to give true battery voltage. Then it slowly adjusts PWM to keep battery voltage at the correct regulation and also limit current during the initial bulk charge to 1.5A max.

The charger automatically selects between 7.2v for bulk charge and main topping, then when current falls to about 3% of C it switches to float charge at 6.85v and stays there permanently.

I was quite happy with the charger regulation, it regulates voltage to a couple of mV which is not bad considering the very imperfect feedback loop of PIC ADC and slowly trimmed PWM.

Here's how the board turned out, tidied up a bit and neat enough to be buried deep in a robot chassis;

(edit) forgot to say the Vin is now about 23v 600mA (from a nice old heavy duty Motorola plugpack, used for "Car phones"!) and charges the battery at about 7.2v 1.5A. Roughly measured efficiency between 88 and 91% depending on current.

Last edited:

#### MrAl

##### Well-Known Member
Hi MrRB,

Oh yeah pretty nice! I always meant to try a PIC as feedback for voltage regulation but never got around to it. The program board i have does it that way too to regulate the 12v program pulse amplitude. Saves a voltage regulator i guess

As you recall my original question was for a regulator for use with a Tablet computer, well on a related note, have you tried interfacing with a Tablet computer yet? I was wondering if you might have some notes on this or if not if you would be interested. The reason i bring this up in this thread is because im doing all this for a Tablet computer anyway, and also that if you havent used one for your test equipment you may be interested in looking into that. The small Tablet computers make an exceptionally nice base for a number of different pieces of test equipment, a multi channel volt meter just one example.
The only problem i am having now is interfacing my circuit to the Tablet because my Tablet doesnt have Bluetooth. It seems hard to get an external Bluetooth device to work too, so im looking for other ways. But you may want to go with Bluetooth if you are interested. Let me know what you think about this if you can.

#### Mr RB

##### Well-Known Member
Hi MrAL, sorry I don't have any tablet experience at all, not owning one.

Hmm, if you want to use bluetooth for data interfacing to the tablet there are lots of cheap bluetooth modules on ebay, just watch out as some are just the "module" but need a carrier PCB which means you need to make a PCB, some are a fraction more expensive but have the carrier PCB included togther with the module.

What other interfacing options does the tablet have? If it has USB you may be able to use one of those TTL->USB data converters, and just send USART serial direct from the PIC to the tablet USB port. Personally I would prefer that to any RF comms as it will be higher datarate, simpler and probabl more reliable.

Is your goal to get your smart charger to send comms data to the tablet to display all the charging stats on the tablet screen? That would be very cool, especially if it was just the one USB lead. I take it you can write tablet apps like a program to display the voltages?

#### MrAl

##### Well-Known Member
Hi MrRB,

That's one goal yes, with the overall goal being able to monitor just about any process, and to start with to use the Tablet as a general purpose test bed for other plug in test equipment starting with a four channel volt meter. Let me elaborate just a little.

Right now i have constructed (quite a while back actually) a four channel 'meter' that can measure voltages and with some simple interfaces can measure current too. I feed this through an RS232 port into the PC (not the Android yet) and built up Windows software that reads the four channel A/D converter and uses that data and user entered parameters to display current, voltage, and even Ampere Hours in a neat little panel. That allows easy testing of battery cells of just about any type (very versatile set up capabilities) which allows testing of four cells simultaneously.
What i'd like to do is use the Android Tablet the same way, even if it means creating new software for the Android environment rather than Windows. But i'd like it to be as versatile as the Windows based program panel.
What i stumbled upon was a BASIC language made for the Android op sys and so Tablets and Phones. This language allows quick changes right on the Android Tablet so i can set up different things quite easily. But what it doesnt do is read RS232. It doesnt have that built in and im not sure if it ever will. What it also does not have is Bluetooth, but since it uses the more current op sys the op sys supports Bluetooth. Problem is getting a BT adapter that works with the Android Tablet. From what i have read now some dont work and some do, so it's a toss up. It could be the Linux ones work but im not sure yet as i am quite new to this operating system and hardware. If it was a PC i could use RS232 or even build up my own interface PCI card using the raw I/O of the CPU and machine language, but because it's Android and an ARM processor i dont have any experience with that yet and im not sure i want to get that deep into it either.
So back to the BASIC interpreter, so far it looks like a keyboard interface might work (through USB) but that wont be as nice as Bluetooth. I've even considered electrical stimulation of the touch pad itself (in a designated area of the screen) but that would be exceptionally slow, too slow for my purpose.

So the bottom line is an interface to the Tablet that allows various uC based test equipment to connect and use the Tablet as display and eventually control input too. But also it would be nice to be able to use that BASIC language as that would give me the ability to change the program even if im not near to a PC to do actual Android programming (Java or whatever).