Flashing warning lights - Page 1
Forum section: electronics / projects

author: fubar.gr
author_rank: Unknown
timestamp: January 30, 2016, 03:58:38 pm
content: I wanted to put a pair of alternatively flashing warning lights near the exit of a parking lot, similar to those found in railway crossings.See here for an exampleBut commercial solutions cost an arm and a leg for no apparent reason! The cheapest I could find was €100 for each light, lamps not included. The controller board cost a whooping €300, it was basically a small MCU with a couple of relays for switching the lights on and off.So I thought, why not make my own?I got two of these:http://dasteri.gr/el/products/show/&tid=148These are incredibly bright 14 cm semi trailer truck indicator led lights. They can be driven with voltages from 9 to 33 volts and consume 130 mA at 12 Volts.I decided to use an Arduino to drive them. In later iterations of the project I will add some way to detect passing vehicle speed and if it is too high, the lights will flash at a different, faster pattern and sound a warning horn.But as a start, the circuit will simply flash the lights. The arduino code is basically a slightly modified version of theBlinkWithoutDelayexample. I also added a pot to be able to change the flashing intervalThe code for those interested is here:Code:const int ledPin1 = 11; // the number of the LED pinconst int ledPin2 = 10; // the number of the LED pinint ledState = LOW; // ledState used to set the LEDunsigned long previousMillis = 0; // will store last time LED was updatedvoid setup() {pinMode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);}void loop() {int pot = analogRead(A1);unsigned long currentMillis = millis();if (currentMillis - previousMillis >= pot) {previousMillis = currentMillis;if (ledState == LOW) {ledState = HIGH;} else {ledState = LOW;}digitalWrite(ledPin1, ledState);digitalWrite(ledPin2, !ledState);}}The board was designed with Eagle,etched with the toner transfer method, and drilled with cheap ebay carbide drill bits, 1.2mm for the pot and screw terminals, 1mm for everything elseThe Arduino I'm using is a 5 Volt Pro Mini.I am using metal can 2N2222 transistors to switch the LEDs. They are cheap, available everywhere and more than adequate for the purpose. They are biased with a 1K base resistor.I also added a diode for reverse voltage protection.The power supply is a typical 12 Volt brick.This is the bottom of the board, etched and drilled, but with the toner still in placeI could definitely pack the components more tightly together and make a smaller board, but I made it deliberately large, so that if the toner transfer process didn't go well, I would be able to easily touch it up with a Sharpie.Turns out this particular combination of toner and paper worked very well, so I'll make the next board much smaller.Here's the board with toner removed. I am using the so called "nitro" paint thinner, the toner rubs off effortlessly with that. Don't bother with Accetone, IPA or ordinary paint thinner, they simply don't work.Here are the lights mounted on a sheet of metal and the board driving them.A closeup of the top of the board:And the bottom. I tinned it simply by adding solder with the soldering ironThis is an animated GIF of the lights in actionThe total cost of the project so far:2 x 40 = 80 euros for the LED lights~10 euros for the Arduino~10 euros for all the rest of the parts usedTotal €100This was pretty much a hack job, rushed to be deployed quickly. I'll keep you posted about the next revision of the project, with a professionally made PCB, vehicle speed detection and audible alarm, in a nicely designed enclosure.

author: Supercharged
author_rank: Regular Contributor
timestamp: January 30, 2016, 04:11:45 pm
content: I think the price is explaned by the fact that those lights ant the controller have to be guaranteed to be really reliable even in harsh climates like heavy rain, snow, cold temperatures and similar. Otherwise somebody could be hit by a train because the lights didn't work.

author: ChristofferB
author_rank: Frequent Contributor
timestamp: January 30, 2016, 05:01:46 pm
content: Nice project! You could probably do away with the Arduino with a few transistors and passives for a multivibrator, though, if you need more than one.