Passive Brake Light

by kristeller62 in Circuits > Arduino

8601 Views, 26 Favorites, 0 Comments

Passive Brake Light

IMG_4033.JPG
parts.png

this instructable shows how to connect an accelerometer to an arduino to sample motion and trigger a light. in this case I am connecting an LED brake light through a relay. my goal was to create a device that I can attach to the back of my trailer and have brake light simulation based on acceleration/deceleration. I realize that this device could also be attached to a bicycle as a self contained brake light. it doesn't work as well as a brake light connected to the brake lever but it does ok.

a kit of parts can be ordered from Jameco: Passive Brake kit

Layout and Wiring

layout_4.png
pinout_3.png
arduino.jpg
IMG_4023.JPG
IMG_4014.JPG

here is the basic layout of the assembly. it uses an arduino uno and a 3-axis accelerometer (even though I only sample one axis). the digital signal generated from the arduino will be used to trigger the relay or could just be used to trigger an LED.

Reusable Accelerometer

IMG_3991.JPG
IMG_4001.JPG

I like to use headers for the accelerometer. it is easier to reuse the components. if you are making a device to use, you may want to solder the wires directly.

Orientation of Axis

acc_dir.jpg

this assembly will sample the forces on the z axis. from the diagram on the accelerometer, the z axis goes through the board. when the accelerometer is mounted in a brake light housing, the board should be oriented to stay as vertical as possible. the button connected to the digital 13 pin of the arduino will allow you to calibrate the brake light after it is mounted. by default the program uses a trigger range between -30 and 30. if the axis is off center even slightly, this default range may not work well. after mounting the assembly, push the button and the light will flash indicating that it has stored the appropriate trigger range. you can test the calibration range by tilting the assembly so the accelerometer board is horizontal and then back to vertical.

Source Code

the source code comes mostly from the wiki for the accelerometer board:

http://www.dfrobot.com/wiki/index.php?title=Triple...

I have documented the parts that I added for triggering the relay and the calibration switch

Packaging

IMG_4009.JPG
IMG_4036.JPG
IMG_4038.JPG

I have tried this with two types of LED brake lights. the square light has enough room for the entire assembly using an arduino pro mini. the oblong LED brake light has room to attach the components to the back but may need more packaging to keep it reliable.