Help with transistors for a project

Hello everyone, this is a long post but i need someone to help me!

I'm doing a project in my car to put daylight running lights and control them with arduino. The working is simple, the project and code works perfect, but i'm having some issues with transistors and/or some sort of current leak that i can't figure out.

Let me go through my whole process. I made a simulation on tinkercad and everything works fine there.

I'm not going into code details and similar because that's not what i need help for, but basic functionality:
the lights represent each a couple of led lights, DRL and Angel Eyes (AE), which i already installed in the car. Gray is fog lights (AE need to be off when they are on), white is low beam (DRL need to be off when they are on), brown is ignition, green is doors (power when doors are open).
Lights turn on when doors are open (then turn off after X time). Lights are on when ignition is on and each pair turns off only if fog lights/low beam are on. Orange and blue are connected to the lights negative and are grounded only when arduino "says" it to the transistor.

So as i said everything works as expected, in the simulation....
Then i made this

And it worked good for a couple of weeks, then i started having problems with the poorly made connections (or as i suspected after some tests) so ultimately i made a custom pcb (colors name are in italian)

And it like.. never worked? I mean i tested it at home and i worked then i put it in his position and the lights turn slightly on.

I did some testing at home with a couple of leds and 5v and as you can see in the following picture with ONLY the main GND connected to ground and the blue/orange wires connected to the leds negative, the green led (blue wire) somehow goes to ground and turns on with about 2V and also the white led (orange wire) very slightly turn on with less than 1V (voltage doesn't change if i disconnect one of the two).

I know i'm probably doing something wrong but i can't explain why it works good in the simulation and also worked on multiple real tests i did before. I even replaced the blue wire transistor and it looked like it worked for a little bit then again the same problem.

I tried to explain everything to give you a better picture of the problem, i'm not an expert so this might be a stupid mistake, but i hope you will be able to help me figure it out!

Thanks!

There is something you did not mention, that is the inrush of the headlights. They can surge at 50 or more times there running current (extremely difficult to measure). The colder the bulb the worse the inrush. This typically manifests itself over a period of time as failed MOSFET. There is also the slim possibility of an arc fault where the filaments will electrically connect together causing the MOSFET to carry the load of two filaments. The ARC fault becomes very prevalent when PWMing headlights from a 42V source. Light bulbs have always been a problem with semiconductors because of the inrush. Do the MOSFETs get hot? You must fully enhance them as fast as you can. Use a scope to validate this. There is a lot of information available online covering this. Use a MOSFET rated at least 50 Amps and drive it correctly!
Good Luck & Have Fun!

What do you refer to with "headlights"? The DRL/AE are led lights strips complementary to the headlights but their positive is directly connected to the car battery. While the white and gray wire on the schematic come from the positive of the headlights low beam and fog lights, which are led lights by the way.

Anyway i seem to understand that using a MOSFET instead of the current TIP120 would solve my issue? Could you help me find the correct one for my project?

Edit: i also have 10A fuse on the main power to the circuit and it didn't give me any problems the brief time i used it in the car, but i have no fuse on the single wires coming from the car that goes on the transistors (except that they all come probably after the car fusebox)

The mosfet should run a lot cooler depending on what you chose. The TIP 120 is a darlington transistor with a VCE(sat) = 2.0 Vdc (Max) @ IC= 3.0 Adc. With 3 amps you will have 6 watts of heat. Thermal Resistance, Junction−to−Ambient RJA 62.5 °C/W that tells me 3 amps without a heatsink at 25C the case will reach (3 * 62,5) = 187.5C then add the ambient 24C you get a tab temperature of 212.5C, a bit on the warm side. Looking at a IRL520 Logic level TO220 N channel MOSFET it turns on at about 2V gs. Using Ohm's law you will get a 0.6 Volt drop across the MOSFET then at 3 amps you will get 1.8 Watts (I assumed it will not fully enhance at 5V so I used 0,2 ohm for the RDS(on). You then get 111,6C temperature rise, add the 25C ambient and you get 136.6C real hot but well below its 175C rating. Using a lower RDS(on) FET will run cooler as will adding a heatsink. The nice part it has a built in protection diode.
Good Luck & Have Fun!
Gil

First off, thank you for your help.

I looked into IRL520 and it looks good for what i need, my only concern is Vgs.
The "output" ones (blue and orange) have 5V from arduino on Gate to Source, and about 12V Drain to Source.
While the others have Gate to Source of about 12V from the car stuff (the voltage divider is only R1 = 10k / R2 = 100k) and 5V Drain to Source. Would it be a problem?

This looks a bit of an overkill . Use a relay fed from an ignition switched feed to operate the DRL. In series with that feed to the relay put a N/C contact of another relay which is powered off the headlight switch - to turn if the DRL when the head lights are on.
If you want other functions to turn on the DRL use diode OR gates to the relay coils from separate circuits

I understand but i didn't go into usage details. Using arduino gives me more flexibility and settings. Relays cost much more and it would be more of a wire chaos. Also i have everything already, so starting over isn't my plan

You need to go to the link and read the data sheet. It states Vgs 16V. Realize this is a maximum number. If you have a well regulated power supply no problem. However you are driving it with 5 volts it will work very well. Try this link: https://www.alliedelec.com/m/d/d44baf7598a89daf3e53a8ff03cc156e.pdf
Good Luck & Have Fun!
Gil

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Labeling your inputs and outputs.
Labeling component values.
Labeling base, emitter and collector, e,b,c.

Forget Fritzy, it just looks like a mass of coloured wires and is of little use when troubleshooting circuits

Do you have a fuse in the circuit somewhere?

Can I suggest instead of using TIP220 for your interfacing of the vehicles switches, you use opto couplers, they make life so much easier, and the device is so much smaller.

You PCB design, needs the tracks to be made wider, you have quite a lot of PCB with no copper.

[soapbox]
You have purchased a blank PCB, loaded with copper.
You are paying someone to remove that copper, which you purchased.
They are not giving you a discount for the copper they reclaim.
You have plenty of room so keep YOUR copper and use it to help provide strong solder points and good current carrying capacity.
[/soapbox]

Don't forget if you use TIP220 or MOSFETs the top tab will be at battery potential when the loads are switched ON.
So you need to physically stabilise them.
Hint, lay them down on the PCB and bolt them in, you are at the moment relying on the leads to support the devices in a vibration environment.
You do not need 2W base current limit resistors, 1/4W will do.

Tom... :slight_smile:

Hi Tom, thank you for taking your time on checking my project out.

That's not fritzy but tinkercad, that (if you're not aware) gives me a simulation to test the circuit and code. I don't have a better way of showing you the circuit, but if you are interested i can give you access in PM to the tinkercad circuit with all the labels and code done (i just need to translate a couple of things because i wrote them in my language)

