Tag Archive | "power supply"

Let’s make a cheap +5V power supply

In this tutorial we make a simple 5V DC power supply from initial idea to finished product. This is not an exercise in making a flash power supply, just solving a problem with the parts at hand.

Updated 18/03/2013

When writing my Arduino tutorials, or generally experimenting with the breadboards – and more often both – I have needed 5V DC to power something, or in the case of working with two Arduinos at once, having to run USB cables all around the place just to power them. Some may say “Oh, just get another couple of wall warts/plug packs”. True, but good ones are over Au$20 here… and buying cheap ones have not been so successful in the past. However, I do have a collection of odd-voltage plug packs from old cordless phones and so on.. 12V AC, 15V DC etc.

So while at my desk I thought “How can I combine my need for 5V, my cheapness and use one of these plugpacks?”. Easy!

After perusing my stock database it turned out that all the parts were already around me to make a simple 5V supply using an LM7805 voltage regulator. It is quite versatile, can accept voltages up to 35V, and I have some in the drawer. Here is the data sheet: LM7805.pdf.

One should keep in mind the possible current draw from the device this is powering. The LM7805 is good for one amp, so if you’re going to milk it to the limit, your power supply should be good for around 1.5A.

Following this it occurred to me that it would be nice to not have to worry about the type of current from the plug pack – AC or DC. So my circuit needs a bridge rectifier. That can be made with four 1N4004 diodes. And it would be nice to have a power-on indicator that isn’t a tiny speck of light. Thankfully I bought some 20 mm red LEDs when element14 had a crazy sale. Perfect.

And finally, a nice enclosure. Or anything really, to hold it all together. A small semi-opaque jiffy box was hiding in the cupboard with some veroboard, so they will be used. How? Here is my schematic:

schematicsmall

Oh – the resistor is 560 ohms. And here are the participants in this project:

partssmall1

The black stuff at the top-right is heatshrink. The next though was how to mount the board in the box – I don’t have any standoffs, but the box does have some slots to hold the board. So this tells me how much space there is to use on the board, as I will trim it down to fit the space available:

boxsmall

But before hacking things up with the tinsnips, it pays to see if your circuit will actually fit in the board space available. (However my circuit was quite small, so I knew it would fit). This can be done by laying out your parts on a sheet of paper that has a grid of dots at 2.54mm intervals. Next was to measure the internal dimensions of the box in order to cut the veroboard. Then out with the tinsnips and chop chop chop. When using tinsnips or a saw of some sort, try and cut a little outside of the line – as the PCB material does flex a little .This means that you may lose 2~3 mm at the edges, so make allowances for that.

Moving on, I now have the board sized for the box and can start component placement:

pcbinboxsmall

The parts just fit in together nicely. I will have to drill the holes for the 7805 regulator so it can fit, however it doesn’t really leave room for the 0.1uF capacitor. However it is not really necessary, the output will be ok without it. The leads from the power socket, and to the switch and output lead will feed from the bottom of the PCB:

layout1

Now for one final visual check, and then to solder in the components. After doing so, then it was time to put the link in and cut the tracks. I use a sanding bit on the drill to cut the tracks, completely removing the copper:

lay2small

After cutting the tracks on the solder side, it was a good time to use the continuity function of the multimeter to check for shorts between tracks and other errors. The soldering proved to be fine, and the track cuts worked. Now it was time to position the DC socket and switch in order to wire them in, then drill their holes. The output wire is to come out of the top:

almostsmall

Now all there is to do is solder the connecting wires from the DC socket to the rear of the circuit board, and the output wire via the switch. At this point the unit was also tested. Naturally my eyesight had failed me and a short had appeared. However it was sorted out with the solder sucker:

smallaalmost

Notice how I tied a knot in the output lead before it passes through the lid – this is to stop accidental damage to the board caused by someone pulling the wire out. Here is the finished product, with a nice red glow for a power-available indicator:

finishedssss

Hooray – finished. What else was there to do on a Tuesday night? The LED indicates power is supplied to the box, and the switch just controls the load. Not too happy about that 5.05V reading… but then again, that meter was somewhat inexpensive. Now let’s have a look at the CRO and look for any ripple from the supply:

crosmall

The display was set to 50 millivolts per vertical division – and still a nice solid line. Considering the cost of the power supply, that’s not too bad. And we didn’t need the extra smoothing capacitor after all.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

