dimming light using P channel MOSFET

Thread Starter

Svizoman

Joined Oct 23, 2016
8
Bellow is my circuit design. I am using dual p channel mosfet (FDS4935BZ) to dimm two H7 bulbs using PIC PWM. Since bulbs are connected to the ground in the headlight itself I can only use P channel mosfet. Since P channel mosfet is on when 0V is on the gate I am also using third P channel mosfet to provide 12V from the car's ignition to the gate of dual channel mosfet that actualy controls the current through two H7 bulbs. So when PWM from the PIC is 0 bulbs shoud be dimmed to 0 and when PWM from PIC is 255 bulbs should shine with full brightnes.

Problem is that none of this worked. Bulbs shined at full brightnes even when PWM was set to 50 (20% duty so should be 1V) and also circuit started to overheat. Strange thing is that third mosfet (ZXMP7A17G) that only controls voltage to gate of dual mosfet got burned out.

schematics.JPG
circuit board.JPG
yellow lines are wire connections on the other side. All the surface mount ICs yellow markings are shown mirrored since they are fliped over on the other side when soldering!
 

crutschow

Joined Mar 14, 2008
23,487
It doesn't work because the MOSFET controlled by the PIC needs to be an N-MOSFET, not a P-MOSFET.
A P-MOSFET needs Vgs to be 0V (Vg=12V) to turn off and the PIC output can't provide that.
It should be a logic-level type that can be fully turned on (Rdson specified at a Vgs equal or less than the PIC voltage).

You could also use an NPN (2N4401) in place of an N-MOSFET to drive the P-MOSFETs.

Don't know why the P-MOSFET burned out. :confused:
 

Sensacell

Joined Jun 19, 2012
2,449
You seem to have a lot of logic going on - from all the other inputs.

I recommend simplifying the circuit so the PIC does all the logic- that way you don't have to worry about re-wiring if you want to change the logic of how it works, it's ALL just code.

Just use two resistors to make a voltage divider for the 12 V logic inputs, a 1/3 divider would be about right.

Drive the P-FETs with this simple circuit:

hi.jpg
It's the basic high-side switch, using a P-FET. This gives you a 12 V gate signal, so you can use almost any power FET.
The diode clamps any negative voltage (ESD) on the output, protecting the FET.

Your original circuit has the source and drain flying off the board, this makes protecting the FET from ESD difficult.
 

crutschow

Joined Mar 14, 2008
23,487
Using P fet the gate should go low to get the fet in conductance.
but the zmp ( drawing hard to see) seems to be not doing his job
I enclosed a working schematic as used by me (PWM backlight display).
Doubt you used it as shown.
The top FET is labeled NMOS but it's shown as PMOS (which is correct).
Also the source and drain are connected backward (source goes to VDD).
 

Thread Starter

Svizoman

Joined Oct 23, 2016
8
You seem to have a lot of logic going on - from all the other inputs.

I recommend simplifying the circuit so the PIC does all the logic- that way you don't have to worry about re-wiring if you want to change the logic of how it works, it's ALL just code.

Just use two resistors to make a voltage divider for the 12 V logic inputs, a 1/3 divider would be about right.

Drive the P-FETs with this simple circuit:

View attachment 126422

It's the basic high-side switch, using a P-FET. This gives you a 12 V gate signal, so you can use almost any power FET.
The diode clamps any negative voltage (ESD) on the output, protecting the FET.

Your original circuit has the source and drain flying off the board, this makes protecting the FET from ESD difficult.
diagram .JPG

Do I need a diode since this dual mosfet allredy has this inside?
mosfet.JPG
 

Thread Starter

Svizoman

Joined Oct 23, 2016
8
Yes- the internal zener only protects the G-S junction, the Drain can still go to a negative over voltage.
Problem is that I am unable to connect diode between light bulb positive and negative. In order to do that I'll have to rearange wiring. There goes power line to the headlight and whole headlight is grounded localy.
 

Sensacell

Joined Jun 19, 2012
2,449
Following PCB traces to figure out a schematic is not for me.

Your statement about not being able to connect the diode is incorrect- your circuit MUST have a ground to function, it's electrically the same as "lightbulb ground"

Just connect the diode to circuit ground- on your board.

The board power input has a ground, which connects to vehicle ground.
 
Top