Honestly i understand that i could've done some things better, i worked with what i knew and were comfortable with. And at this point, since i spent some months and money on it i would like to solve it in a fast and easy way that doesn't include actually starting over, maybe i will consider doing a better version in the future if i find someone to help me with.

So, as of right now i have a printed PCB and what seems a "transistors problem", the easiest way looks like to switch to mosfets (I'm actually just looking into IRLB8743PbF instead of the suggested IRL520NPbF because of better Vgs and Rds and up to 150A). Do you agree with this solution?
Also i don't have a way of bolting them with this setup, but i have the whole pcb in a closed box hidden inside the car so i hope they will be just fine!

Cheers

gilshultz:
There is something you did not mention, that is the inrush of the headlights. They can surge at 50 or more times there running current (extremely difficult to measure). The colder the bulb the worse the inrush.

Tungsten lighting surge is about 10 times, not 50. Lookup the temperature depedence of the conductivity of tungsten with temperature. Perhaps if the bulb was under liquid nitrogen you'd have the 50x factor.

The 10x current however means 100x device dissipation for a MOSFET, due to its linear on-resistance, that's potentially going to pull the part out of the ohmic region.

Basically size the part for the maximum current in the first place, never an issue (a headlamp you'd treat as 75A peak load or so, make sure the MOSFET can handle that peak).

In the original Fritzing diagram TIP120's are being used without base resistors. So the Arduino is severely overloaded on those pins and will likely fail.

Hi,
The diagram doesn't show it, but do you have current limit resistors in the base circuit between the outputs of the Arduino and the base of the two TIP220 that you are controlling?

Without these resistors you will be drawing current probably more than the 40mA (The Absolute Maximum) that the Arduino is rated at.
The output does not regulate the output current, but has a maximum rated load, if you overload the output you can damage the output circuitry.

Tom.... :slight_smile:
PS, Check the voltage drop of your tracks carrying the lamp current, you may need to solder wire over the tracks to increase their current carrying capacity.
With the load on, check the volt drop from your power in gnd terminal and the emitter and then the collector of your two TIP220.

No i don't have any resistors from the arduino outputs to the transistors, but why would it be drawing current?

Also the controlled lamps are 12v led strips and i don't think their current is that much, and the headlights (white and gray wires) (referring to MarkT comment) are also led and not tungsten

Transistor base voltage is tied to the emitter voltage plus a small offset, you must use base resistors to avoid burning things up.

Hi,
This is why we need a proper circuit diagram.
The kicad picture tells us nothing in the way of what the hardware actually is.
This may help.

The only load is the LED strip, how long/many LEDs is it?
All the other TIP220s are between the Arduino and the input sources.

Tom... :slight_smile:

RaidenElite:
Hello everyone, this is a long post but i need someone to help me!

I'm doing a project in my car to put daylight running lights and control them with arduino. The working is simple, the project and code works perfect, but i'm having some issues with transistors and/or some sort of current leak that i can't figure out.

Let me go through my whole process. I made a simulation on tinkercad and everything works fine there.

I'm not going into code details and similar because that's not what i need help for, but basic functionality:
the lights represent each a couple of led lights, DRL and Angel Eyes (AE), which i already installed in the car. Gray is fog lights (AE need to be off when they are on), white is low beam (DRL need to be off when they are on), brown is ignition, green is doors (power when doors are open).
Lights turn on when doors are open (then turn off after X time). Lights are on when ignition is on and each pair turns off only if fog lights/low beam are on. Orange and blue are connected to the lights negative and are grounded only when arduino "says" it to the transistor.

So as i said everything works as expected, in the simulation....
Then i made this

And it worked good for a couple of weeks, then i started having problems with the poorly made connections (or as i suspected after some tests) so ultimately i made a custom pcb (colors name are in italian)

And it like.. never worked? I mean i tested it at home and i worked then i put it in his position and the lights turn slightly on.

I did some testing at home with a couple of leds and 5v and as you can see in the following picture with ONLY the main GND connected to ground and the blue/orange wires connected to the leds negative, the green led (blue wire) somehow goes to ground and turns on with about 2V and also the white led (orange wire) very slightly turn on with less than 1V (voltage doesn't change if i disconnect one of the two).

I know i'm probably doing something wrong but i can't explain why it works good in the simulation and also worked on multiple real tests i did before. I even replaced the blue wire transistor and it looked like it worked for a little bit then again the same problem.

I tried to explain everything to give you a better picture of the problem, i'm not an expert so this might be a stupid mistake, but i hope you will be able to help me figure it out!

Thanks!

Use electromagnetic relays. Rugged (can survive an automobile environment), virtually no "on resistance" (unlike any BJT or mosfet) and cost comparable to a solid state switch circuit and its glue.

Relays are low tech, but sometimes they are the best choice for a project.

Hey Tom, i adjusted your circuit diagram in photoshop with all the correct inputs and outputs connections and added comments for a better understanding.
Also i'm using an arduino nano for the actual project as you can see in the post. The code works fine, i even set up a debug with the serial monitor and can see when it detects or not the input and give the correct output, but if necessary i can give a better explaination of what it does.

The drl led strips are this and are installed in the headlights

while angel eyes are this and are installed in fog lights

TomGeorge:
This may help.

The only load is the LED strip, how long/many LEDs is it?
All the other TIP220s are between the Arduino and the input sources.

Why oh why would you use a TIP220 as an input device?

Paul__B:
Why oh why would you use a TIP220 as an input device?

That IS strange.

A note on using relays:

Years ago (mid 1980's) I was an engineer at a medical device manufacturer. We made those vinyl bags you see in hospitals. These are made by taking two sheets of vinyl and using a die and several kilowatts of RF power at around 13 MHz welded the two sheets together in the shape of the die.

One of the machines we used was an 8 station turntable which was rotated 45 degrees each time it was indexed. The idea was that a production girl would load the vinyl sheets, then the turntable would rotate to an RF sealer press and weld the periphery of the bag. Then it rotated to the next girl who inserted the inlet valve, then it rotated to the valve heatsealer press, etc... until the finished bag arrived at the end.

It was basically a rotary production line.

Anyway the company that built the turntable used TTL logic and optoisolators and triacs for the table indexing controller (run and brake the turntable motor, read limit switches, cycle the RF heat sealer presses, monitor emergency stop sensors, etc.) and it never worked right.

Being next to multi kilowatt RF generators, the TTL logic didn't stand a chance.

The company redesigned and rebuilt the controller three times, adding all kinds of shielding and bypasses. They could never get it to work.

Finally I told the frustrated engineering manager "If you want that thing to work let me scrap all the garbage that xxxxx built and make a controller my way". He wanted me to tell him how I was going to design it and I said "my way".

He thought I was being sarcastic and wouldn't let me do it. I told him that then I volunteer to wipe the dust off the worthless piece of s--t once a week because it would be sitting unused. I thought if I told him I planned to use relays he would nix the project.

He finally saw my point and let me loose. I built a controller out of 11 plain old Potter-Brumfield plug in relays that had a little neon indicator inside and plugged into octal sockets. There was a matrix of 3 by 4 octal sockets in the controller box (the last one simply holding a spare relay).

The turntable worked perfectly. The relays were unaffected by RF fields, the little lights showed which relay was being actuated (or not) and replacement of a failed relay took 5 seconds.

As far as I know, the turntable is still in use, relays still clicking away, blissfully unaware of any RF fields.

So, as you see sometimes LOW tech is the answer!