Car taillight to arduino signal

Thread Starter

Napalm1432

Joined Apr 5, 2019
17
Hi there,

I'm currently working on a project for some custom tail lights, using adressable leds and an arduino.
Now that for me is the "easy part".
What 'm concerned about is that i have to take the lines for the taillights (12v line for brakes, 12v for reverse etc,), and have those
converted to 3v3 for the arduino to read.
(in short, when you press the brake, the arduino should get a signal)
As i just want to replace the taillight, and to not rewire half the car, i plan to use the current tail light connections.
I made a little schematic which should convert the 12v lines to 3.3v trough an opto-isolator.
I think i did it the right way, but as this will be quite an expensive project, i want to make sure my circuit will work (safely).
To power the arduino, i was planning on using the (always on) tail light connection, trough an opto-isolator for protection.

Hopefully you guys can check if my circuit is correct, and if not help me out on how i should do this.
Below is a link to the schematic i drew.
https://imgur.com/cGN6G9j

upload_2019-5-13_14-31-2.png
 
Last edited by a moderator:

danadak

Joined Mar 10, 2018
4,057
The 4N25 wants 50 mA thru its led to get output Vsat spec of Ic = 2 mA, .5V.

But its CTR is min 20%, and its Vcesat curves look like nominally 10 mA Iled
would work to get output saturated. So R1 wants to be -

R1nominal = (12 - Vled@10 mA) / 2 mA (Ic @ 20% CTR) =~ (12 - 1.5) /.002 =~ 5.2K

R2 not needed.

Load dump considerations -

https://www.electronicdesign.com/po...motive-load-dump-circuit-protection-headaches

So high Voltages can violate I_ledfwdmax. One way of handling that is replace
R1 with a current limiter circuit, something like



Use zener instead of two diodes, or red led as a possibility. I = (Vbase - Vbe) / Remitter.
Collector PNP goes to 4N25 LED pin, the 12V buss of circuit goes to tailight.
Transistor / zener current has to handle load dump Voltages

You show no pullup on Arduino input / Coupler collector connection, I assume you
are configing Arduino pin as pullup internal.


Regards, Dana.
 
Last edited:

danadak

Joined Mar 10, 2018
4,057
Yes to circuit, but you have no protection for load dump on the
4N25 led side. Normally load dump is a fairly short transient.
But specific vehicle determines how much of a problem this
is.

Regards, Dana.
 

Ya’akov

Joined Jan 27, 2019
9,071
Yes to circuit, but you have no protection for load dump on the
4N25 led side. Normally load dump is a fairly short transient.
But specific vehicle determines how much of a problem this
is.

Regards, Dana.
Load dump is much worse in pickup trucks where it can result in a terrible mess on the highway.
 

Thread Starter

Napalm1432

Joined Apr 5, 2019
17
Thanks for the help, i'll have a look at the load dump thing, it's a bit complicated for me :p
Anyhow, load dump shouldn't be as bad as a pickup truck, but in the future i might make something for pickups too, so pretty important nonetheless. To give you some insight, it's for a toyota supra of the year 92.
 

Thread Starter

Napalm1432

Joined Apr 5, 2019
17
So it's been about a month since i worked on this, haven't really had time to.
I edited to schematic to include load dump protection, just to be sure i didn't make mistakes, or got values wrong, could yo check if my schematic is correct (before i start ordering parts)?
You can find the schematic here:
https://imgur.com/a/JxTFsCj
 

danadak

Joined Mar 10, 2018
4,057
R1 really .47 ohms ? That would create ~ 1.5A, way too much current
for opto coupler leds.

Coupler general specs done at 50 mA, so R1 = Vbe / .05 =~ 14 ohms.


Regards, Dana.
 

Thread Starter

Napalm1432

Joined Apr 5, 2019
17
Been months, but finally got around to testing the circuit following the schematic i last posted, but when testing the 47ohm (0.25W) resistor started burning.
Any ideas why this would happen?
(I built the circuit up to the 4N25, not including it, so only tested voltage output with multimeter from the BD140 to ground)
 
Top