LM317 Digital control (DAC)

Status
Not open for further replies.

mhmt.klsogl

New Member
Hi,
I need to control LM317 digitally with DAC. I connected DAC's VCC pin to Arduino's 5 V. SDA pin to A4, SCL pin to A5. Connected A0 and gnd pins to my circuit's gnd which I fed LM317. But, when I create real circuit and test it, I take 2.7 V to 3.3 V from LM317 output. I should take 1.25 to 6.25 V. when I check Arduino's gnd, I realized that it is not 0. ıt is -3 V. Arduino's 5V is actally +2V. which yields voltage different of 5 V. but, I have to connect DAC's gnd to my real circuit gnd which is 0 V. please help me. ı need to take 1.25 V- 6.25 V from output of the LM317. Circuit is attached.
 

Attachments

  • Screenshot (356).png
    35.1 KB · Views: 572
Your hand drawing, use of a single 9V battery will not work.

You have two power domains, one 0, 9, the other 0, -9, so need
two batteries wired like this



Now your dac runs fine off + supply, driving LM317. Problem is your
LM337 ref pin is below ground, which DAC cannot produce. So you have
to use an OpAmp level translator run off split supplies.

Use this to create the level translator - https://masteringelectronicsdesign.com/differential-amplifier-calculator-2/

I am assuming you want the LM337 LM317 circuits to track in V, just opposite polarity ?

Lastly you ignored the design recommendations to get the correct operation between the
DAC and LM317, also LM337, posted in #16, so you wont get the range you are asking for
until you utilize that circuit.


Regards, Dana.
 
There are other ways of getting your dac controlled output voltage besides using a LM317.

Here is a unity gain op-amp based circuit that doesn't have the offset voltage or minimum load requirement of the LM317. The output is 0-5 Volts. If you need 0-6.25 Volts, the circuit can be adjusted to do that.

The red trace is the DAC voltage from the Arduino.
the green trace is the output voltage into a 250 mA load
The purple trace is the gate voltage of the mosfet

The LTSpice file is attached.

 

Attachments

  • DAC to Vout.asc
    1.9 KB · Views: 266
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…