Introduction: Arduino Car Lightbar - Prototype
In this Arduino project I will show you how I made my prototype of a lightbar.
Please note that I am not responsible for problems with other people (and maybe the police) you are possibly going to run in to.
In lots of countries it is illegal to drive with blue, flashing lights on or in your car.
I have implemented it in this project because I have permission to drive with blue lights (because in my free time I am a paramedic)
The arduino code is made using simple codes:
- 'If - Else' - statements
If you have any comments, notes, things I have done wrong,...
Please let them know by sending me a mail.
Step 1: Step 1: the Control Panel
On the control panel i have used 5 buttons. 4 with pull-down resistors and 1 normal.
If you have never used a pull-down resistor, don't be scared, it is easier than it looks.
You put a positive (3.3V) wire to one side of the switch. The other side you connect to an input pin, you also connect in that row of the bread board a resistor connected to the negative/ground rail. As long as the button isn't pressed it is connected (via the resistor) to the ground and so reads the arduino it as a LOW, when you press the button the arduino reads this as HIGH.
One button is just connected from 3.3v to the LED's without going through the arduino. because for lighting the brake lights we don't need the arduino, only 3.3v and a button.
Why not just a wire instead of a resistor.
I was thinking that too, if you use a wire, 3.3V will flow directly in the ground rail, this will be seen as a power loss by a computer (a short circuit) if you are using a windows PC i don't know what happens but when you get your power from a mac, it will shut down that USB port.
Step 2: Step 2: Output Panel
Some LED's are connected together:
- Led 1, 6 & 11
- Led 2 & 10
- Led 4 & 5
- Led 7 & 8
The connections to the arduino can be found in the code.
Step 3: Step 3: What Do the Buttons Do
Button 1: Will light the right turn signal
Button 2: Will light the left turn signal
Button 3: Will engage the brake lights
Button 4: Will flash the blue police flashers
Button 5: Will light the WigWag function
When you aren't pressing anything at all the traffic advisor will light up.
Step 4: Step 4: the Code
Please take a look at the .PDF file