Warning strobe light controller for car

From CaveLab
This page is kept for historical interest. It may document projects or methods that are obsolete and/or no longer relevant. The information here is not kept up-to-date.

This car has been scrapped.
Warning lights unit 2

Strobe light controller, using the AVR ATtiny2313 microcontroller. Meant for cars; with front, side and rear warning lights.


On my old car, a Subaru Legacy, I built and installed warning lights on all sides. Never really used them, but it was a fun build. I had a total of 8 LED warning lights, all around the car. The lights on the side was used as side markers when not flashing. I originally used the red break light as the rear warning light, but later replaced it with two self-built warning lights.

I used self-built LED warning lights in the front and rear, while the side lights were regular side markers. When the warning lights were not flashing; the side markers lit continuously at 10% duty cycle. And then the car started the front side markers would fade in, then the rear, it looked kind of cool from the side :)

The front warning lights split the patterns between them, so alternating from side to side. While the side and rear lights flashed together. The module was originally designed to use the cars additional break light, that is why the rear output is a bit different from the rest. It has two transistors and gives out 12V, while the rest are open collector.

The signal to activate the warning lights came from another microcontroller module I built for the car; a controller for the additional headlights I installed.




  1. PD6 - Flash signal (Optoisolator)


  1. PB0 + Red light
  2. PB1 - Aux 1
  3. PB2 - Aux 2
  4. PB3 - Yellow light 1 (PWM)
  5. PB4 - Yellow light 2 (PWM)


To make it easy to connect to different LED lights I used a pluggable terminal connector. Pluggable-led-connector-g25oxg.png

Source code

Bascom-AVR source is available in a git repository:


Schematic drawing


Parts list

Qty. Part
1 × AVR ATtiny2313-20PU, DIL-20, 20 MHz, 18 I/Os
1 × Capacitor, aluminium electrolytic, 10 µF, 25V
2 × Capacitor, aluminium electrolytic, 47 µF, 25V
1 × Capacitor, ceramic, 1 nF, 100V
1 × Capacitor, metallized polyester foil, 10 nF, (0.01 µF)
1 × DIL socket, 20-pin, 7.62mm
1 × DIL socket, 6-pin, 7.62mm
1 × Enclosure, plastic (1591 FL), 100x50x25mm, flange
1 × Fuse 5x20 mm, 500 mA, fast-acting
1 × Fuse 5x20 mm, 1 A, fast-acting
2 × Fuse holder, wire, 5x20 / 6.3x32mm
1 × Heatsink, 27.3K/W, 19mm, attachable, TO220
1 × Optocoupler, single, CNY17F-3, DIL-6
32 cm2 PCB, stripboard, 100x160mm, 160cm2
1 × Resistor, carbon film, 0.25W, 330 Ω, 5%
7 × Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
1 × Resistor, carbon film, 0.25W, 10 kΩ, 5%
1 × Resistor, metal film, 0.6W, 1 kΩ, 1%
8 × Straight pin header, female, Single row, 2.54mm
9 × Straight pin header, male, Single row, 2.54mm
16 × Terminal block, screw, 2.5 mm
1 × Transistor, NPN, 100 mA, 45V, 0.5W, BC547B
4 × Transistor, NPN, 800 mA, 45V, 0.625W, BC337-25
1 × Transistor, PNP, 800 mA, 45V, 0.625W, BC327-25
1 × Voltage regulator +5V, 2 A, L78S05CV
4 m Wire, stranded, 0.50mm2, Yellow
25 m Wire, stranded, 0.75mm2, Blue