Even a professional power supply isn't really much use though if it has only
one channel and you find you need two different voltage sources, or a voltage
greater than it can deliver.Most people are not lucky enough to own a professional bench power supply,
let alone two, and may only rarely need access to one. With some power supplies
costing up to 100 GBP, and for truly professional equipment, well beyond, they
are often outside the range of the hobbyist's pocket.
All is not lost however. The LM317T regulator is a reasonably cheap and readily
available device which with a handful of components can produce a 1.2V to 37V
variable voltage supply at up to 1.5A, and a LM317T can also be configured with
just one resistor to provide current limiting between 10mA and 1.5A. With
built-in thermnal overload detection, it is a very versatile and easy to use
device.
With the addition of a low-cost PICAXE controller, voltage monitoring, warning
and a computer interface can be easily added.
A reasonably comprehensive variable voltage, current limited PSU can be
constructed at a cost which is probably well below that of commercial equipment,
and is a low component count, fairly easy to construct project which should
serve those starting off in electronics well, as well as established hobbyists.
The most expensive part of the project is likely to be the meters and case.
If you are faced with having to build a dedicated supply for an unusual voltage
while prototyping, it can often make sense to build a complete variable voltage
PSU which can be easily re-used for other prototypes.
Design Concept
The design for the power suppy is quite straight forward; a fixed +5V supply
which can be used for most digital electronics, plus an additional variable
voltage power supply, with current limiting and output monitoring, for other
electronic interfacing.The main reason for wanting a fixed 5V supply when the variable voltage could
itself be used for that, is to allow 5V devices to be used with other devices
such as those which require 3.3V, and to also enable easy interfacing with
devices which require greater than 5V; relays and motors being prime examples.
It seemed silly to be forced to use two separate supplies when both could be
put in a single unit.
The overall block diagram of the system is shown below.
/
.-----------. /:
.---| Voltage |-----------------------------------------------O : O---( +5V
| | Regulator | :
| `-----.-----' Bypass :
| | / :
| `---------. .------O O-------. :
| | | | /
| .-----------. | | .---------. | .---------. /
VUR >---^---| Voltage |---|---^---| Current |---^---.---| Ammeter |---O O---( +VR
| Regulator | | | Limiter | | `---------'
`-----.-----' | `---------' |
.|. | .-----^------.
Voltage | |<--. | | Volt Meter |
Adjust |_| | | `-----.------'
|____| | |
| | |
0V >--------------^---------^-------------------------^-------------------------( 0V
My PSU was designed to fit inside an old British Telecom ISDN Modem case which
had been cannibalised to retrieve the LCD. It was a convenient size to allow
the meters which I had available to be fitted, and allowed a generally
aesthetic design to be achieved.
The only restrictions were due to the relatively small size internal mounting
posts which meant that a mains switch could not be added to the front panel, a
paddle switch could not be used for switching the current limiter and outputs,
and only a couple of terminal posts for power outputs could be conveniently
placed on the front panel.
Current On/ Power
Limit Off LED
.--------------------------------------------------------------------.
| Voltage Adjust Output .---. .---. |
| ____ ____ .---------. .---------. | | | | O |
| / \ / \ | \ | | \ | `---' `---' |
| |--- | |--- | | \ | | \ | .---. .---. .---. |
| \____/ \____/ |----O----| |----O----| | O | | O | | O | |
| `---------' `---------' `---' `---' `---' |
| Coarse Fine Voltage Current +5V 0V +VR |
`--.----.----------------------------------------------------.----.--'
\___/ \___/
I have constructed two power supplies, because I had a set of analogue and a
digital meters to hand, and both use the same layout and circuitry. The digital
PSU does not however have any display for indicating current.
To save cost, a mains transformer supply is only fitted to the Analogue PSU,
which is also used to provide power to the Digital PSU. This has proved useful
because I use a lot of 12V equipment and the PSU can be powered from car,
camcorder other rechargeable and even PP3 (9V) batteries, and, of course,
external plug-in mains supplies, even though the maximum voltage and current
available becomes limited.
The results are quite satisfactory, and both supplies have been used in anger,
and have been especially useful for powering PICAXE prototypes at 3.3V and for
charging both NiCd and Sealed Lead-Acid batteries. The extra effort to produce
a complete variable voltage PSU instead of a dedicated 3.3V supply as had been
originally planned has been well worth it.
|
[ UNAVAILABLE IMAGE ] The Analogue PSU
|
[ UNAVAILABLE IMAGE ] The Digital PSU
|
A Word of Caution
I'm not a professional hardware designer, and really only understand the basics
of analogue electronics which is why the simplicity of the power supply here is
so appealing to me and undoubtedly to others, and why there are so many similar
designs available on the Internet.I do know enough though to see that many of the designs on the internet are
lacking in some aspect or other, and especially with regard to dumping negative
and over-voltages past the regulators when connecting to any equipment which
may hold a residual charge to avoid damaging the regulators, so in this respect
at least the circuit is potentially better than some others you may find.
With that said, it isn't a professional design designed by a professional, and
the project therefore comes with no guarantees that it is fit for purpose, or
doesn't have some intrinsic flaw. It seems to work well enough for me, and
reflects similar designs elsewhere, but I have never tried to push it to its
limits of current capabilities.
I have no idea what the voltage stability is like or how much ripple there is
on the outputs; all I know is that a digital multimeter shows the output
voltage and current to be the same as what the PSU meters show, 10V through a
33R resistor shows 330mA, causes a painfully burnt finger, turning the 100mA
current limiter on reduces the amount of smoke, and it has been successfully
used to power a number of PICAXE and other projects without any apparant
problems.
The biggest design 'flaw' is that should the voltage adjustment pots go open
circuit, the output voltage will go to maximum, but that seems to be a problem
with all LM317-based PSU designs.
Main Voltage Regulator Circuit ( 5V plus 1.25V to 20V )
| /| D3
VUX >--------------------------------------------------.---|< |---------------.
| | \| |
| REG2 7805 |
| .-------. |
VUR >---.---------------------------------. `----------| I O |---^---.---> +6V
| __|__ | Com | |
| D1 / \ `---.---' |
| REG1 LM317T /___\ | |
| .-------. | | |
}--------.-----| I O |------.---^---.--------------.--------|-----------|---> +VR
| | | Adj | | __|__ | | |
| | `---.---' .|. / \ D2 | | |
| __|__ | R1 | | /___\ | __|__ |
| --.-- C1 | 180R |_| | | \ / D4 |
| | 100nF | | | | __\ /__ |
| | }----------^---.---^---. | | __|__
| | | | | VR1 __|__+ | C5 --.--
| | | | .|. 5K7 ===== C4 | 100nF |
__|__+ | __|__+ .|. | |<--. | 1uF | |
===== C2 | C3 ===== R2 | | |_| | | 35V | |
| 4700uF | 10uF | 100K |_| | | | | |
| 35V | 35V | | }----' | | |
| | | | | See | | |
| | | | | Text | | |
0V >---^--------^---------^--------------^-------^----------^--------^-----------^---> 0V
At the core of the circuit is a 7805 regulator providing a regulated 5V supply,
and used to power the optional PICAXE part of the PSU electronics described
later, and an LM317T variable voltage regulator which can provide a regulated
output of between approximately 1.2V and 37V.
Unregulated input voltage (VUR) is derived from a standard transformer and
bridge-rectifier configuration and needs to give a voltage at the LM317T input
of at least 3V more than the maximum voltage to be produced at its output.
The mains side of the power supply should be switched, preferably both Live and
Neutral using a DPST switch, and the Live should be routed through an
appropriately rated fuse.
C1 and C5 are 100nF capacitors used to stabilise the regulators and should be
fitted as close to the regulators as possible.
C2 is used to smooth the incoming AC voltage, and C4 is used to stabilise the
variable voltage output. C3 is used to stabilise the voltage regulation. C2, C3
and C4 must be rated at greater than the nominal voltages across them, with 35V
being an appropriate value.
R2 and VR1 determine what the variable voltage will be, and will also define
the maximum output voltage. The values used provide for a 1.25V to 20V supply.
The wiring for the VR1 pot is described below.
D1, D2 and D3 are 1N4004 power diodes and provide for reverse voltage protection
of the regulators. Most regulator circuits will miss these components out, and
generally they are not required, but they are essential protection for a bench
supply.
The 7805 regulator is powered from a smoothed unregulated VUX supply which
should be approximately 8V-10V and should ideally be derived separately to the
VUR supply for the LM317T to reduce the voltage drop across the regulator,
however, it is possible to use a single VUR supply, although the heat
dissipation of the 7805 will increase substantially with increased current.
The 7805 regulator has its output voltage 'upped' by placing D4 in its common
line to 0V; this allows the nominally 6V supply to be dropped by another diode
before being delivered as 5V to external equipment.
The LM317T should have a heatsink fitted, and note that the case of the LM317T
is connected to the Out pin and therefore this must be isolated from 0V and
the case if connected to 0V or Earth.
The 7805 should also have a heatsink fitted and because of D4, it too must be
isolated from 0V and the case if connected to 0V or Earth.
Because the LM317T and 7805 are linear regulators, the voltage drop from input
to output is dissipated as heat, and increases as current is drawn. Considerable
heat is generated for a high voltage drop and high current drain, so substantial
heatsinks and air flow may be required for some uses.
The pinouts of the LM317T and 7805 regulators when viewed from the front are
shown below ...
.----------. .----------.
| .--. | | .--. |
| | | | | | | |
| `--' | | `--' |
|__________| |__________|
| | | |
| LM317T | | 7805 |
| | | |
|__________| |__________|
|| || || || || ||
|| || || || || ||
|| || || || || ||
|| || || || || ||
Adj Vin Vin Vout
Vout Com
Voltage Adjustment
Voltage adjustment is provided by two potentiometers, giving both coarse and
fine control. These are wired as follows ...
Coarse Voltage Control Fine Voltage Control
.-------. .-------.
\|/ | \|/ |
___V___ | ___V___ |
O------.---|_______|---^---.---------.---|_______|---^---.------O
| VR1 4K7 | | VR2 1K0 |
| ___ | | ___ |
`-------|___|-------' }-------|___|-------{
R3 100K | R4 1K8 |
| ___ |
`-------|___|-------'
R5 1K8
Accuracy and flexibility of voltage control is limited to the choice of
available potentiometers and is really a compromise, but one which is generally
acceptable given the low cost incurred.
It is tempting, and suggested in some LM317-based PSU circuits, to use a rotary
switch to select a desired voltage, instead of, or in addition to, using a
potentiometer. Although this is possible, the operation of the PSU needs to be
considered carefully.
When the voltage adjustment resistance is open circuit, the LM317's voltage will
rise to its maximum, and unless switches and a circuit design which cater for
this is used, switching between two low voltages can cause the LM317 to output
its maximum voltage, which could have disasterous consequences for any
electronics connected when the voltage change is made.
In order to implement a voltage select switch, a resistor ladder must be used,
and it is essential to use a 'make before break' rotary switch to prevent the
PSU output voltage jumping to its maximum while switching between voltages.
___ ___ ___
O---.---|___|---.---|___|---.---|___|---.---O O---.--------------. .---O
| | | | | | |
| `----. .----' | | ___ | |
| | | | }---|___|---. `---O |
`--------------. | | .--------------{ | `------O O---'
| | | | | | ___ .------O /
O O O O | }---|___|---' .---O /
\ | | |
\ | | ___ |
O | `---|___|------'
| |
`-----------------' Not Recommended
Current Limiting and Output Monitoring
With the exception of D6, the enire current limiting section, monitoring, LED
display and switches can be omitted, and D6 can be replaced by a wire link if
D5 is likewise. Neither needs to be used if your PSU does not have a fixed
5V supply rail capability.
| /|
.----------|< |----------------------------------------------------.
| | \| |
| D5 / |
| /: | |\ |
+6V >---|--------------------------------.---------------------O : O---.---|---| >|---( +5V
| | : | | |/ |
| | Ammeter : | | D6
| REG3 LM317T | .-------. / | |
| .-------. ___ | +| \ | / | |
+VR >---^---.---| I O |---|___|---.----|-----.---| \ |---O O---|---^----------( +VR
| | Adj | R6 | | | |---O---| SW2 |
| `---.---' 12R5 | | | `-------' |
| | | .|. | 0-1A }--> VY
| `---------------{ | | R7 | |
| | |_| `-------. |
| / | | | .|.
| /: | | .---^---. | | R8
`---------O : O---------' | | \ | Volt |_|
: .------{ | \ | Meter |
/ | __|__ |---O---| 0-20V __|__
/ | \ / LED1 `---.---' \ / LED2
.---------O O-------{ __\ /__ | __\ /__
| SW1 | | | |
| | | | |
0V >-------^---------------------|------^-------------^---------------^--------------( 0V
|
| .---( Earth
`---> VX Mains --^--
Earth ---
-
Note that switching in the current limiter reduces the output voltage, and
that overriding it will increase the voltage. In common with other PSU's which
display the voltage being delivered, the output voltage will be 'subdued' on the
meter when current limiting is being perfomed, as voltage is dropped across the
LM317 to maintain maximum current delivery. It is therefore recommended that the
current limiter is not overridden while the PSU is delivering its output to any
attached equipment.
Current limiting is provided for by another LM317T plus R6. The value of R6
determines the current limit and is set for approximately 100mA in the circuit;
12R5 formed by 15R and 82R in parallel. This is suitable for charging NiCd and
NiMh batteries rated at 1000mAh with a C/10 charge. Alternative values for R6
can be determined from the following equation ...
1.25
R6 = ---- where Iout = 0.01A to 1.5A
Iout
A table of convenient resistor values ( in parallel and in series as necesary )
is given below ...
Desired Desired Actual Effective Actual
Current Resistance Resistors Resistance Current
10mA 125 56 + 68 125 10mA
20mA 62.5 68 | 820 62.79 20mA
50mA 25 10 + 15 25 50mA
100mA 12.5 15 | 82 12.68 99mA
200mA 6.25 10 | 18 6.43 194mA
250mA 5 10 | 10 5 250mA
500mA 2.5 1+1 + (1|1) 2.5 500mA
Current limiting which can be achieved by using single standard E12 resistors
is as follows ...
Resistor Current Resistor Current
10 125mA 39 32mA
12 104mA 47 27mA
15 84mA 56 23mA
18 70mA 68 19mA
22 57mA 82 16mA
27 47mA 100 12.5mA
33 38mA 120 10.5mA
The power rating of the resistors used is determined by the current flowing
through the resistor which will always have a 1.25V drop across it, because
of the way in which the LM317T functions.
The current through R6 can therefore be calculated from 'V=IR', and the power
dissipation from 'P=IV' as follows ...
1.25 1.25 1.57
I = ---- P = ---- x 1.25 = ----
R6 R6 R6
The power rating of resistors in parallel or in series to form the required
value of R6 is a little more complicated, but each resistor having a power
rating equal to or greater than that for the effective R6 value will suffice.
For any R6 over 6.5R ( less than 200mA current limit ), standard 0.25W resistors
may be used.
SW1 is a DPST witch used to override current limiting on the variable voltage.
The design of this switching mechanism was driven by the availability of
suitable switches, and alternative schemes are available if you use a suitable
DPST switch. In the provided design, the switch offers current limiting override
rather than curent limiting enabling, and LED1 is illuminated when current
limiting is on. When current limiting is overriden, the LED is turned off and
this is achieved by shorting LED1 out. Although this means current is always
drawn through R4, it should have minimal impact on the 5V supply.
SW2 is a DPST switch which allows the +5V and variable +VR supply to be
disconnected from the target hardware. This allows the variable voltage to be
adjusted correctly before it is applied to the hardware with the switch closed.
LED2 indicates when power is suplied to external circuits.
LED1 and LED2 can be part of the SW1 and SW2 assemblies or separate. If suitable
switches cannot be found, which may be the case for DPST switches with LED's, it
is possible to use SPST switches to control the current limiter and outputs
indirectly through suitable relays. This would likely be necessary if additional
fixed voltage outputs are needed, or current limiting was added to multiple
outputs.
Power diode D6 is used to block any residual voltage on equipment connected to
the 5V supply from illuminating LED2, and is why the 7805 Regulator output is
'upped' to a nominal 6V within the main PSU part of the circuit.
The two meters are optional, but without a voltmeter it is impossible to set
the variable voltage making it potentially dangerous to connected electronics.
It is recommended that a voltmeter is permanently connected, although it would
be possible to use the PSU with an externally connected Digital Volt Meter or
Digital Multimeter.
Power diode D5 is used to dump any excess voltage when the PSU is connected to
equipment which may have accumulated a voltage greater than VR in smoothing
capacitors and so on.
The PSU outputs are taken to output connectors and an additional 0V connector
is also required. Multiple connectors can be used to make it easier to connect
multiple items to the PSU. In addition, an extra connector straight to the
mains Earth can be added to provide a convenient earthing point for anti-static
wrist-straps and work mats.
It is recommended that 4mm Terminal Posts are used, which have a hole drilled
through for inserting wires, and are able to accept 4mm 'banana plugs'. The
choice of colours is pretty much your own, but Earth is traditionally green, 0V
is black, and positive red. Whether the variable voltage or 5V supply should
have the red connector is a matter of debate, but I decided on red to match the
bench supply I already have, and chose yellow for the 5V, reserving blue and
white for any negative supply and fixed 9V or 12V supplies respectively which
might one day exist elsewhere.
PSU Monitoring
Although I have not done this yet, a PICAXE processor can be used to monitor and
report on the operating status of the PSU.While PSU monitoring is in many ways a 'fancy add-on', it is a fairly
low-cost option, and anything which prevents a voltage too high for a circuit
being connected to can save a lot more money and heart-break in return.
|\ | ___
6V >---| >|--------------------. .------------|___|----------.
|/ | | | R13 22K |
D7 | | |
PICAXE-08M | IC1 | .----------------.-------|-----. .----.
___ R9 .-----^-----. | | .----. | | | | O \
VY >---|___|---------.---| I3 SI |---' | | .|. .|. | | | O |
| | O0 |------' | | | R14 | | R15 | `---|-O | 2 TX
___ R10 | | O1 |---------' |_| |_| | .---|---O | 7 RTS
VR >---|___|---.-----|---| A1 O4 |---. | LED3 | }--OO-|---|-O | 3 RX
| | `-----.-----' .|.| __|__ __|__ | `---|---O | 8 CTS
.|. .|. | | || \ / \ / .|. R16 | O |
R11 | | | | R12 | |_|| __\ /__ __\ /__ | | 10K | O |
|_| |_| | Piezo | | | | |_| .---|-O / 5 0V
| | | | | | | | `----'
0V >-----------^-----^---------^---------^----------^--------^-------^-----'
Red Green Female
The PICAXE is powered from the nominal 6V line dropped through D7 to operate at
5V.
The potential divider created by R10 and R11 reduces the output voltage provided
at 'VR' to a level which will not damage the PICAXE, and the resultant voltage
is read through and Analogue Input, processed and used to determine the output
voltage being provided. The values of R10 and R11 depend upon the maximum
voltage which will be produced by the PSU.
The potential divider created by R9 and R12 allows the PICAXE to monitor the
voltage provided at 'VY', so it can determine when the supply voltage is
being delivered to external equipment. Values for R9 and R12 have not yet been
determined.
The bi-colour LED3 is used to indicate the output of the supply, off when the
PSU is unpowered, Green when delivering 1.2V-3.3V, Orange when delivering
3.4V to 5.0V and Red when above 5.0V. The LED is only permanently when the
supply is connected to external equipment and blips periodically when it isn't.
Resistors R14 and R15 should be selected to give reasonably balanced Green,
Orange and Red outputs, but actual values have not been determined yet, and will
depend upon the actual LED3 being used.
The Piezo is primarily designed to warn that the PSU is set to a potentially
dangerous voltage when it is first powered up, issuing a 'friendly' safe tone
when set to deliver 1.2V to 3.3V, two beeps when set to 3.4V to 5.0V, three
beeps when between 5.1V and 9.0V, four beeps between 9.1V and 15V, and five
beeps when above 15V.
It is also intended to use the Piezo to indicate when 3.3V, 5.0V, 9.0V and 15V
has been selected, to aid in voltage setting once the PSU has been powered up.
The PICAXE also provides an interface to a PC. Operating at 8MHz, Using SERTXD
commands, it provides a 9600 baud, no paruity, one stop bit interface. A molex
link on the RX from PC line enables program downloading; the molex should be
disconnected during normal use.
The serial output line is shared with the green status LED and this LED will
therefore pulse briefly during status transmission, but should not cause any
major inconvenience or misleading LED displays.
Because I haven't constructed a PICAXE PSU Monitor yet, there is no software
available, and the final software may not reflect the intended operation which
is described above. Being a programmable device, the PICAXE software can easily
be changed to provide different modes of operation, and it should be a fairly
straight forward task for anyone familiar with the PICAXE and its programming
language to create suitable monitoring software.
A more complex monitoring system could be built using the slightly
more expensive PICAXE-18A or 18X which allows the 'VX' line to be monitored to
detect when the current limiter is enabled or overridden which can be used to
show a steady LED output when enabled, and flashing when not. The design of a
more advanced PSU Monitor is beyond the scope of this article.
Adding a Negative Rail
Although I don't need a variable voltage negative supply, it is quite easy to
add one using an LM337 regulator instead of an LM317T. Although I haven't
personally tried the cirucit here, it is based on the LM317T design, and seems
compatible with the component's datasheet.
The circuit is effectively a mirror image of the positive rail PSU but driven
by a negative unregulated voltage, VUN.
0V >---.--------.---------.--------------.-------.----------.------------------------> 0V
| | | | | Text |
| | | | | See |
__|__+ | __|__+ .|. }----. |
===== C6 | C8 ===== 100K | | | | |
| 4700uF | 19uF | R18 |_| .|. | |
| 35V | 35V | | | |<--' __|__+
| | | | |_| VR2 ===== C9
| | | | | 5K7 | 1uF
| __|__ }----------.---^---.---' | 35V
| ----- C7 | | | |
| | 100nF | R17 .|. __|__ |
| | | 180R | | / \ |
| | .---^---. |_| '-.-` D9 |
| | | Adj | | | |
}--------^-----| I O |------^---.---^--------------^------------------------> -VR
| `-------' __|__
| REG4 LM337 / \
| '-.-` D8
| |
VUN >---^---------------------------------'
By using dual-ganged potentiometers, it would be possible to create a
'tracking' power supply, where both negative and positive rails are varied as
the pots are turned.
I will put my hands up to not knowing how a current limiter would be added, but
presume that either an LM317T could be used ( sinking rather than sourcing
current ), or possibly another LM337.
If adding a negative supply, it will also become necessary to use multi-pole
switches to switch all rails simultaneously, and to enable or override current
limiting on both supplies.