platinum95
Posts: 37
Joined: Tue Jan 10, 2012 11:00 pm
Contact: Website

Re: PWM as a voltage regulator

Fri Jan 27, 2012 4:10 pm

I plan on using a 12v battery to power the raspberry pi for mobile usage, but I need to drop it down to 5v. As a normal voltage regulator using the lm317t would waste a lot of energy, I was thinking of using a pulse width modulator with a duty cycle of 41.6% which should make a 5v out, then a inductor and a capacitor to remove noise.

Would this work or am I talking rubbish?

Thanks!

Baconator
Posts: 7
Joined: Fri Jan 27, 2012 4:25 pm

Re: PWM as a voltage regulator

Fri Jan 27, 2012 4:37 pm

I'm pretty sure that's exactly how buck/boost converters works (well basically)

https://en.wikipedia.org/wiki/Boost_converter
https://en.wikipedia.org/wiki/Buck_converter

My electronics knowledge is a bit rusty though.

platinum95
Posts: 37
Joined: Tue Jan 10, 2012 11:00 pm
Contact: Website

Re: PWM as a voltage regulator

Fri Jan 27, 2012 4:55 pm

Looks like they're based on the same concept, thanks for telling me!

davidgoodenough
Posts: 74
Joined: Wed Sep 21, 2011 11:55 am

Re: PWM as a voltage regulator

Fri Jan 27, 2012 5:58 pm

Much the easiest and cheapest way to get 5V from a 12V battery is a car USB adapter.  They are so common now, especially as all new phones (except iPhones) now use them for recharging.

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: PWM as a voltage regulator

Fri Jan 27, 2012 6:00 pm

platinum95 said:


I plan on using a 12v battery to power the raspberry pi for mobile usage, but I need to drop it down to 5v. As a normal voltage regulator using the lm317t would waste a lot of energy, I was thinking of using a pulse width modulator with a duty cycle of 41.6% which should make a 5v out, then a inductor and a capacitor to remove noise.

Would this work or am I talking rubbish?

Thanks!



Well, just a bit rubbish...

A SMPS (Switch Mode Power Supply) does use PWM (Pulse Width Modulation) to control the voltage. But it controls the pulse width based on a feedback loop. So if you draw more current, your voltage drops and the control circuit makes your pulse wider.  If you draw a little current and you keep your 41.6 % ration your circuit will pass too much energy and you voltage will rise to the full 12V. Your raspberry pi is likely to burn out.

So using a PWM with some a static ratio will absolutely not work.

slacker
Posts: 33
Joined: Wed Dec 07, 2011 9:12 pm

Re: PWM as a voltage regulator

Fri Jan 27, 2012 6:17 pm

I'm going to use an LM2575 to do something similar

http://www.rapidonline.com/Ele.....2575-34450

I've built the example circuit from the datasheet, and it's good for 5 volts @ 1 Amp and about 80% efficient.

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: PWM as a voltage regulator

Fri Jan 27, 2012 6:31 pm

I don't know how much you know about electronics but:

Make sure you use a good quality inductor. Check what the inductor saturation current is. Manufacturers all like to boast with showing the biggest numbers they can come up with. With inductors that will be the peak current (just before it starts acting like a fuse and burn out). The saturation current will be much smaller then that. (I fell for that once!)

I just downloaded the datasheet. It says your peak current can be 20%-30% above your output current. So take an inductor wich has 1.3A saturation current.

platinum95
Posts: 37
Joined: Tue Jan 10, 2012 11:00 pm
Contact: Website

Re: PWM as a voltage regulator

Fri Jan 27, 2012 6:34 pm

slacker said:


I'm going to use an LM2575 to do something similar

http://www.rapidonline.com/Ele.....2575-34450

I've built the example circuit from the datasheet, and it's good for 5 volts @ 1 Amp and about 80% efficient.


If i were to buy two of these would I be able to get 2 1 amp rails?

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: PWM as a voltage regulator

Fri Jan 27, 2012 6:46 pm


platinum95 said:


slacker said:


I'm going to use an LM2575 to do something similar

http://www.rapidonline.com/Ele.....2575-34450

I've built the example circuit from the datasheet, and it's good for 5 volts @ 1 Amp and about 80% efficient.


If i were to buy two of these would I be able to get 2 1 amp rails?


With two different voltages!!

You can not use them side-by-side, connect the two outputs together and get 5V and 2 Amps. If you want 5 Volts and 2Amps you need to select a different regulator which can do 2A.

Baconator
Posts: 7
Joined: Fri Jan 27, 2012 4:25 pm

Re: PWM as a voltage regulator

Fri Jan 27, 2012 6:50 pm

platinum95 said:


slacker said:


