LED flasher with adjustable speed

Two LEDs, one green and one red, take turns: exactly one is lit at a time and they swap again and again. Turn the knob clockwise and they swap faster, turn it back and they slow down. In the Short the swapping runs at about 1.6 times a second with the knob fully clockwise and about 0.6 times a second fully counter-clockwise.

  • 10 parts
  • 8 wiring steps
  • No code needed

Quick answer

The short version. Every pin is in the full wiring below.

What you need

  • 18650 Li-ion cell in a holder
  • BC547B NPN transistor, two of them
  • 5 mm green LED
  • 5 mm red LED
  • 220 ohm resistor
  • 100 uF 25 V electrolytic capacitor, two of them
  • 4.7 k resistor
  • 1 k resistor, in series with the potentiometer
  • 10 k linear rotary potentiometer
  • Jumper wires

How to wire it

  1. Cell plus to the anode (longer lead) of the green LED, the anode of the red LED, and one end of the 1 k resistor.
  2. Cell minus to the emitter (E, right leg) of both BC547B transistors.
  3. Green LED cathode to one end of a 220 ohm resistor.
  4. Red LED cathode to one end of the other 220 ohm resistor.
  5. Capacitor 1 minus lead (striped side) to transistor 2's base (B, middle leg) and to one end of a 4.7 k resistor.
  6. Capacitor 2 minus lead (striped side) to transistor 1's base (B, middle leg) and to one end of the other 4.7 k resistor.
  7. The free ends of both 4.7 k resistors to the potentiometer's middle lug (the wiper).
  8. Potentiometer right lug (terminal 3, clockwise end) to the free end of the 1 k resistor.

Before you power it: Everything runs from one 3.7 V cell. Check the cell's plus and minus before you connect it, put the capacitors in the right way round (the stripe is minus), and never short the cell, because a Li-ion cell can get very hot and catch fire.

A yellow title plate reading LED Flasher with Adjustable Speed above a green LED lit up and a red LED that is dark. A hand holds the black knob of a potentiometer on the left, a 1 kilohm resistor sits under it, and two 220 ohm resistors hang below the LEDs. In the middle are two BC547B transistors with two 100 uF 25 V electrolytic capacitors between them, two small 4.7 kilohm resistors lower down, and a 3.7 V 18650 cell in its holder at the bottom. Red, black, green, blue, pink and yellow wires join them, with hops where wires cross
The circuit as wired in the Short. Every wire end is a real pin; the netlist was checked before the video went out.

Parts list

  • 18650 Li-ion cell in a holder (3.7 V, 3.0 V when empty to 4.2 V full)
  • BC547B NPN transistor, two of them (flat face toward you, the legs left to right are C, B, E)
  • 5 mm green LED (the longer lead is the anode)
  • 5 mm red LED (the longer lead is the anode)
  • 220 ohm resistor, two of them, one in series with each LED
  • 100 uF 25 V electrolytic capacitor, two of them (the stripe marks the minus lead)
  • 4.7 k resistor, two of them, one to each transistor base
  • 1 k resistor, in series with the potentiometer
  • 10 k linear rotary potentiometer (B10K), with a knob
  • Jumper wires

Wiring, step by step

  1. Cell plus to the anode (longer lead) of the green LED, the anode of the red LED, and one end of the 1 k resistor.
  2. Cell minus to the emitter (E, right leg) of both BC547B transistors.
  3. Green LED cathode to one end of a 220 ohm resistor. The other end of that resistor goes to transistor 1's collector (C, left leg) and to the plus lead of capacitor 1.
  4. Red LED cathode to one end of the other 220 ohm resistor. The other end of that resistor goes to transistor 2's collector (C, left leg) and to the plus lead of capacitor 2.
  5. Capacitor 1 minus lead (striped side) to transistor 2's base (B, middle leg) and to one end of a 4.7 k resistor. Each capacitor feeds the other transistor, which is what makes the two take turns.
  6. Capacitor 2 minus lead (striped side) to transistor 1's base (B, middle leg) and to one end of the other 4.7 k resistor.
  7. The free ends of both 4.7 k resistors to the potentiometer's middle lug (the wiper).
  8. Potentiometer right lug (terminal 3, clockwise end) to the free end of the 1 k resistor. The left lug (terminal 1) stays unconnected, so the pot works as a variable resistor between its middle and right lugs.

How it works

  1. The two transistors work as switches that flip each other: while one is on, its LED is lit and the other transistor is off with its LED dark.
  2. The lit side's capacitor holds the other transistor's base pushed below the emitter voltage, so that transistor stays off. The 4.7 k resistors, fed through the 1 k resistor and the potentiometer, slowly charge the capacitor back up.
  3. When a base reaches about 0.7 V its transistor turns on. Its collector drops and the capacitor passes that drop to the other base, which switches the other transistor off. The LEDs swap and the cycle starts again.
  4. Turning the knob clockwise lowers the resistance between the pot's wiper and clockwise lug, from 10 k down to 0. The capacitors then recharge faster and the LEDs swap faster, about 1.6 times a second at the fast end and about 0.6 times a second at the slow end.
  5. With the 3.7 V cell each LED gets about 8 mA. The transistor bases swing down to about -1.5 V, well inside the BC547's 6 V limit, and each capacitor sees a small reverse voltage (under 1 V) for part of every cycle, which is normal in this circuit.

What the video simplifies

  • This circuit was checked by simulation (ngspice) and against the datasheets, not built.
  • The glow around the LEDs, the short fade at each swap and the sounds are graphics and sound effects, not part of the circuit.
  • In the Short the speed follows the knob instantly. A real circuit changes speed within a cycle or two as the capacitors settle.
  • The hand turns the knob in three quick twists; the one-finger turn of the first cut was replaced for this version.
  • The original viral version used a CD4047 chip. This one uses two transistors and no chip, with values chosen so it keeps flashing at every knob position.
  • The 4.7 k resistors are drawn small and without labels; their colour bands (yellow, violet, red, gold) are correct.
  • The knob hides the B10K marking on the potentiometer; use a 10 k linear one.
  • The speeds and currents are for a 3.7 V cell. At 3.0 V (empty) the ends are about 1.9 and 0.7 flashes per second at 5 mA per LED, and at 4.2 V (full) about 1.5 and 0.6 at 10 mA per LED; they are simulated values, not measured.

You found this by searching. Here's the whole path.

  1. Read how it works
  2. See it work
  3. Build it
  4. Show it
Next: see it work

Thirty seconds of video shows the circuit doing its job.

Then build it

Everything runs from one 3.7 V cell. Check the cell's plus and minus before you connect it, put the capacitors in the right way round (the stripe is minus), and never short the cell, because a Li-ion cell can get very hot and catch fire.

Then show it

Built it, or stuck halfway? Post a photo in the Wirecora Discord. Questions get an answer every day.