Posted in arduino, LM7805, power supply, projects, tutorialComments (9)

bbboost chapter five – the power supply module

[3 July 2010 – this project has been retired, but the posts left for reference]

Greeting again to followers of the bbboost journey. It has been a month since the last instalment, however the 20V DC plug pack took a long time to arrive from the land of China. Nevertheless, the project is moving forward. For my new readers, the bbboost is a power supply that can be assembled by a beginner, and can offer a smooth variable DC output voltage of between ~1.8 and ~20 volts – perfect for experimenting, breadboard, and generally saving money by not buying batteries. You can just make a PCB version, or mount it in an enclosure like a professional desktop unit. No mains voltage wiring is required, so it will fine for the younger enthusiasts. Follow the project from here.

This time I have breadboarded the power supply module, using the circuit described in chapter two.  Let’s have a bit of a look:

power-layout

power-layout2

These trimpots were ok, but it would be preferable to use the fully enclosed dustproof versions. Will order some and try ’em out.

trimpots

One trimpot (the blue and white one) is 5k ohm, – to adjust between the full range, so this is the ‘coarse’ adjuster; the other trimpot is only 500 ohms and changes the voltage selected by the coarse pot by around +/- 1.2 volts. The purpose of having two controls is to make it very easy to select your required voltage down to one-hundredth of a volt. The following video clip is a rough example of this type of adjustment in action:

This power supply will also be designed for installation into a nice enclosure, so in that case one would use normal-sized potentiometers for the coarse and fine voltage adjustment.

Posted in bbboost, projects, test equipmentComments (0)

bbboost chapter four – the digital ammeter

[3 July 2010 – this project has been retired, but the posts left for reference]

Greeting again to followers of the bbboost journey. Finally the required parts arrived today so now the project can move forward. (Living in a country of 22 million people, you would think 5W resistors would be easy to come by. Think again). If this is your first brush with the bbboost project, please visit here to see what it is all about!

So today we are going to modify the voltmeter module to convert it to an ammeter (current meter) and therefore a very useful thing to have on a desktop power supply. By having an ammeter, once  your project or prototype is running you can use the current readout to determine the power supply or battery requirements for your project, or dance dangerously close to the limits of the circuitry. Careful!

However converting the voltmeter is a simple process. Using Ohm’s law, we know that current = voltage over resistance. So our problem requires us to determine the current. If we measure the voltage potential across something of a known resistance (say, a resistor), and divide the voltage by the resistance, we have the current flowing through the resistor.

I = current in Amps; V = Volts; R = resistance in Ohms.

So for example, if we have the current of our supply circuit running through a 1 ohm (5 watt – as the wattage will increase at full load) resistor, and the voltage potential across the resistor is 0.0084 volts (8.4 millivolts), the current will be 8.4 milliamps (or 0.0084 A).

Now that we already have a voltmeter, a simple removal of the 1M ohm resistor from the terminals and replacing it with a 10k ohm resistor allows the meter to measure much smaller voltages. Therefore the maximum is will measure is 999.9 mV (which we will note as mA when being used in ammeter mode). Here is the circuit diagram for the ammeter. Note the only change from the voltmeter is below the 10 nF capacitor at the bottom-left of IC1. The supply current will be running through the 1 ohm 5 watt resistor. In the next chapters we will discuss a switching solution to flip between voltmeter and ammeter without any rewiring by the end user.

ammeter

Also note the change of wiring on our breadboard, it is much neater and easier to follow. The solid wires are much more reliable than the looser ones used previously. Although they can be more difficult to route around a breadboard, they will be more reliable – especially if you move the board around a lot.

ammeter_small

There we have it! A simple conversion has made our voltmeter an ammeter with a range of 0~999.9 milliamps (basically 1 amp). Which matches nicely with the original specification of the bbboost power supply of 1 Amp. But now for the action test: measure some current! Our test subject is an LED in series with a 10k variable resistor and a 6v battery. In the video clip (no audio) we will measure the current through the circuit at three different rates, changing the resistance to alter the current three times, then comparing the readout on the bbboost and a multimeter set to mA scale. The test current values are: 0.8 mA; 12.4~5 mA (third time lucky) and 118.5 mA (bbboost) vs. 114.8 mA (multimeter). That’s a difference of 3.7 mA – for the purpose of this project, quite negligible. There is always Fluke!