I'm going to use an LM2575 to do something similar

http://www.rapidonline.com/Ele.....2575-34450

I've built the example circuit from the datasheet, and it's good for 5 volts @ 1 Amp and about 80% efficient.


If i were to buy two of these would I be able to get 2 1 amp rails?



Depends on if you actually want two separate rails to power separate devices, or one 2 Amp rail to power it all.

There's solutions like this one:
http://parts.digikey.com/1/par.....t205v.html
That's meant as a power efficient drop-in replacement for the 7805 family of self-contained fixed linear voltage regulators

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: PWM as a voltage regulator

Fri Jan 27, 2012 7:04 pm

Baconator said:


platinum95 said:


slacker said:


I'm going to use an LM2575 to do something similar

http://www.rapidonline.com/Ele.....2575-34450

I've built the example circuit from the datasheet, and it's good for 5 volts @ 1 Amp and about 80% efficient.


If i were to buy two of these would I be able to get 2 1 amp rails?


Depends on if you actually want two separate rails to power separate devices, or one 2 Amp rail to power it all.

There's solutions like this one:
http://parts.digikey.com/1/par.....t205v.html
That's meant as a power efficient drop-in replacement for the 7805 family of self-contained fixed linear voltage regulators



That is what I like about forums like these: I had never seen those before but they look great. So I have to make modification 46 to my Gertboard to make sure there is enough space for one of those.

andri
Posts: 51
Joined: Fri Jan 27, 2012 5:05 pm

Re: PWM as a voltage regulator

Fri Jan 27, 2012 7:09 pm

Maybe we can add some transistors.

http://emproj.com/Documents/Pa.....LM2575.JPG

platinum95
Posts: 37
Joined: Tue Jan 10, 2012 11:00 pm
Contact: Website

Re: PWM as a voltage regulator

Fri Jan 27, 2012 7:27 pm

While we're on the subject of power, what kind of mAh or wh should i look for in a battery that will give me reasonable on-time but still relatively cheap. It will be powering the raspi, a usb hub and a small 4 inch TFT screen. I know it will depend on what's in the USB hub, but we'll just go with nothing for now

slacker
Posts: 33
Joined: Wed Dec 07, 2011 9:12 pm

Re: PWM as a voltage regulator

Fri Jan 27, 2012 8:07 pm

Gert said:


I don't know how much you know about electronics but:

Make sure you use a good quality inductor. Check what the inductor saturation current is.

I just downloaded the datasheet. It says your peak current can be 20%-30% above your output current. So take an inductor wich has 1.3A saturation current.


This is the first time I've played with switching regulators, I've only ever used linear ones before, so that's useful information, thanks.

The inductor I'm using at the minute is way over spec, because that was all I could find in through hole in stock at the supplier.

stormy1
Posts: 60
Joined: Fri Jan 06, 2012 3:44 am

Re: PWM as a voltage regulator

Fri Jan 27, 2012 8:40 pm

I recommend a  5V 3A BEC Step-Down Voltage Regulator like this one:

http://www.pololu.com/catalog/.....oduct/2177

You could also build it but the parts are $10+ and finding the right coil is a pain.

stormy1
Posts: 60
Joined: Fri Jan 06, 2012 3:44 am

Re: PWM as a voltage regulator

Fri Jan 27, 2012 8:44 pm

Here is the info on building your own:

http://www.hobby-hour.com/elec.....ulator.php

dolafson
Posts: 3
Joined: Wed Jan 04, 2012 10:04 pm

Re: PWM as a voltage regulator

Fri Jan 27, 2012 9:35 pm

And here's a video on PWM control of a constant current constant voltage supply


platinum95
Posts: 37
Joined: Tue Jan 10, 2012 11:00 pm
Contact: Website

Re: PWM as a voltage regulator

Sat Jan 28, 2012 7:43 pm

stormy1 said:


Here is the info on building your own:

http://www.hobby-hour.com/elec.....ulator.php


Seems easy enough, though it would be a pain finding the right inductor.

And thanks for the video dolafson, its very informative

plugwash
Forum Moderator
Forum Moderator
Posts: 3582
Joined: Wed Dec 28, 2011 11:45 pm

Re: PWM as a voltage regulator

Sun Jan 29, 2012 4:13 am

platinum95 said:


I plan on using a 12v battery to power the raspberry pi for mobile usage, but I need to drop it down to 5v. As a normal voltage regulator using the lm317t would waste a lot of energy, I was thinking of using a pulse width modulator with a duty cycle of 41.6% which should make a 5v out, then a inductor and a capacitor to remove noise.

Would this work or am I talking rubbish?


Not very well, what exactly will happen depends on the output of your PWM device.

