Using 0-5VDC with n-channel mosfet for PWM on 12VDC

djsfantasi

Joined Apr 11, 2010
9,156
Why do you have the diode in series with the gate? I don't think its needed. It'll reduce the Vgs by 0.7V

What’s the value of R1? I’d recommend 10KΩ for R1. 47K may be too large.

And you need to connect the Arduino ground to the 12VDC supply ground as well. Definitely.
 
Last edited:

djsfantasi

Joined Apr 11, 2010
9,156
Capture.JPG

Above is a partial schematic as to how I made a circuit to drive a 12V LED strip @ 1A.

In the last schematic presented, I am not sure that the PNP BJT transistor is neccessary. If the TS were switching the high side, I'd agree. I had to do include a driver transistor/MOSFET in my project when switching a p-channel for the high side. But it wasn't necessary when switching the low side. This is how I did it. Here is my link on Instructables which descibes my approach and include and includes the final schematic.

EDIT: I get it now. The TS wants a separate GPIO pin to enable/disable lighting the LED load. I don't understand yet why a separate line is necessary. A PWM of 0 is off; A positive PWM parameter is on. So why a separate pin?
 

ericgibbs

Joined Jan 29, 2010
18,767
hi dj,
The TS has requested a control line that he could pull low to enable the lite and when a high level turns off the lite.
The PWM is from a Arduino pin drive..
Perhaps the TS could explain why he wants this option.
E
 

djsfantasi

Joined Apr 11, 2010
9,156
hi dj,
The TS has requested a control line that he could pull low to enable the lite and when a high level turns off the lite.
The PWM is from a Arduino pin drive..
Perhaps the TS could explain why he wants this option.
E
So In the link I provided, I multiplex the high side (similar to the T.S. PWM requirement and enable the LED loads by switching the low side. I used an n-channel Logic mosfet connected to the Arduino, to drive a power p-channel MOSFET to multiplex the LEDs. I had to add a pull-up resistor to 12V on the gate.

Of course, this results in enabling the LEDs with a high signal. The T.S. wanted a low signal. But it’s coming from an MCU, so it doesn’t matter.

Check out the my code for the scoreboard and you can see I used #define for the signals. Hence low? or high? makes no difference. I set the enable pin to “LIGHTS_ON” and they turn on.

Or if the LED enable IS not coming from the MCU, he could stack two n-channel MOSFETs to invert the signal. With appropriate resistors, of course.
 

ericgibbs

Joined Jan 29, 2010
18,767
hi dj,
I Read thru your very comprehensive link, a very interesting project.

I'm not sure of the final purpose that the TS has in mind , other than to control an LED.???
E
 

Thread Starter

jnobits

Joined Mar 7, 2019
23
Hello,
@ericgibbs
@MrSoftware
@djsfantasi

Thanks for your help. I'm only switching PWM on and off to control the LED because it has custom logic that changes based on 12v or 12v PWM. There is no part number or place to order it online, otherwise i would have posted it. Both the LED and the original controller are custom built. I haven't been able to get it working with the corrections @ericgibbs added either. I'm going to wait till i get a dedicated pwm controller switch between 12v PWM and 12v using relay.
 
Top