Author Topic: Best way to digitally control lm317 based constant current driver  (Read 11433 times)

0 Members and 1 Guest are viewing this topic.

Offline rwgast_lowlevellogicdesinTopic starter

  • Frequent Contributor
  • **
  • Posts: 591
  • Country: us
    • LowLevel-LogicDesign
So ive been working on a battery charging project, and with some help I got in another thread I have sucesfully built a simple lm317 based charger wich will charge my 16 cell nimh pack at 240mA for 12 hours or so. Right now im just simply using a 1/2 watt 5 ohm resistor between the output and adjust pin to set the current level. I would like to be able to use a micro to digitally set the amount of current this circuit uses. The only way I can really think of is to use a digital Pot. I have a few ds1806 pots and an AD5220. I couldnt find the amount of wattage the ds1806 can handle in the data sheet, and looking at the AD5220 data sheet it would appear to me it can only handle load in the micro watt range... im not sure though. So what would be the best way to do this??

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2734
  • Country: ca
Re: Best way to digitally control lm317 based constant current driver
« Reply #1 on: January 01, 2013, 10:11:44 pm »
Hi,

Here is a way that you make the LM317 current source adjustable. I used the LT1117 in the LTspice model for convenience.

Here is the original circuit:



Here is the modified circuit:



A voltage is developed across R3 which reduce the voltage needed across R1. The voltage across R3 depends on the current sink Q1, U2 and R4.

If the voltage on positive input is varied from 0-1V the current limit is reduced from 250mA towards zero

The 0-1V signal can come from a DAC or a PWM output, with suitable filtering.

Note: this circuit only works if the output voltage is greater than about 3V.

I have attached the LTspice models.

Jay_Diddy_B

 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: Best way to digitally control lm317 based constant current driver
« Reply #2 on: January 01, 2013, 10:24:54 pm »
Oh dear, a programmable LM317 current source ... The thing with making the LM317 into a programmable current source is that you have to throw in more parts than what you'd need if you just build a voltage to current converter with a beefy transistor.

It is almost ironic that the solution presented above in fact adds a voltage to current converter (used in turn to add some voltage via a resistor inside the LM317 feedback loop).

Instead of letting the V/I converter drive the LM317 feedback loop one could let it drive a beefy transistor. And that is in fact what many have done here by just building Dave's Dummy Load (the Dummy Load plus a constant voltage makes a current source).
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline rwgast_lowlevellogicdesinTopic starter

  • Frequent Contributor
  • **
  • Posts: 591
  • Country: us
    • LowLevel-LogicDesign
Re: Best way to digitally control lm317 based constant current driver
« Reply #3 on: January 02, 2013, 03:22:08 am »
Hmm well im not the greatest at analog electronics here still learning, the posted solution seems to be alot more effort than this is really worth... for this project, if I were making a standalone programmable charger id definitely figure out the circuit above and use it. I was thinking maybe there would be a simple way to throw a digital pot in there with a transistor or something, it doesn't even need to be a FET as a 2n222 provides more than enough current. I try to stay away from opamp circuits where ever possible, this is my rule until I have time to sit down with a good book and really understand opamps!


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf