Constant current source and laser / LED driver tutorial

Today I'm going to explain what a constantcurrent source is, and show you how to use one to safely power LEDs and laser diodes.

This video builds upon material I covered in my voltage regulator tutorials so makesure you have watched those first.

Most of the time in electronics you will findyourself working with constant voltage sources Wall warts, voltage regulators, and other types of power supplies can all have smallvariations in voltage, but they are basically constant voltage sources.

So what is a constant current source? Well, as the name implies, it's a circuit that createsa constant current regardless of what the load is.

This is the schematic symbol of acurrent source connected to a resistor.

If you have an ideal 1 amp constant current sourceit doesn't matter if you connect it to a 1 ohm resistor or a 100 ohm resistor, it willalways shove 1 amp through the resistor.

Don't want to use a resistor? Put an LED in thecircuit, and regardless of what color the LED is, it will push 1 amp through the LED.

This may or may not be a good thing, depending on how much current your load can handle.

Certain devices, like high powered LEDs, arebest used when they are fed a constant current, because they will maintain the same brightnessregardless of how much they heat up.

You could also use a constant current source to drivea string of LEDs in series.

Here I have a 12 mA constant current source I built andit doesn't matter how many LEDs I put on it, they all get 12mA.

So how do we build this? Well, the easiest way to build a constant current source isusing an LM317.

I'll put a link in the video description section.

Here's the circuit diagram – it's very simple.

You connect your power source to theinput pin, and then you have a resistor between the output and the adjustment pins on theLM317.

A pair of 10uF capacitors will help stabilize the current source during suddenload changes.

The value of the resistor determines what the constant current will be.

In the example I showed you, I used a 100 ohm resistor, which gave me a theoreticalcurrent value of 12.


Now let's see what we are getting in real life!Here I'm pushing 12.

6mA through an LED.

If I add another LED, I still get 12.


Let'sadd a laser diode to switch things up.

It doesn't matter what the load is, the currentstays the same.

And the other cool thing is that even if the input voltage increases to24V, the current stays constant.

The input voltage is still important though.

If we gofrom 12V down to 5V, we no longer have enough voltage to turn on all the LEDs.

You needto make sure that the input voltage is at least 2 volts higher than what the load requiresto overcome the dropout voltage issue.

I explained this in more detail in my video about voltageregulators.

Now how does all this magic work? Isn't theLM317 supposed to be an adjustable voltage regulator? Well, it is! But we are using aspecial trick to make it behave like a constant current source.

Inside the LM317 is some special circuitry that creates a feedback loop.

This feedback loop is set up to maintain a difference of 1.

25 volts betweenthe adjust pin and the output pin.

If the input voltage suddenly changes, it doesn'tmatter.

The LM317 quickly adjusts the output voltage to maintain a difference of 1.

25 voltsbetween the adjust pin and the output.

If the load changes, it doesn't matter, the LM317reacts and maintains the 1.

25 volt difference.

You can use this behavior to build an adjustablevoltage source, or you can use it to build an adjustable currentsource.

This equation is basically ohm's law.

Voltsdivided by resistance = current, and since you know the LM317 is giving you a 1.

25 voltdifference, by changing the resistor value, you can choose the current.

Now there is one more thing you should know about.

The LM317 is a linear voltage regulator, and our current is passing through a relatively large resistance value.

In other words, thisdesign is not very efficient.

I wouldn't recommend using it for currents higher than 200mA, otherwiseyour components are going to get really hot.

If you want more current, search for switchmode constant current supply designs, or visit Amazon for a premade solution.

Thank you for watching, and check out my other videos if you want to learn more about electronics!.

Leave a Reply