Fork me on GitHub

Project Notes

#092 Power317CC

A low-power constant current source using the LM317

Here’s a quick video of the circuit in action:

Power317CC

Notes

The LM317 is typically used as an adjustable voltage supply as demonstrated in the Power317 project.

But it can also be used as a constant current supply. The details are hiding towards the end of the application notes in the datasheet, with little explanation. However this tutorial on YouTube does an excellent job of clarifying how it works.

So my intention here is to test a low-power constant current source to drive a variable number of LEDs with constant brightness.

Let’s set the design criteria to be around 2-3mA constant current. That’s far from max brightness for an LED, but enough to be definitely on.

Since the 317 will attempt to maintain 1.25V across output to adjustment pins, we therefore select an appropriate value for R1 such that (by ohms law) we get our desired current.

In my case, it seems 470Ω is a good fit. This should result in a constant current of 2.66mA.

Using some 3mm LEDs that have a forward voltage Vf of about 1.9-2V, that means a 9V supply should handle up to 3 LEDs in series at 2.66mA before we run out of voltage headroom (VCC - ~2V = 7V).

So how does it work in practice? Pretty much spot on! With 1,2, or 3 LEDs in series, the 317 holds the current at 2.71mA.

Some notes on the circuit:

  • The first DIP switch is a master on/off that will light LED1 when on. When off we get 0 current as is expected.
  • The second and third DIP switches selectively enable or bypass LED2 and LED3
  • The 10μF electrolytic capacitors smooth the power supply and are not really necessary for this circuit

Construction

Breadboard

The Schematic

The Build

With 1 LED on

The Build

With 2 LEDs on

The Build

With 3 LEDs on

The Build

Credits and References

About LEAP#92 Power
Project Source on GitHub Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is my personal collection of electronics projects, usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting (IMHO!).

The projects are usually inspired by things found wild on the net, or ideas from the sources such as:

Feel free to borrow liberally, and if you spot any issues do let me know. See the individual projects for credits where due. There are even now a few projects contributed by others - send your own over in a pull request if you would also like to add to this collection.