A self motivated project conducted completely from scratch to mount lights under my car door for purpose of visibility/safety and the special effects. When the car door is open the lights will turn on to shine on the ground with an under-glow effect. When the car door is closed, the lights will turn off. Then when the door is open again, the lights will turn on with a new, random color. Every subsequent time the door is closed then opened, the lights will turn on with a new random color.
Hardware:
The reason I used an Arduino Uno vs a smaller Arduino is because I wanted to have access to the barrel connector to power the project. I power the project through a 9V battery with barrel connector. This 9V battery connector I ran though the side dash panel into fuse box which is even easier to access. So this project can be easily turned on and off by attaching and unattaching the 9V battery from the connector in the fuse box. From the Altoids tin, I have three main wires, each of which are two wires attached to each other(see picture 3 below). One wire is used for the reed switch, one side of the wire sending a voltage to the switch, and the other coming back (reed switch explained later). The other two attach to the DotStar's four wires (positive, negative, data, clock). These run straight to the Arduino where the data is on pin 13 and the clock is on pin 11. Now the positive and negative I set up differently. I used a mini breadboard and designated two rows to be the positive and the negative rows. So the positive and negative go to the appropriate rows. The reed switch also attaches its positive and negative to these rows.
Software:
The reason I even used an Arduino at all here is so I could write code that changed the color of the lights every time the door is opened. Because I made this choice to use an Arduino, I could use this DotStar led strip instead of using a simple positive/negative led strip. I write the code specifically so it would only calculate random RGB numbers once, and not multiple times over and over while the door was closed. So whenever the reed switch was activated, the code would generate a new set of random numbers, and only do that once. These numbers are then stored until the door is opened then closed. I felt that this code was redundant, and did not have to run over and over. So in order to improve efficiency, I have it perform once per door closure.
So to fix this I moved the light to another spot under the door, a spot where the lights won't hit the weather stripping, and so far there hasn't been any wear and tear on the DotStar.
I have not found a solution to this yet, this is still in the works. My first thought was that the Arduino takes too much to power it, and that having the Arduino running all the time would be costly. So I was thinking I would use an Arduino nano, and since it's smaller it might take less power to run it (I could be wrong, I have not done the research on this). I was then thinking that because when the door is closed and the reed switch is activated for most of the time in this project, the Arduino it forced to send 5V at all time. That means whenever the door is closed, the Arduino must cycle 5V through the reed switch for most of the time because the door is closed most of the time. This is very costly, and requires me to have to restructure the whole project. However once I find a solution to this problem, I will make the necessary adjustments.
Wires for lights jump across the gap
Reed switch above with wires for lights below, both I tuck under the weather stripping until it jumps across the weather stripping
My easy access to the battery
Altoids tin tucked under dash
Arduino in Altoids tin
Magnet
Reed switch, placed at the bottom of the loop
Reed switch and magnet
Image 3
Image 3
3 3' 18 gauge wires with a sample of the single strand 22 gauge wire