Advertisement

Electronics and Electrical Engineering Design Forum

Where you can find electronics and electrical engineering forum questions & answers.
no image Friday, November 24, 2017 by Rocket Ron

LM317 switching

Hi All,


Further to a post on the EPE site and a conversation with James:


I am now going to use three LM317 to set separate voltages 5V, 2.5V and 1.25V to supply 100mA.    I want to switch these three separate voltages ON/OFF with three micro I/O pins.  Can I switch the LM317 ON/OFF with an NPN in series between the bottom R2 resistor and GND.  Would this switching ON/OFF in this manner crash the LM317 on startup?


Thanks,

Tuurbo46

Comments

  • by  Alan Winstanley
    Hi there,

    Thanks for joining us on EEWeb!

    The original National Semiconductor datasheet for the LM317 shows how it's possible to digitally select output voltages with NPN transistors. The minimum output voltage would be 1.2V.  You could switch the lower leg resistor with a series pull down NPN (use multiple transistors and resistor in parallel).  In parallel with  everything is another resistor (R2) between ADJ and 0V, which sets the maximum Vout. So you shunt R2 using transistors and resistors. I guess the LM317 will output a voltage ( 1.2V minimum), depending which I/O pin triggered it on startup.

    Funnily enough in the latter 1970s I tried building my first bench PSU using an LM305 and LM395K (an interesting thermally protected TO3 transistor with 1 million gain). In 1980 I built a second one with LM317s  here (PDF) with voltage and current limiting. The LM317 was very new at that time.
  • by  Rocket Ron
    Hi Alan,


    Thanks for your input.

    I think you miss took my explanation.

    I have 3 x I/O pins, 3 x LM317 and 3  different voltages 5V, 2.5V and 1.25V.  I was thinking of switching  ON/OFF each separate voltage using a NPN in series with R2 and GND.

    However I have decided to use a PFET in series with VIN on the LM317 (default setting off), and then a NPN on the gate connected to GND.  The I/O pin is connected to the base of the transistor.   When voltage is required, the I/O pin powers the base on the transistor.

    Is this a better method of doing it?


    Thanks,

    Tuurbo46

  • by  Aubrey Kagan

    Tuurbo46

    There are dozens of linear adjustable voltage references with an enable (on/off)  control. It depends on your current, input voltage, output voltage and power dissipation. If you go to a site like Digikey and select linear regulators as an initial selection you can narrow down to one that suits your needs. Just as an instance of  one of these, try the multi source LP2951

    Incidentally, your idea of  using the LM317 and switching the resistor to ground would not work. With the resistpr out of  circuit the LM317 becomes a current limiter circuit.

  • by  David Ashton (edited)
    With regard to Aubrey's comment, the LP2951 is a fine IC but the reference voltage is given as (typical) 1.26 V so you would probably never get down to 1.25V, even shorting the ADJ pin with a transistor or a FET.


    You can get round having an open resistor for R2 on the LM317,  Have a default resistor for 5V and switch in resistors in parallel with that to reduce the voltage.  That way you'll get a maximum of 5V.  But you may still have problems with getting down to 1.25V.

    You could use a PNP transistor or a FET to switch the supply to the LM317 to disable the output.

    It sounds like you are not wanting a lot of current out of this, just precise voltages.  So you could use only 2 pins on your micro feeding a basic D to A converter, feeding an op amp buffer, to get 0 - 1.25 - 2.5 - 5V for 00 / 01 / 10 / 11 pin outputs.  BUT you'd probably need a higher supply voltage for the opamp (you might get away with a rail to rail opamp if you're not too fussy about the odd millivolts of error).  But then if you are thinking of using the LM317 you'd have that higher supply available.  Just make sure your opamp output can get as close to ground as possible (or use a negative supply as well).

    If any of this does not make sense come back and I'll try and give you more detail.


  • by  Mike P. O'Keeffe

    Hey Rocket Ron,

    I'm assuming you have some LM317s you want to use. I'm also assuming you want to potentially be able to use the 5V, 2.5V and 1.25V all at the same time? Meaning you want 3 voltage outputs instead of changing the voltage output. You're not providing power to an FPGA right? 

    From the first post, disconnecting R2 from the circuit to turn it off will cause problems. 

    Your suggested method of using a PFET in series on the VIN should work. Don't forget to add a pull up on the gate to make sure it turns off when the NPN is not being driven.

    You mention a 100mA current load, will each of these supplies be connected to the same output load? If the outputs of the 3 LM317's are all connected together, you may run into trouble. You might end up turning on each regulator through the adjust pin. If they are separate current loads, then no worries. 

    The other problem you might run into is if the loads are capacitive or inductive. Turning them on could cause voltage spikes that could end up resetting your microcontroller. You may need to add an RC circuit to the base of the PFET to slow down the FET turn on.

  • by  Rocket Ron (edited)

    Hi All,


    Thanks for all your input and helpful pointers.

    I don't really practice much in analog electronics, so I have picked the simplest design route that I believed would be the LM317.  The reason I picked the LM317 was because Vout goes down to 1.25V, and only 2 simple resistor changes are required for 2.5V and 5V.  If you know of a better chip that will do the same as the LM317 I would be happy to use that.

    Also Mike yes I will be switching each voltage ON/OFF one at a time, not all three at once.  And this will be turning ON/OFF different loads.  So 3x I/O pins, 3x PFETs, 3x LM317, 3x different Vouts, 3x different loads.

    So my undated design after all your comments, using 3 different LM317 modules:

    * Vin = 12V

    * Vout = 5V, 2.5V and 1.25V

    * Iout = ~100mA

    * Voltages switched ON/OFF using a PFET using pull-up resistor on Vin on the LM317.  NPN or NFET used to activate PFET via I/O pin.  Instead of using the NPN would you say it would be better to use an NFET for turning the PFET on?

    * Capacitors, Vin and Vout caps 1uF Electrolytics for fast response.

    * Schottky diode on Vout after capacitor.  Also am I correct in thinking a standard schottky with 100mA passing though it, it will only drop ~0.1V?


    Would you say this simple design will be reliable, or would you recommend another route?  This design will be used for switching ON/OFF an ECU.  If you can see any problem areas in my design I would be happy to reconsider.

    Many Thanks,

    Tuurbo46

    • by  David Ashton
      Rocket Ron - sorry, now seen you want 3 different outputs.  That's easy, as you say 3 x LM317, and 3 fets to switch them off and on.  As Mike says below, if you have the 3 LM317s feedig 3 different loads, don't bother with the schottky diodes.  The will drop between 0.2 and 0.4 V depending on the current. If you really need them (and if your loads are constant) you could use presets to adjust your voltages to compensate so that your voltages are reasonably precise.


      Your micro will only output 5V and I assume you'll be feeding your LM317s from 12V...if so use an NPN transistor on the pins, to pull down the gate of a P-channel FET (as someone said, use a pull-down resistor).

  • by  David Ashton
    Rocket Ron - sorry, now seen you want 3 different outputs.  That's easy, as you say 3 x LM317, and 3 fets to switch them off and on.  As Mike says below, if you have the 3 LM317s feedig 3 different loads, don't bother with the schottky diodes.  The will drop between 0.2 and 0.4 V depending on the current. If you really need them (and if your loads are constant) you could use presets to adjust your voltages to compensate so that your voltages are reasonably precise.


    Your micro will only output 5V and I assume you'll be feeding your LM317s from 12V...if so use an NPN transistor on the pins, to pull down the gate of a P-channel FET (as someone said, use a pull-down resistor).

  • by  Mike P. O'Keeffe
    What is the Schottky diode for? The LM317 should provide sufficient voltage regulation and protection.


    They would typically range from 0.2V up to 0.8V. The forward voltage of the diode is related to the amount of current going through it. The more current, the higher the forward voltage (or voltage drop) and the more power being dissipated as a result. In this case 0.2V x 100mA = 20mW. 


    -Mike

  • by  Rocket Ron
    Hi again,


    In regard to the schottky diode I have just read the ecu datasheet again and I need to switch a 4th port.  The problem is this ecu port requires two independent voltages 2.5v and 1.25v for two different functions.  

    I was hoping i could use 2 more I/O pins, 2 more lm317 assembles with schottky doides on Vout and then join the outputs together and feed into the ecu port.  Only one voltage will be selected at any given time.  Could i remove the Vout diodes or would the backward voltage from the parallel lm317 blow the lm317 up? 


    Hope this makes sense?


    Thanks,

    Rocket Ron 

  • by  Rocket Ron
    Hi David,


    Could advice me a model number for that DAC you previously mentioned.

    Thanks,

    Rocket Ron.

Add Comment

You must log-in to comment.