Test setup Arduino controlled constant current source.
Fig. 1 Test setup Arduino controlled constant current source.
Click for larger image.

Arduino Controlled Constant Current Source

by Lewis Loflin


Note: click on any image for larger view.

Adding a single switching transistor enables microcontroller control of the output. Current limit can also be set.

For more on the original constant current source see Constant Current Source Theory Testing.

Original variable constant current source circuit using LM317.
Fig. 2 Original variable constant current source circuit using LM317.
Click for larger image.

The original CCS circuit is shown in Fig. 2. The LM317 circuit sets the emitter-base current. This controls the emitter-collector current through Q1.

Switching transistor in ground side LM317 constant current source.
Fig. 3 Switching transistor in ground side LM317 constant current source.
Click for larger image.

By adding a TIP120 transistor to the ground circuit allows an Arduino to switch the current ON-OFF. This also enables the use of pulse-width-modulation to control the output.

Iset now determines maximum current while Arduino or other microcontroller controls overall power output by varying the duty cycle - or full on.

Wiring diagram Arduino controlled constant current source.
Fig. 4 Wiring diagram Arduino controlled constant current source.
Click for larger image.

Fig. 4 is the circuit used in the demo video.

Electrical test schematic Arduino controlled variable constant current source.
Fig. 5 Electrical test schematic Arduino controlled variable constant current source.
Click for larger image.

Fig. 5 are the load connections in the test circuit.

Code

#define pwmPin 11

int val;
void setup() {
  // put your setup code here, to run once:
  digitalWrite(pwmPin, 0);
}

void loop() {
  // put your main code here, to run repeatedly:
  val = analogRead(0) / 4;
  analogWrite(pwmPin, val);
  delay(100);
}

Bristolwatch.com banner.


Related video to above:

Web site Copyright Lewis Loflin, All rights reserved.
If using this material on another site, please provide a link back to my site.