Mini Project : Lightbar

  • Print
 

A complete kit is available of this design...
(See the Meeps & Parts Webstore).

A Ligthbar is originally the bar on top of a policecar that holds the lights and the siren. Nowadays it is the name of the whole construction that is mounted on top of a policecar or a rescue vehicle. The first lights that were mounted on policecars were red lights that were constantly on but they didn't stand out very much. Later a rotating mirror was mounted inside the light to give it a blinking effect. This light was still mounted directly on the roof of a policecar. After that two lights were mounted on a bar often together with a siren. The color of the lights was not always red anymore but could also be blue or a combination of red and blue. The lights were blinking in a little bit different frequency, for instance 176rpm and 183rpm, so the lights didn't have a constant blinking pattern. The frequency of 180rpm calculates down to 3 flashes a second. Later the Lightbar had still 2 lights and two rotating mirrors but by the addition of extra fixed mirrors it seemed that three lights were flashing after each other.

A modern Lightbar contains even more lights. This police cruiser also has forward facing white lights to lighten pulled down vehicles. Also at the sides there are white lights, the so called alley lights, these are meant as the name implies to lighten dark alleys or side streets without street lighting. There can also be a row of orange lights mounted unther the red and blue lights to guide traffic. There are lots of different configurations when it comes to the colors of the lights and the blinking frequency. The frequency is most of the time between 120fpm and 180fpm (flashes per minute), that's 2-3 flashes per second. The colors of the lights of a police cruiser in the U.S.A. can differ from state to state but mostly the light above the driver is red and the other light is blue. Fire engines in the U.S.A. mostly have only red lights. If a fire truck has a green blinking light than it is the command vehicle. In Europe moostly only blue lights are used for police vehicles, ambulances and fire trucks.

 

Purpose of the design :

A real Lightbar is of course only allowed on official rescue vehicles so the design is meant for hobby purposes only like model cars, for decorating model railroads and so on. For this mini-project it carries a bit to far to make a complete lightbar but we will do a gooed try. What do you think of a LED-Flasher with four different blinking patterns?. With the pushbutton you can switch between the different blinking patterns. The four supported blinking patterns are : Triple-Split, Triple-All, Triple-Outside-In and Triple-Split-H/L. The program is available so you can also make your own blinking patterns with the program as an example. A Triple blinking pattern is between a double and a Quad blinking pattern and suffices for most purposes. The last blinking pattern is a modern High/Low pattern with a blinking pattern that varies between normal and fast.

 

Het schemetic :

The circuit is based an a AVR controller made by Atmel, the ATtiny13. The outputs of this controller can drive 40mA, enough for a normal LED. The 82Ohm resistors are calculated for blue LED's, for red and orange LED's these resistors must be about 180Ohm. The 10K resistor pulls the reset of the controller to +5V. The capacitor of 100nF is the standard decouple capacitor for the ATtiny13. The capacitor of 10µF makes the circuit more stable with longer power wiring.

 

Design on MEEPS Protoboard :

The circuit is built on a MEEPS Protoboard. Central on the PCB is the position of the LED's, these are mounted two by two on a good visible place. On the component side you can see the position of the different components.Important is the placing of the LED's, the longest connection is the positive connection ind is connected to +5V in this circuit. Also notice the connections of the 10uF electrolytic capacitor, + to the +5V and - to the Gnd. For the rest only the postition of the IC, de ATtiny13, is important. The mark on the IC must be pointing to the top.

 

The program :

The program is written in BASCOM-AVR and is quite easy. First the pins PINB.0-PINB.3 are configured as outputs for the LED's and PINB.4 is configured as an input for the pushbutton. After that the built in pullup resistor for the pushbutton is turned on. Than comes the mail loop that reads the pushbutton and selects one of four programs. If the pushbutton is pressed the next blinking pattern is selected. The comiled program ATtiny13-Lightbar.hex is ready to be programmed in the ATtiny13. The sources : Mini Project Lightbar Sources