car lights with led strip

i have a personal project, which is add a neopixel led strip to the lights of the car (brake, turns, reverse..)
i have no issue with programming the code, but i dont have that much electronics knwoledge, so I would really appreciate help in here.
doing a little research i came with this self made diagram (not so professional...)
i want to sense the electricity from the existing cables and use optocouplers to trigger the signal to arduino.
is my circuit OK? am I gonna damage my car or arduino?
thanks in advance guys!!



The opto-isolators make everything pretty-safe for your car and the Arduino.

Your Arduino inputs from the opto-isolators are connected to ground... That won't work. :wink: They should be connected to the collector (where the resistor connects to the opto-isolator).

If you enable the optional internal pull-up resistor (inside the ATmega chip) you can use it instead of the 4.7K you're using on the Arduino-side of the isolator. [u]This Example[/u] shows how to use the internal pull-up with a pushbutton switch. The opto-isolator can be used the same way.

You don't need the reverse diode across the LED in the opto-isolator.

The 4.7K resistor on the LED side of the isolator is a little high in value. 1K is more like it. The datasheet will give you the current range and voltage for the LED, but if we assume 2V across the LED and 10V across the resistor, we can calculate the current as 10V/1K = 10mA, and that's probably about right.

Make sure you've got enough current available from 5V power supply for the LED strips. "Worst case" is about 60mA per LED (white at full-brightness). That can add-up fast! And it's best if the LED strip has it's own power connection so the current doesn't have to flow through the Arduino board.

Regular opto-isolators will invert the logic (high becomes low) and sometimes a light in a car is turned-in by making the ground connection so you might have to reverse your logic in software. So, try something like that pull-up example to check what you're reading when you hit the breaks, etc.

[u]This kind[/u] of wire splice allows you to tap-into your car's wiring without cutting the wires.

You don't say how many LEDs on the strip, but the Arduino is not a power supply. It may provide enough power for two, maybe three LEDs.

[u]This kind[/u] of wire splice allows you to tap-into your car's wiring without cutting the wires.

These connectors are the single biggest cause of electrical issues that I repair while servicing automotive wiring. I highly recommend using crimp connectors with separate heat shrink. If you don't cut the wire those connectors will...eventually.

You have the digital inputs to the UNO connected to gnd, you will not see any change from those points.
This edit circuit will be better as it looks at the change at the collector of each of the optos output transistors.

Tom... :slight_smile:

thank you guys, I'll study your feedback and will try it

Im kind of concerned abobut the best way to implement the circuit for this. (im really a newby in electronics), so Im afraid I will use the wrong resistors
I found this other way

should this work better?
the optocoupler Im using is the 4N35

option 2.jpg

option 2.jpg

You don't need two 1K resistors like that, you can use a 2k2 and gnd the cathode end of the opto input.
Other than that it should be fine.
Input HIGH to the opto with produce a digital HIGH to the controller.

Tom... :slight_smile:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.