If the PWM switches between 12 and floating then under small loads you will end up with damn near 12V on the output.

If the PWM switches between 12 and 0 then it will provide somewhere around 5V but there will be current flows in both directions through the inductor as the switch changes. Further if you are not careful the inductor may damage the PWM source.

What you want is called a "buck converter" It's similar in principle changing the output voltage by changing the behaviour of a switch but it's engineered so current only flows one way through the inductor and it controls the output voltage through feedback. If you don't want to construct such a converter yourself you can get  modules to do it for you. E.G. http://uk.farnell.com/xp-power.....dp/1861095

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: PWM as a voltage regulator

Sun Jan 29, 2012 4:35 am

Modern switching regulators often operate at very high frequencies, e.g., 1-2 MHz and require very careful PC board design or they'll misbehave.  For example, the inductance of vias (holes through the PC board) can throw them off.  Unless you really know what you're doing, you're better off using a module.  Sometimes you can score demo boards from chip makers -- my favorite is Linear Tech.

User avatar
Jessie
Posts: 1754
Joined: Fri Nov 04, 2011 7:40 pm
Location: C/S CO USA

Re: PWM as a voltage regulator

Sun Jan 29, 2012 6:47 am

Why not use PWM and a voltage regulator.  Use some caps and inductors to smooth things out on the input and output sides?

Lardon
Posts: 9
Joined: Sun Jan 29, 2012 10:04 pm

Re: PWM as a voltage regulator

Mon Jan 30, 2012 11:43 am

Jessie said:


Why not use PWM and a voltage regulator.  Use some caps and inductors to smooth things out on the input and output sides?


The voltage regulator is, IMO, not necessary.

A typical switching regulator and a bunch of capacitors, an inductor and a schotky diode can do the job. You may want to have a look at the LM257x and LM267x series.

Let's overdo it and take the LM2678 as an example.

Input voltage : 8 – 40 V

Output voltage : 5 +/- 0.1V

Output current : 5 A (absolute maximum : 6A)

Efficiency : 84-86% (5A), up to 90% with lighter loads (<2A)

Ripple voltage : around 20 mV

Transcient overshoot : 0,1 V

Switching frequency : 200 Hz

Except for output current, most switching regulators will have these kind of specifications, and cost around 3-4$.

The main problem would be the inductor… hand-wound, of course. And wounding a 16 AWG (1,2mm) copper wire would be somehow… painful.

But i'm overdoing this quite a bit, and you will have to dimension your circuit (regulator, inductor) to suit your needs. Just keep in mind that bigger may not be better : these regulators are PWM designed, so basically the current flow will vary around your average load. Since bigger regulators are designed to cope with high currents, they tend to work in discontinuous mode (i.e. current drops to zero for a short period of time) with low currents.

My knowledge is quite limited, but I don't think a discontinuous mode power supply would be very nice to your Raspberry.

platinum95
Posts: 37
Joined: Tue Jan 10, 2012 11:00 pm
Contact: Website

Re: PWM as a voltage regulator

Mon Jan 30, 2012 8:55 pm

I  bought all necessary components to build the previously mentioned DC to DC Buck regulator:

http://www.hobby-hour.com/elec.....ulator.php

Parts were pretty cheap, the most expensive being the LM2576 at about 5 euro I think. Next was the inductor, cost about 4 quid. After that, it's just standard issue capacitors and that Schottky diode. I'll get a small perfboard some time soon, after the breadboarding is done.

If that fails, I can just buy a DC to DC converter, they aren't expensive.

hzrnbgy
Posts: 106
Joined: Mon Dec 26, 2011 10:55 pm

Re: PWM as a voltage regulator

Mon Jan 30, 2012 10:07 pm

may I suggest a DC-DC switching buck module with all the components built in. Its a direct replacement for your regular inefficient 78XXX linear voltage regulator.

all you need to connect is voltage in, ground, and voltage out and it cost only around $5. It also has built-in protection circuitry. No need to deal with inductor sizing, etc.

http://www.mouser.com/ProductD.....49qqIt4%3d

platinum95
Posts: 37
Joined: Tue Jan 10, 2012 11:00 pm
Contact: Website

Re: PWM as a voltage regulator

Mon Jan 30, 2012 10:51 pm

hzrnbgy said:


may I suggest a DC-DC switching buck module with all the components built in. Its a direct replacement for your regular inefficient 78XXX linear voltage regulator.

all you need to connect is voltage in, ground, and voltage out and it cost only around $5. It also has built-in protection circuitry. No need to deal with inductor sizing, etc.

http://www.mouser.com/ProductD.....49qqIt4%3d


That seems pretty useful, I'll keep it in mind if my current idea doesn't work and for future projects. Thanks very much!

Return to “Other projects”