The extra parts required for this section are a 10k ohm 0.25 W resistor and a 1 ohm 5W resistor.

Well that was nicely successful – except for that pesky decimal point – we didn’t do anything about it in the change from a voltmeter to an ammeter. That, my friends, is for the next instalments.

Posted in bbboost, projectsComments (0)

bbboost chapter three – the digital voltmeter

[3 July 2010 – this project has been retired, but the posts left for reference]

Our bbboost journey continues today with the prototype voltmeter module. Once complete, the bbboost will have a digital voltmeter to accurately measure the output voltage. (And maybe… an ammeter… stay tuned). Over the last week I have been pondering and experimenting on what sort of voltmeter to have. Of course it had to be digital, but what to drive it? First there was a PICAXE microcontroller using a voltage divider and the PICAXE’s analogue to digital converter. Great… except that chip can only use integers. Next…

There seem to be many cheap digital LED voltmeter modules on eBay at the moment, but where’s the fun in that?

Around six months ago I stumbled upon an interesting IC when wasting time browsing through the Farnell website, so I ordered two of them planning to do something with them later on. And promptly forgot about them. However research for the voltmeter showed this chip as ideal – the Intersil ICL7107. An analogue to digital converter and 3.5-digit LED driver all in one. Woohoo!

icl7107

Data sheet is here… ICL7107 datasheet

Furthermore, this seemed like an inexpensive solution, volumes of this IC can be had for ~$2. Good so far, but after studying the data sheet – there was a catch.

It needs positive and negative five volts DC… ah fudge. The ICL7107 data sheet suggests using a CD4009 hex buffer/converter, with some diodes and capacitors. Nope, too hard and messy. However, thanks to the internet a solution was found – the ICL7660 CMOS voltage inverter!

Check it out – ICL7660 Voltage converter

So now the theoretical solution had been found, it was time to move from thinking to doing. Originally I used the circuit diagram from the Intersil web site, however calibration was a problem due to only having a single-turn potentiometer (see parts list below). So for the real unit, a multi-turn potentiometer will be used for R7.

Just a side note… breadboarding circuits can be a joy or a pain. If you use those cheap-ass breadboards from China via eBay, you will suffer. Take my word for it.

Anyhoo, before getting the circuit together, I like to line up all measure all the components – note my trusty capacitance meter …

preparation

Then put them in order according to the parts list. This will save confusion and time later on, as you have checked all the values and ensured they are correct before installation!

prep2

Here is my lovingly-crafted schematic for the voltmeter module. Note that this could be made as a standalone voltmeter, it will measure up to 20v DC. In our finished product, the +5V will be sourced from an LM78L05 voltage regulator.

voltmeter

And the parts list:

  • IC1 – Intersil ICL7107CPLZ
  • IC2 – Intersil ICL7660
  • D1~D3 – 1N4148 diodes
  • LED displays – Agilent HDSP521G 2 x 7-segment green displays (common anode). You can use anything really, as long as it is common anode, and each segment is ~8mA
  • R1 – 220 ohm – all resistors 0.25W
  • R2 – 10k ohm
  • R3 – 1M ohm
  • R4 – 47k ohm
  • R5 – 15k ohm
  • R6 – 100k ohm
  • R7 – 1k ohm multiturn potentiometer/trimpot (for calibration)
  • C1 – 10nF – all capacitors must be rated for at least 25V
  • C2 – 20nF
  • C3 – 470 nF
  • C4 – 100 nF
  • C5 – 100 pF
  • C6,7 – 10 uF electrolytic

Please note that this is a work in progress and errors may have been made, or values altered at any time after publication.

And now for the finished mess:

finished

