logo elektroda
logo elektroda
X
logo elektroda

Switching LM317 Output ON/OFF Using NPN Transistor Between R2 and GND—Is It Safe?

465 10
Best answers LABEL_AI_GENERATED

Can I switch an LM317 output on and off by putting an NPN transistor between the lower resistor (R2) and ground, and will that cause startup problems?

No—disconnecting R2 will not cleanly turn the LM317 off; with the resistor out of circuit the LM317 behaves like a current limiter instead of a regulated voltage source [#21678360][#21678362] A better approach is to switch the LM317’s input supply with a P-channel FET (or PNP transistor), using an NPN/NFET from the microcontroller to pull the PFET gate low and a pull-up to keep it off by default [#21678362][#21678365] If you need selectable fixed voltages such as 5 V, 2.5 V, and 1.25 V, keep a default resistor network and switch additional resistors in parallel rather than opening the lower leg completely [#21678361] Make sure each LM317 feeds a separate load; if outputs are tied together, they can backfeed through the adjust pin [#21678362] If the load is capacitive or inductive, add RC slowing on the PFET gate to reduce turn-on spikes and possible microcontroller resets [#21678362] For this use case, several replies also note that regulators with a dedicated enable pin would be simpler if you can choose a different part [#21678360]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
  • Using three LM317 regulators for microcontroller-controlled outputs

    #1 21678357
    Rocket Ron
    Anonymous  
  • ADVERTISEMENT
  • LM317 datasheet method for digitally selecting output voltage

    #2 21678358
    Alan Winstanley
    Anonymous  
  • PFET high-side switching for LM317 outputs

    #3 21678359
    Rocket Ron
    Anonymous  
  • ADVERTISEMENT
  • LM317 resistor switching would turn it into current limiter

    #4 21678360
    Aubrey Kagan
    Anonymous  
  • ADVERTISEMENT
  • Use resistor switching or op-amp DAC instead of LM317 shutdown

    #5 21678361
    David Ashton
    Anonymous  
  • ADVERTISEMENT
  • PFET on VIN with gate pull-up recommended

    #6 21678362
    Mike P OKeeffe
    Anonymous  
  • PFET-switched LM317 design for ECU loads

    #7 21678363
    Rocket Ron
    Anonymous  
  • Schottky diode forward drop and dissipation explained

    #8 21678364
    Mike P OKeeffe
    Anonymous  
  • Three LM317 outputs switched by P-channel FETs

    #9 21678365
    David Ashton
    Anonymous  
  • Parallel LM317 outputs need isolation diodes

    #10 21678366
    Rocket Ron
    Anonymous  
  • #11 21678367
    Rocket Ron
    Anonymous  

Topic summary

LABEL_AI_GENERATED
The discussion addresses the feasibility and safety of switching LM317 adjustable voltage regulator outputs ON/OFF using an NPN transistor placed in series between the lower resistor (R2) and ground. It is clarified that removing or switching the resistor to ground disrupts the LM317's voltage regulation, effectively turning it into a current limiter, which is not a safe or effective method for ON/OFF control. Instead, using a P-channel MOSFET (PFET) in series with the LM317 input voltage (Vin) combined with an NPN transistor to control the PFET gate is recommended for switching the regulator ON/OFF. This approach ensures the LM317 remains properly biased and avoids startup issues or damage. The discussion also highlights that multiple LM317 regulators can be used to provide separate fixed voltages (5V, 2.5V, 1.25V) each switched independently by microcontroller I/O pins controlling PFETs. Additional points include the impracticality of digitally switching the adjust pin resistor for voltage selection, the potential use of alternative linear regulators with enable pins (e.g., LP2951), and the importance of load isolation to prevent interaction between outputs. Schottky diodes on outputs are generally unnecessary unless compensating for voltage drops or protecting against backfeed when outputs are paralleled, which is discouraged. Suggestions for alternative solutions include using DACs with op-amp buffers for precise multi-level voltages. Overall, the recommended and safe method for ON/OFF control of LM317 outputs is switching the input supply line with PFETs controlled by microcontroller-driven NPN or N-channel transistors, rather than switching the resistor to ground.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT