1
\$\begingroup\$

enter image description here

I'm trying to lower current to about 20 mA, but even attaching a resistor of 50 Ω, I'm still not getting the regulated 20 mA or so current with the LM317.

\$\endgroup\$
4
  • \$\begingroup\$ How come you put the circuit together like that? \$\endgroup\$
    – MiNiMe
    Commented Nov 1, 2023 at 20:08
  • 2
    \$\begingroup\$ Why did you put a diode and does it work better without it? \$\endgroup\$
    – Justme
    Commented Nov 1, 2023 at 20:26
  • \$\begingroup\$ The diagram could easily have been MUCH better. Trinmming rubbish off top helps. There is an inbuilt schematic diagram editor that is amazingly easy to learn. Click circuyit symbol button at top of question page. || Label components. Even if there is only one diode and 1 resistor. \$\endgroup\$
    – Russell McMahon
    Commented Nov 2, 2023 at 9:07
  • \$\begingroup\$ What is the function of the diode? \$\endgroup\$
    – MiNiMe
    Commented Nov 2, 2023 at 16:30

3 Answers 3

2
\$\begingroup\$

The calculated resistor at 50 Ω is correct. But with the D1 you change the equation with the diodes voltage drop. Did you mean to use the diode to rectify the dynamos AC? Then put it in forward before the capacitors positive side. This is how I would remake your circuit:

enter image description here

\$\endgroup\$
5
  • 2
    \$\begingroup\$ L:M317 dissipation is lowish at 20 mA x (18-1.25ish-1.25) x 20 mA ~~~~= 300 mW BUT if you want lower adding a series input resistor to drop most of Vin moves the heat off the regulator. [I know you know that :-) ]. \$\endgroup\$
    – Russell McMahon
    Commented Nov 2, 2023 at 9:11
  • \$\begingroup\$ You are wrong. Not the electronic part of course, but that I know :) I'm just a 1/1000th of what other here know. Anyway, wouldn't that resistor just move around the heat? \$\endgroup\$
    – MiNiMe
    Commented Nov 2, 2023 at 11:22
  • 1
    \$\begingroup\$ Yes - you are correct. As noted "moves the heat off the regulator". In this case it's not important except perhaps if the OP used a TO92 or a small SMD and decided to up the LED current. But when you get to dissipating a few watts when dropping from eg 18V to LED, it's far easier to dissipate most of the heat in a cheap aircooled resistor than having to eg heatsink a low dissipation reguilator. An eg 10W aircooled ceramic resistor can be reliably run at about 5 Watts indefinitely. \$\endgroup\$
    – Russell McMahon
    Commented Nov 2, 2023 at 11:36
  • \$\begingroup\$ @RussellMcMahon With such a resistor you would not acheive the current at low dynamo RPMs. \$\endgroup\$
    – Jens
    Commented Nov 2, 2023 at 17:36
  • \$\begingroup\$ @Jens True. With variable input a compromise resistor would help to remove heat from the regulator with reasonably low L:ED impact. In this case it is not required. \$\endgroup\$
    – Russell McMahon
    Commented Nov 3, 2023 at 3:33
1
\$\begingroup\$

It seems that all you want is a constant current source.

Instead of an LM317, why not use two transistors as shown below. It'll not be as accurate as LM317, but is cheaper, uses more available parts (if you can't get transistors, the world has ended), and still works pretty well. With a full diode bridge as shown, the dynamo can be an AC or DC dynamo - it won't matter. The diodes and transistors can be pretty much anything you can find cheaply for this application. They are not critical. You'll need to measure the current and try a couple different values for R1 and choose the one that gives output current closes to the 20mA you want.

schematic

simulate this circuit – Schematic created using CircuitLab

The relationship between the input voltage and output current is approximately:

enter image description here

That's quite reasonable regulation for a LED.

If you want it to work better at lower voltages, lower the value of R2. Conversely, for much higher voltages, R2 can be further increased. The current is set by R1.

If you want better regulation, and can find a Zener diode with voltage between 3-8V, here's how to do that:

schematic

simulate this circuit

As usual, adjust R1 for the current you want. The regulation is quite good:

enter image description here

Instead of a Zener diode, you can also use a transistor - but most Spice programs can't simulate it. It works fine in practice, though:

schematic

simulate this circuit

This circuit uses the reverse base-emitter breakdown voltage in Q2 as a voltage reference. The voltage will be somewhere between 5-8V in typical small signal transistors, so that works well.

With three transistors, we can get very solid regulation - an overkill for a simple LED driver. It takes more resistors though. And, as usual, adjust R1 for the current you desire.

schematic

simulate this circuit

Instead of Q2, you could use a Zener diode.

\$\endgroup\$
0
\$\begingroup\$

You don't have to, and in practice, you can't, "lower current" to x mA. What you need first is a voltage regulator. The dynamo has a variable voltage, and this voltage has to be regulated according to the device that you intend to power. If it's a 20mA LED, take the "typical voltage" of the LED. If it's another device, it's the same principle: The device will draw the required current as long as you provide the right voltage, without the need to control this current.

In the case of LED, it's always noted that current must be regulated exactly. This is true only if you want to keep the light at a precise, constant and predictable intensity. And for this, constant current regulators exists, and they basically correct the voltage so that x amount of mA are used. But first of all, you should know whether you really need it. In fact, you can power a LED with very slightly more or exactly the typical voltage of the LED with a resistor in series. If the voltage is properly regulated, there is no risk for LEDs or other devices.

\$\endgroup\$
14
  • 2
    \$\begingroup\$ the lm317 can be used as a constant current source without any voltage regulation, see the datasheet for application examples. \$\endgroup\$
    – dandavis
    Commented Nov 1, 2023 at 22:55
  • 2
    \$\begingroup\$ Remember LEDs regulate voltage, just like zeners. Open circuit voltage would be generator p2p, short circuit voltage would be ~0.01v. We can also know the output voltage of an LED CC'd@20ma; they show the i/v curve in datasheets, so we can precisely lookup V @20ma. KISS and minimize BOM. \$\endgroup\$
    – dandavis
    Commented Nov 2, 2023 at 1:59
  • 1
    \$\begingroup\$ I agree It can work with a LED. \$\endgroup\$
    – Fredled
    Commented Nov 2, 2023 at 2:19
  • 1
    \$\begingroup\$ In THIS case LM317 dissipation is around 300 mW. This can be further lowerd by using a series input resistor. || The LM317 starts up benignly. (If it didn't then using it as a voltage regulatror above it's internal Vref value would run an equal risk of excessive Vout.) \$\endgroup\$
    – Russell McMahon
    Commented Nov 2, 2023 at 9:13
  • 1
    \$\begingroup\$ Ruqayya Saleh Maybe you could put a complete, detailed schematic of the installation to be able to offer you the best advice. \$\endgroup\$
    – Fredled
    Commented Nov 2, 2023 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.