Wow – what a mess. If you are going to use a breadboard – take care with the very low value capacitors. Try to keep the legs as short as possible to improve the meter stability. When you turn it on, the display will flick a few numbers around until settling on zero. You will need to calibrate it, so just measure a solid, reliable power source (such as the output from an LM7812 and LM7805 (12V and 5V DC) in turn. So when you are measuring the (for example) 5V output from the 7805, adjust the trimpot until the display says 5.00. Try this if you can with a few different reliable voltage sources, to check your new meter’s accuracy.

Finally, this wouldn’t be complete without one of my soundless videos. In this clip, I measure a 9v battery, then an alkaline AA cell, then the same again but with reverse polarity.

So thanks once more for reading. Please leave feedback and constructive criticism or comments at your leisure… and to keep track, subscribe using the services at the top right of this page!

Posted in bbboost, ICL7107, projects, tutorialComments (8)

bbboost chapter two – which regulator?

[3 July 2010 – this project has been retired, but the posts left for reference]

In the journey to create the bbboost, first we need to start at the core – that is, the voltate regulator itself. Searching for one that meets our specification was easier than expected, I just searched for “adjustable linear voltage regulator IC” in the Farnell website and listed the results by price. The likely candidate was the National Semiconductor LM317T. Hopefully most of you would realise that this was not a surprise, the LM317 is very popular. Limor over at adafruit industries uses a Micrel MIC2941, which is also an excellent regulator, due to the low dropout voltage, which means you can create 3.3V from 3.7v (for example).

However it is just too expensive, at $1.51 each for lots of 50. The LM317T is available individually for ~78 cents, or 58 cents in amounts greater than 100. Furthermore, the LM317 can provide up to 1.5 amps of current, greater than our intial spec for the bbboost. However to keep costs down, we will stick with the assumption of one amp, unless you choose to find a 1.5A plugpack. It also has short-circuit protection on the output, and thermal shutdown. This means if it overheats, it will turn off instead of becoming damaged. However, the maximum current available will decrease if the regulator becomes hot. Now there’s an interesting experiment!

Lots of interesting information can be found on the data sheet: LM317T data sheet

One of the good things about data sheets are the example circuits, of which we can make use of for the basis of our bbboost. So thanks to National Semiconductor, here is the hand-drawn base for our bbboost, with one difference – there will be two voltage adjustment potentiometers (variable resistors). The 5k (R1) will control the voltage, however R2 will be used as a fine adjustment control. Handy if you really need 8.45V and not 8.49V…

(Sorry for the hand-written schematic. I’m still working on using the software I have. Next time…)

We will decide on a value for R2 later on, after experimenting with the voltage display. So far, our list of materials is:

  • C1 – 0.1 uF 50V greencap capacitor
  • C2 – 1.0 uF 50V electrolytic capacitor
  • IC1 – LM317T linear voltage regulator
  • R1 – 5k potentiometer
  • R2 – very low value potentiometer
  • R3 – 240 ohm 1/2 watt resistor

C1 is used to smooth any ripples in the input voltage that can be created during the AC to DC conversion in the plug pack. C2 is used to improve the transient response (i.e. keep the output voltage nice and smooth).

So at this point we will put the project to one side – I’m waiting for the parts to arrive! Be sure to subscribe for updates (see the top-right) and explore the other posts on the blog. Bye for now!

Posted in bbboost, projectsComments (0)

breadboards and batteries… bbboost

[3 July 2010 – this project has been retired, but the posts left for reference. Not my finest work, but it may help someone]

During my life in the field of electronics study, research, and daydreaming many ideas (good, bad and dangerous) and projects have been constructed using the typical solderless breadboard that everyone has used at one stage or another. There is nothing wrong with this approach, except for the power supply situation. You could either buy an expensive desktop power supply ($40 upwards), use a fixed plugpack (if you have the right voltage) then build some power smoothing into your circuit, or even use a 7805 or similar regulator to get your +5 volts. Failing that, it’s back to batteries.

batteries-and-breadboard

You might as well just throw money into the garbage if you keep using batteries and have AC power nearby. I have had enough of worrying about all of this and have decided to conceive a desktop power supply that meets the following criteria:

  • cheap to construct
  • safe to use (not exposed to mains voltage)
  • can accept any voltage DC plugpack and offer a variable, smooth DC output of up to 1 amp
  • can be mounted on a small PC board with spacers to save money, or enclosed in a housing for a professional look
  • have a digital output voltage meter – so that it looks cool and is convenient. No more guessing with analogue meters and dealing with parallax error
  • increases the constructor’s knowledge of electronics!

Let us call it the bbboost – the bread board booster!

So over the next month or two we will do just that. If you would like to put forward ideas, suggestions or criticisms, please do so. Otherwise, get ready to say goodbye to breadboard batteries…

Posted in bbboost, projects, test equipmentComments (2)


Subscribe via email

Receive notifications of new posts by email.

The Arduino Book

Arduino Workshop

Für unsere deutschen Freunde

Dla naszych polskich przyjaciół ...

Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.

Use of our content…

%d bloggers like this: