# Switching power supply with battery and dynamo

I am working on a little design project and will need to capability to have a switch that can change between powering some LEDs by Dynamo or Batteries. The batteries are not rechargeable and everything is rather low voltage. I have mocked up a circuit, but since I don't really have any idea what I am doing I would greatly appreciate if you kind people could tell me why this won't work. Something doesn't seem right with where it connects back to the negative ends of the power supplies after the LEDs.

• "Something doesn't seem right with where it connects back to the negative ends of the power supplies after the LEDs." - what do you mean specifically? – Andy aka Oct 27 '15 at 9:56
• Hi, wasn't sure if it would drain power or cause issues being connected to both the negative ends of the battery and the Dynamo. The Dynamo will be producing electricity constantly regardless of the state of the switch. – Mikelong1994 Oct 27 '15 at 10:53

Dynamos generate a DC voltage between their terminals with polarity depending on direction of rotation. Most bicycle 'dynamos' are, in fact, alternators giving out AC. Normally we would use diodes or bridge rectifiers to convert this to DC as required by your LEDs. Unfortunately the voltage drop across the diodes will subtract from your precious 3 V and leave you with little to power the LEDs.

One option might be to put a second LED in reverse parallel. This will work when the alternator output is reverse polarity and the LED on the left will work on battery and when the alternator top terminal is positive.

simulate this circuit – Schematic created using CircuitLab

I've put separate resistors on each supply so that you can optimise the brightness individually using Daniel's formula.

One thing to be aware of is that dynamo / alternator voltage will be speed dependent. Many alternators are designed so that the impedance of the internal inductance of the windings limits the current to a safe value to prevent blowing an incandescent light bulb. i.e., As you accelerate the bicycle the lamp turns on at fairly low speed. It does get a bit brighter as you speed up but the voltage and current don't increase linearly with speed. An internet search should give plenty of further reading on this. The LED loading may not be enough to benefit from this technique.

Note Daniel's other point that 3V is not enough to drive 3 LEDs. If you want more than one LED (pair) you will have to connect them in parallel.

• Many of these bicycle set-ups select the LEDs to get the correct voltage to match the dynamo. The resistor on the alternator leg at least is going to waste quite a lot of precious power. – KalleMP Oct 27 '15 at 19:40
• @KalleMP, sure the designers try to match the generator and lights but generally the LED voltages are fixed depending on the dopant used to create the colour. More likely the dynamo / alternator inductance is designed to increase its impedance with frequency in such a way that it almost becomes a constant current source (which is the correct way to drive LEDs) and then voltage becomes less of an issue. – Transistor Oct 27 '15 at 20:33

Two things:

1) You need to increase the provided voltage above the sum of the forward voltages of the LEDs in series (could be 1.2V to 3.2V or so depending on the LED)

2) You need to put a resistor in series with the LEDs to control the current, where

$$R = \frac{V_{supply} - V_{f1} - V_{f2} - V_{f3}}{I_{LED}}$$

Just pick your Vsuppy and Iled as appropriate.