1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Yet another basic LM317 PSU

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by Blueteeth, Dec 22, 2009.

  1. Blueteeth

    Blueteeth Well-Known Member

    Joined:
    Oct 15, 2003
    Messages:
    1,168
    Likes:
    34
    Location:
    Hertfordshire, UK
    Hi,

    Since I've been doing lots of work with DIYing switch mode power supplies and portable applications, I needed to measure current quite often, in ranges from up to 5A, down to <1mA (standby current for uC). Getting my multimeter in series with the power supplies is a hassle, plus, at low currents, the voltage drop across the multimeter becomes unacceptable...so I need another one to measure the 'actual' power supply voltage my device is seeing.

    So, I just spent 20 minutes with eagle coming up with a very simple and cheap little 1A power suppliy with selectable voltages. There are LOTS of these schems on the internet I know, but I haven't seen one with in built current measurement - which converts the current draw to a 0v referenced voltage, with selectable ranges, handy to plug a multimeter in in its DC volts range.

    It measures current on the high side with a fairly large current sense resistor (a whopping 0.1ohms as oppoosed to the mili-ohm range) and a very cheap LM358. Low side current measurement is easier, but makes voltage regulation a bit harder. Of course, one could add a microcontroller, some PWM, precision reference etc.. but then it starts to get messy, and the LM317's regulation is pretty good on its own.

    Designed to take DC input from your average wall-wart power supply, or anything you have to hand...I have many laptop PSU's, ATX psu's...etc.. so no point in reinventing the wheel by including a transformer and rectification.

    Please note: not all the parts have values, as I couldn't be bothered to calculate them for the voltages. Thats the easy part and comes later.

    Criticisms welcome!
     

    Attached Files:

  2. Mr RB

    Mr RB Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    4,716
    Likes:
    194
    Location:
    Out there
    Couldn't you do this a lot more simply by just using a precision shunt resistor (0.1 ohm or whatever) and putting 2 additonal external connections to the shunt resistor so you could connect an external multimeter (voltmeter)?
     
  3. Blueteeth

    Blueteeth Well-Known Member

    Joined:
    Oct 15, 2003
    Messages:
    1,168
    Likes:
    34
    Location:
    Hertfordshire, UK
    Thats exactly what I was originally going to do :) I added the opamp because I was planning on adding a microcontroller to it, and the ADC requires a 0v referenced voltage (thus the opamp voltage follower as a buffer). Although of course I omitted it, it does form a uilding block, allowing any ADC, or a comparator to be used.

    Also wanted to add an opamp in there to add some gain...even though my multimeter is autoranging, unless I use a 1 ohm resistor (quite possible) I would have to do multiply the voltage by 10 all the time to get the current. Although its simple, its a great way to screw up readings at the end of a day at work, when you're not as sharp as you were.

    Granted, it pretty much doubles the components but does make life easier in the long run..at least I think so :D
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Boncuk

    Boncuk New Member

    Joined:
    Nov 10, 2007
    Messages:
    5,382
    Likes:
    88
    Location:
    Phetchabun,Thailand

    Hi Blueteeth,

    Eagle has a very nice function called "smash". :)

    If you smash the parts, use a finer grid size and move part names and values to be readable the schematic gets more distinctive. Looks cleaner, too. :D

    Regards

    Boncuk
     
  6. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    One of these days I need to build some current limited regulators for school. I am a bit tired of hot chips.
     
  7. mneary

    mneary New Member

    Joined:
    Feb 27, 2007
    Messages:
    4,502
    Likes:
    67
    Location:
    California USA
    I think you'll be disappointed at the voltage stability, especially at higher output voltage settings. R1's loss won't be compensated by the LM317, rather it will be amplified by the ratio of (R2+R5)/R2.

    R1 is best placed before U$1, and subtract out about ~5mA which is consumed by R2 and U$1.(You would need a different op amp.) Second best is to place R1 after the connection of U$1 output and R2.

    You'll also be very disappointed by the errors in current monitoring. The sense resistor of 0.1Ω is 100µV/1mA. LM358's typical offset voltage is 2mV, meaning that with no load the current monitor can show +/-20mA. The 1V/1mA and 1V/10mA settings will probably be off the scale at all times.
     
  8. colin55

    colin55 Well-Known Member

    Joined:
    Feb 14, 2009
    Messages:
    3,534
    Likes:
    82
    Location:
    Melbourne Australia
    You must never use a set of plugs to change the voltage on the adj pin of the 3-terminal regulator, as per your circuit diagram.
    If the supply is connected and the plug is removed, the output voltage will rise to nearly the input voltage and damage the device being powered.
     
  9. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    This is easily corrected. Just place the smallest resistor value in series with the plug/switch block such that when all resistors are removed the voltage associated with the smallest resistor will be selected. You will now have 5 positions instead of 6.

    The other 5 resistor values will need to be adjusted so the actual value is equal to the desired value - the fixed series resistor
     
    Last edited: Dec 23, 2009
  10. colin55

    colin55 Well-Known Member

    Joined:
    Feb 14, 2009
    Messages:
    3,534
    Likes:
    82
    Location:
    Melbourne Australia
    All the values have to be re-calculated.
     
    Last edited: Dec 23, 2009
  11. Blueteeth

    Blueteeth Well-Known Member

    Joined:
    Oct 15, 2003
    Messages:
    1,168
    Likes:
    34
    Location:
    Hertfordshire, UK
    Yeah, got that covered, I'm using a 'make before break' rotary switch :D That, along with a 10uF cap on the adj pin to 0v should stop the output voltage shooting up when selecting voltages. I actually changed the schem slightly, having resistors on the rotary switch in series. Good call though! if I hadn't realised that myself you would have saved a few PIC's from meeting their maker.

    As for recalculating resistor values, thats the easy part. I have an excel spread sheet which picks out E12/E24 resistor values, with a maximum of 3 in series (or two in parallel) for setting the output voltage.
     
  12. colin55

    colin55 Well-Known Member

    Joined:
    Feb 14, 2009
    Messages:
    3,534
    Likes:
    82
    Location:
    Melbourne Australia
    I think you changed the schematic after you were warned, as is seems improbable that you twigged to the fact that the output rises when the adjust pin floats – as your circuit diagram gave no indication of this.
     

Share This Page