# 0-5 V LM317

#### mahmut_kelesoglu

Joined Aug 12, 2022
67
Hi again,

I have designed something that supply 0 to 5 volt by using LM317 and LM337. Details are given in attached files.
My question is:
When I built this circuit on Porteus, it works very well. Proteus ss is attached. But when I create this in real life, it does not work. Why? Where and what is the problem/s?
I must supply everything with one 9 V battery or adaptor. How should I connect all grounds including Arduino's ground?
After getting 0 to 5 V, I am gonig to connect 3 diodes and a 8.2 ohm resistor at the output. I need 250 mA through this circuit (3 diodes and a 8.2 ohm resistor) when output of LM317 is 5 V. Where can I connect this circuint's (3 diodes and a 8.2 ohm resistor) gnd?

Note: The potanitometer in Proteus represents output of DAC.

#### Attachments

• 28.2 KB Views: 20
• 27.8 KB Views: 22
• 1.1 MB Views: 17

#### mahmut_kelesoglu

Joined Aug 12, 2022
67
Hi again,

I have designed something that supply 0 to 5 volt by using LM317 and LM337. Details are given in attached files.
My question is:
When I built this circuit on Porteus, it works very well. Proteus ss is attached. But when I create this in real life, it does not work. Why? Where and what is the problem/s?
I must supply everything with one 9 V battery or adaptor. How should I connect all grounds including Arduino's ground?
After getting 0 to 5 V, I am gonig to connect 3 diodes and a 8.2 ohm resistor at the output. I need 250 mA through this circuit (3 diodes and a 8.2 ohm resistor) when output of LM317 is 5 V. Where can I connect this circuint's (3 diodes and a 8.2 ohm resistor) gnd?

Note: The potanitometer in Proteus represents output of DAC.
Attached a helper schematic. But the quesiton is how to get +V, -V, and a ground with only one battery.
When I connect 3 diodes and a 8.2 ohm resistor at the output, it need voltage drop of 5V across it to consuming at least 250mA.

#### Attachments

• 52.7 KB Views: 14

#### dl324

Joined Mar 30, 2015
16,918
But the quesiton is how to get +V, -V, and a ground with only one battery.
I don't see how you can do it with one battery.

What type of battery is the 9V source?

#### mahmut_kelesoglu

Joined Aug 12, 2022
67
I don't see how you can do it with one battery.

What type of battery is the 9V source?
This

#### Attachments

• 53.9 KB Views: 1

#### dl324

Joined Mar 30, 2015
16,918
You won't get much runtime with a 250mA load. This is for Energizer's 9V alkaline:

EDIT: To clarify my earlier comment about needing 2 batteries. You could do it with one if you added an inverting switching regulator. Are you willing to add that complexity?

#### mahmut_kelesoglu

Joined Aug 12, 2022
67

#### dl324

Joined Mar 30, 2015
16,918
Can I see this?

You change the ratio of R1 and R2 to set the voltage. Output ripple would be problematic. You could use a zener diode to address that.

#### mahmut_kelesoglu

Joined Aug 12, 2022
67
View attachment 281718
You change the ratio of R1 and R2 to set the voltage. Output ripple would be problematic. You could use a zener diode to address that.
actually I do not want to use this complexity because I am just a student.
Thank you a lot.

#### dl324

Joined Mar 30, 2015
16,918
actually I do not want to use this complexity because I am just a student.
Do you really need the output to be adjustable to 0V?

There are inverting voltage doublers that only require capacitors. Here's an obsolete part:

Since the adjust current from LM317 is only 5uA, you can use a charge pump design.

#### crutschow

Joined Mar 14, 2008
34,435
If you tell us exactly what you are trying to do instead of your solution for what you are trying to do, we could likely be of more help.

#### mahmut_kelesoglu

Joined Aug 12, 2022
67
If you tell us exactly what you are trying to do instead of your solution for what you are trying to do, we could likely be of more help.
I want to built digital controlled laser diode driver up to 250 mA. I connect my laser diode at the output of the driver that supply 0-5 V. This 0-5 V have to controlled DAC. I have to use these components.

#### Papabravo

Joined Feb 24, 2006
21,225
I do not believe that it is possible to generate very low voltages with an LM317 from a positive voltage source. The device operates in such a way that the output is 1.25 volts above the ADJ pin.

#### dl324

Joined Mar 30, 2015
16,918
I connect my laser diode at the output of the driver that supply 0-5 V.
You can't adjust the output of a laser diode by varying voltage. It's better to operate them at a current above the lasing threshold and use PWM to control intensity.

#### Jerry-Hat-Trick

Joined Aug 31, 2022
552
I want to built digital controlled laser diode driver up to 250 mA. I connect my laser diode at the output of the driver that supply 0-5 V. This 0-5 V have to controlled DAC. I have to use these components.
Connect the laser diode to the 9V positive rail, via the collector/emitter of an NPN power transistor and a 10 ohm resistor to ground. The Arduino also connected to 9V makes its own 5V giving you the 0 to 5V you need for the DAC. From your first post it looks like you are expecting around 3V across the laser diode? At 250mA the volts across the resistor will be 2.5V. A/D this with the arduino and close the loop to drive the DAC into the base of the transistor (via a resistor) to control the current. You could use analogWrite instead of the DAC (which would use less power) but if you have to use it... Maybe there is a way to use the LM317 instead of the transistor but I can't see how or why you need the LM337.

#### BobTPH

Joined Jun 5, 2013
8,961
How did you get from needing to drive a laser diode at 250mA to needing a 0-5V supply?

If this is an assignment, please post the actual assignment so we can distinguish between the requirements and your own assumptions.