Hi All,
I've been researching how to step down power in an automobile for a couple of projects, and want to run my solutions by the experts before I start buying components. Note: I will be referring to power coming from the car is 12v, even though its a little higher, has spikes, and is noisy.
The goal of the first project is to replace my interior lighting with WS2812B strips. The two questions I'm trying to answer are (1) How do I sense the On and Door states from the OEM wiring and (2) How to best step down the power for the LED strips.
Question 1 - Sensing:
Because the car is an older model, the OEM system is dead simple. It has one light fixture controlled by one switch that has three positions: Door/On/Off
My plan is to wire the lines for Door and On individually through 4N25 optocouplers (with a 1k ohm resistor) and through an SPST switch on the ground side.
On the arduino side of the octocoupler, I plan on connecting 5v to the collector and running that to an input pin using INPUT_PULLUP. Then the emitter will be connected to ground.
So, if I close the SPST switch for ON, current will flow through the infrared LED, which will cause current to flow on the 5v side, the ON input pin will read Low. If I close the SPST switch for Door (and open a door), current will flow through the infrared LED, which will cause current to flow on the 5v side, the Door input pin will read Low.
Is that correct? Do I need any additional components on the 12v side to deal with noise and voltage spikes or can the 4n25 handle it?
Question 2: Powering the LED strips
I plan on using an add-a-circuit on an unswitched circuit so that it has power even when the car is off,
but I'm going to add an SPST to this line so that I can open the circuit when the car is in storage for the winter. This will be connected to something like the adafruit UBEC DC/DC Step-Down (Buck) Converter - 5V @ 3A output.
The worse case scenario for 60 LEDS at max brightness is 3.6A; however, I doubt I'll come close to that in reality. The library has functions to limit the overall brightness, and in I'm assuming that anything close to max brightness would be way too bright anyway. (2/3 of max brightness is 2.4A.) Still, I may use two UBECs just to keep from pushing them too hard.
So, I'll connect the 5v output of the UBEC to a power and ground busses to distribute power to individual strands, and connect the ground bus to the arduino.
Adafruit's site also recommends adding a capacitor (1000 µF, 6.3V or higher) across the + and – terminals, so I'll do that for each strand.
Is the UBEC a good solution, or should I approach this differently? The arduino and the lights need to have power available even when the car is off, but I don't want to drain the battery if it sits for a week.
Thank you!