Understanding how to use high side switching to control a 12v car led bulb with an Arduino

Thread Starter

Ping pong

Joined Feb 13, 2022
78
I want to control my car led bulb so that they turn on with a fading effect using the pwm pins on an Arduino.

For context, the led bulb is dual filament so it works as a turn signal and DRL, both sharing their grounds from a single wire.
I have been suggested to use a high side switching circuit instead of a low side as I can only control the DRL (the bit I want the fade effect on) using the positive wire rather than ground.

All the tutorials online however are for low side switching using a N channel MOSFET. I did find a video online that uses a P channel MOSFET only (link attached below) but I have been told that a N channel MOSFET is required to drive the P channel MOSFET with Arduino.

I'm confused in what approach I should take and how I should go around wiring everything together. Please do note that I'm an accounts student and have little knowledge about electronics other than just the basics. MOSFETs are new to me hence why any help will be very much appreciated :)

• Link to the YT video:

• The LED Bulbs I'm using:
https://a.aliexpress.com/_mMwRJPQ
 

BobTPH

Joined Jun 5, 2013
9,337
A P-channel MOSFET switching a 12V circuit needs 12V to turn off. Since an Arduino can only output 0 or 5V, it cannot directly control the MOSFET. You need a level translator transistor, NPN or N-channel MOSFET in between.
 

Ian0

Joined Aug 7, 2020
10,290
Use a MCP1401.
You could even use a 555, by putting a resistor from pin 5 to ground to set the thresholds lower, then input on pins 2 and 6, output on pin 3 to drive the MOSFET.
A CMOS 555 would definitely work, a NE555 can only get to 1.5V below the V+ supply, but that should turn off most P-channel MOSFETs.
 

Thread Starter

Ping pong

Joined Feb 13, 2022
78
Here's a typical circuit for high-side drive with a P-MOSFET:
R1 is the resistor that comes with the LED.
View attachment 292588
Please bear with me while I try to explain what I understand from the diagram (excluding the resistors). Do correct me if I'm wrong.
The gate of N channel is connected to arduino, the drain to positive 12v and source to ground.
On the other hand the gate of P channel MOSFET is connected to source of N. The Drain is connected to positive 12v and source to the LED.

Secondly, any P channel MOSFET will work as long as it's rated at 1.5A+ which is the current that the pair of LEDs draw? Also can I connect both LEDs to the Drain of the P Channel MOSFET or should I copy the entire circuit for the second led bulb?

Thirdly, the resistor that comes with the LEDs is connected to the turnsignals only to stop them from hyper flashing. It isn't connected to the DRL's. That shouldn't effect the diagram in any way, right?
 

crutschow

Joined Mar 14, 2008
34,912
The gate of N channel is connected to arduino, the drain to positive 12v and source to ground.
Q1 is a BJT (bipolar junction transistor) not a MOSFET.
The base resistor R2 goes to the Arduino, the collector to R3 and the emitter to ground.
Secondly, any P channel MOSFET will work as long as it's rated at 1.5A+ which is the current that the pair of LEDs draw?
That would work, but one rated for only 1.5A may dissipate excessive heat.
You want the MOSFET on-resistance to generate less than about a watt so you don't need a heatsink, which for 3A (2 LEDs) means the on-resistance should be less than 0.1 ohms.
can I connect both LEDs to the Drain of the P Channel MOSFET or should I copy the entire circuit for the second led bulb?
You can connect both LEDs to one circuit with the MOSFET current then being 3A.
Thirdly, the resistor that comes with the LEDs is connected to the turnsignals only to stop them from hyper flashing. It isn't connected to the DRL's. That shouldn't effect the diagram in any way, right?
What is "hyper flashing"?
As long as the LEDs are designed to operate without an external resistor (meaning it's contained in the LED), it should be okay.
 

ApacheKid

Joined Jan 12, 2015
1,762
I want to control my car led bulb so that they turn on with a fading effect using the pwm pins on an Arduino.

For context, the led bulb is dual filament so it works as a turn signal and DRL, both sharing their grounds from a single wire.
I have been suggested to use a high side switching circuit instead of a low side as I can only control the DRL (the bit I want the fade effect on) using the positive wire rather than ground.

All the tutorials online however are for low side switching using a N channel MOSFET. I did find a video online that uses a P channel MOSFET only (link attached below) but I have been told that a N channel MOSFET is required to drive the P channel MOSFET with Arduino.

I'm confused in what approach I should take and how I should go around wiring everything together. Please do note that I'm an accounts student and have little knowledge about electronics other than just the basics. MOSFETs are new to me hence why any help will be very much appreciated :)

• Link to the YT video:

• The LED Bulbs I'm using:
https://a.aliexpress.com/_mMwRJPQ
I must ask, what is the "car led bulb"? perhaps you can post a picture, just to give me some context?
 

sghioto

Joined Dec 31, 2017
5,438
There is a link to the LEDs in post #1.
They have constant current drives with 100 watt resistors.
From Google:
Hyper flashing is nothing more than a turn signal that blinks faster than normal. It's a deliberate function of the vehicle's turn signal circuit that alerts the driver that there is a bulb failure.
 
Last edited:

Thread Starter

Ping pong

Joined Feb 13, 2022
78
That would work, but one rated for only 1.5A may dissipate excessive heat.
You want the MOSFET on-resistance to generate less than about a watt so you don't need a heatsink, which for 3A (2 LEDs) means the on-resistance should be less than 0.1 ohms.
You can connect both LEDs to one circuit with the MOSFET current then being 3A.
The DRL draw less than 300 milliamps each. I was being generous by quoting it as 1.5A for the pair of LEDs.

A quick google search has suggested the following MOSFETs that has on resistance of less that 0.1ohms RQ5E050AT, IPD50P04P4L-11 and Si7469DP

Hyper flash is when the turn signal turns on and off rapidly. This usually happens when one of the bulbs is blown out or (in my case) you replace the stock halogen turn signals with LEDs. This is why some aftermarket led turn signal bulbs come with external load resistors. I however have deleted them as they used to get pretty warm and instead installed a led compatible turn signal relay that doesn't cause hyperflash when the stock bulbs are replaced with LEDs.
But the load resistors were originally connected to the turn signal part of the bulbs only. The white DRL's aren't connected to the load resistors.
 
Last edited:

ApacheKid

Joined Jan 12, 2015
1,762
Thank you for your help!!
Don't mess with a car's lighting system, it is absolutely critical to safety at night, I don't understand why you'd want to do something like this, if you negatively impact the system in some unexpected way it could end badly for you or someone else, your insurance company might not be happy either. Get a certified shop to install this if you must have it, not because it's complicated but because it's important to be safe, safe, safe.
 
Last edited:

Thread Starter

Ping pong

Joined Feb 13, 2022
78
Don't mess with a car's lighting system, it is absolutely critical to safety at night, I don't understand why you'd want to do something like this, if you negatively impact the system in some unexpected way it could end badly, you're insurance company might not be happy either. Get a certified shop to install this if you must have it, not because it's complicated but because it's important to be safe, safe, safe.
I've had these installed for a year now. They are basically plug and play. The DRL's are powered by a fused ACC source hence why there is nothing to be worried about. But I do understand your concern.
 
Top