Thursday, 22 January 2015

PSU Console

Dead Simple Power Supply

At work I'm quite spoilt, there is an abundance of equipment in the labs, and if I need, I can borrow something for home use.  Very handy when ding something specific (like the thermocouple I used here) but it comes with a down side.

If I realise I need something, it means dropping work for a few days until I can borrow the equipment (if it's in use at work, I can't have it until it's free) and as I catch the train, it also means bringing the car in if it's too big to fit in my backpack.

When it came to powering my projects, I have a very basic dual rail Power Supply (I built one just like in in Uni, tortured it to death over the coming years by running a car amp from it in my bedroom) that I inherited from a guy-who-got-it-from-a-guy-from-a-garage-sale deal.

The updside: It's got dual isolated rails, 1.25V to 15V range and 'up to' 1A output.  

The downside: It's so old the pots are scratchy, so setting an output voltage is a chore, and there isn't any current limit.  And you need to whip out your multimeter to set the voltage / measure the current in use.

So I got cracking on this:

Time For Improvement

Although it seems completely unrelated, I stumbled across some LM2596 switch mode modules on eBay, along with some really cheap panel volt meters.

These switchers aren't the most efficient, and I really doubt their longevity at full current, but you just can't buy the parts for what these modules cost, delivered.

The same can be said for these volt meters, and they come in a full range of colours with a really neat clip in bezel, that makes mounting so simple.

And of course, that got me thinking, that I've got the genesis for a add on mod to my (or any) power supply - external voltage regulation and display.

But Wait, There's More

If I was going to build a power supply display add on, I decided to add some current limiting to it as well - but it had to be simple, cheap, and work with the panel meters.  Yes you can get similar Ammeters on eBay they are more suited to the 10A range, where I want to measure 10's to 100's of milliamps.

And seeing as I'm designing something, I thought I'd also add a feature that a lot of current limited (at least at the low end) miss - a method of adjusting the current limit *WITHOUT* having to short your rails.  

The Starting Point

As I have access to a PCB mill, the goal here was a though hole, single layer design that I could punch out one lunch time. Also, I was aware of pitfalls with conventional op-amps (such as headroom limits - i.e. your standard jellybean op-amp cannot swing it's output to the rails) and that a lot of Rail to Rail op-amps tend to have narrow (i.e. 5V) supply limits.

However, I had been fortunate to have some LM6134 samples from TI to hand, and these beauties are a lot closer to an ideal op-amp than others, I was able to punch out this following simple circuit:

Current Limiting and Display

The first part of this circuit is the current limiter.  Similar to my low side constant current load, I'd decided on a high side current limiter.

As I look the reference voltage from the output of the LM2596 module, I decided to use a LED as a poor man's voltage reference.  I should have used the V+ rail, but I was punching this out in my lunch break, so, errors happen.  If you see any in this post please feel free to comment!

Anyway, this voltage is buffered and sent to a pot, that I use to set a reference voltage for the MOSFET limiter.  As it's a high side limiter, the trick is that the output current is a function of how far below the rail this set point is.  As my current shunt is a 1 ohm resistor (from the ten 10 ohm resistors in parallel) there is also a direct 1:1 ration between current limit and voltage sense.  

In short, if I set the node labelled SET to 500mV below the VREG rail, the MOSFET will limit the current to 500mA.  Too easy.

S1 is then used to select the SET or SENSE voltage on the OPAMP - then that voltage is buffered by U1A, and then summed in U1B, with the rail.  U1B has a non inverting gain of 2, with an inverting gain of 1, and mashing these together, the output of U1B (IMEASURE) is the absolute value of the difference between the VREG rail and SET / SENSE voltage.

So if VREG were 10V, and I had dialed in a 500mA limit, SET would measure at 9.5V and the output of U1B will be 500mA.  

All made possible with the LM6134 being so close to an ideal opamp.  This circuit won't even come close to working with an LM324!

Voltage Display

S2 is used to switch off the voltage output, and the panel meters are just wired in parallel to the output.  When in current limit, you will see the voltage fall (as expected) and when S2 is OFF the display reads 0V.  

The voltage is set using the LM2596 module, with it's on board trimmer removed and replaced with an external Pot.

That last point was a brain fart on my behalf.  I cannot set my output voltage without turning S2 on.  If I ever get around to a V3 of this I'll display the voltage before S2 and use an LED to indicate if the voltage output is on or not.

V3?  Yeah, my first cut had a few issues....

I used an Hammond hobby case for my board, with non symmetrical mounting holes.  You guessed it, I got them wrong and the board didn't fit into the case.  Which I discovered after assembling it.

Also I used some 1 ohm wire wound resistors for the current sense element (not shown in the above picture), and these being 10% tolerance parts just lead to a crap reading.  10% is just too coarse for this, and switching to an array of 1%  resistors was well worth the effort.  So yeah, this board is V2. 

The front panel did fit, however.

Getting Funky

I've always had a preference for art-deco style on things, and I thought I'd flex my (tiny) artistic side and produce something that might pass for 'stylish' as opposed to purely functional!

From this I milled and dummy assembled this!

The panel was going to call for a lot of point to point wiring.  If I was smart, I'd design a board for the panel gear to mount on, but I'm not smart.

After a bit of trail fitment, I had to light it up.  In my opinion, it was looking good!

The top half of the panel is the Volt meter / switch / pot, the bottom half Current meter / switch / pot.

To make the point to point wiring more manageable, I tried using ribbon cable.  This was a mistake and this stuff is a bastard to work with - the insulation melts very easily, the fine conductors break easily and you give up using it like this, easily!

At this point I also felt that the panel was a bit boring still.  

I decided to try rubbing some colour into the milled lines. 

I simply grabbed some white board markers, scribbled over the panel and wiped off the excess.

The blue stood out well, but not so much the red.

So blue for all it was then!

My second wiring attempt was conducted with stranded cable.

Which ended up pretty neat when lashed into a harness.

The lid went on the box, with Banana Sockets for the input and output voltage fitted.

In Use!

Once finished, it was time to put the panel to work!

Apologies for the blurry photos, the blue isn't as bright in real life.  

When in current limit, my panel agreed with my $2 ammeter to within 20mA.  You tell me which one is more accurate!  However, for my use this is fine.  Remember the goal was to set current limits that will not destroy the project I'm developing, not give me laboratory spec readings.

And for a glory shot, here's a LED string being lit up.  WIN!

If you're interested Altium files are here.


  1. I can't understand what the diode voltage reference is acheiving? Wouldnt the best solution be just to connect the ISET pot to VREF. To me it currently looks like it is just restricting the minimum current setting.

  2. The idea here is you can set your current limit, then change your output voltage (i.e. Vref) without altering your current limit.

    If you don't care about the current limit being stable, no problem.

    1. This comment has been removed by the author.

  3. I dont think your circuit is correct, I believe that your current limit will increase if you raise the voltage. I have done some testing in LTSpice that seems to confirm this.Circuit overview, Results. Images show the effect or a range of pot rotations when the VREF rises from 0 to 10V over 100ms(hopefullythis makes sense). I also includes an alternative circuit that I think works better but I have only tested it in LTSpice.