TC4420 driving a P-Channel mosfet

Hi, i just received some pcbs which are for a project i am doing.
On the 12v input ( from a lead acid battery ) there is a fuse, then a p channel mosfet that cuts the power when it drops too low.
The mosfet is being controlled by a tc4420 driver that is connected to an atmega328p.
For starting the circuit, i have a bypass switch that connects the drain of the mosfet to the input, and then i have the microcontroller switch on the mosfet and the circuit continues.
I tested this and everything worked, except this. It is wired correctly, i have double checked everything and i cannot get it to work. The mosfet is always on no matter what i do and i cannot figure out why this happens. When i connect power from my power supply ( current limited to 100ma ), the board immediately starts. Please help.

Sim_vaga.ino (7.53 KB)

Where is the byoassing switch?

Well, I'm confused because it looks like your sketch has the polarity of D6 backwards. The TC4420 is non-inverting, and the mosfet is a P-channel, so I think you would need D6 to go low to turn on the mosfet, and high to turn it off. If it stays on without the button being pressed, then I don't understand how that could be since the first thing your sketch does is bring D6 high.

But with respect to it powering up when you connect power, I suspect the problem is that when you first power up, D6 is at ground. That's because there is a protection diode from D6 to the 328P's Vcc pin, which is at ground when the chip is powered down. So when you connect the power source, with D6 at ground, the driver output goes low, and the mosfet is turned on. Again, that's based on my interpretation of how the on/off polarity works.

If that's the problem, the simplest solution might be to switch to the inverting version of the driver. An alternative would be to replace the driver with an NPN transistor driven by D6 through a base resistor, and add a pullup resistor and capacitor on the mosfet gate. That way, D6 would have to source current into the NPN to turn on the mosfet, which it can't do when the 328P is powered down.

See if adding a 10k between the Gate and Source has any effect.


You should have added decoupling (.1uF ceramic) on all I.C. +5v pins to GND.

Assume the off board LED has a series dropping resistor.

Railroader:
Where is the byoassing switch?

It is connected with 2 male pins to the board. It is not shown as a switch, but as 2 pins on the schematic at position H3 next to the mosfet.

ShermanP:
Well, I'm confused because it looks like your sketch has the polarity of D6 backwards. The TC4420 is non-inverting, and the mosfet is a P-channel, so I think you would need D6 to go low to turn on the mosfet, and high to turn it off. If it stays on without the button being pressed, then I don't understand how that could be since the first thing your sketch does is bring D6 high.

But with respect to it powering up when you connect power, I suspect the problem is that when you first power up, D6 is at ground. That's because there is a protection diode from D6 to the 328P's Vcc pin, which is at ground when the chip is powered down. So when you connect the power source, with D6 at ground, the driver output goes low, and the mosfet is turned on. Again, that's based on my interpretation of how the on/off polarity works.

If that's the problem, the simplest solution might be to switch to the inverting version of the driver. An alternative would be to replace the driver with an NPN transistor driven by D6 through a base resistor, and add a pullup resistor and capacitor on the mosfet gate. That way, D6 would have to source current into the NPN to turn on the mosfet, which it can't do when the 328P is powered down.

The problem is that the mosfet does not turn off. I cannot control it. It is always on. I thought about connecting a pnp bjt instead of the mosfet and have it get driven by the tc4420. The current consumption is less than 100ma but i added a power mosfet because i did not want the transistor to get hot. Do you think the pnp transistor idea would work?

larryd:
See if adding a 10k between the Gate and Source has any effect.


You should have added decoupling (.1uF ceramic) on all I.C. +5v pins to GND.

Assume the off board LED has a series dropping resistor.

The led does have a resistor. It draws 11ma when supplied with 5v. As for the capacitors, i did not think of that. I added a 6.8k resistor instead of 10k and it did not do anything. Thank you for the suggestions.

I soldered in a pnp transistor instead of the mosfet and it did nothing. I think i need to buy the tc4429 and replace the driver chip.

Can you answer my question about the polarity of D6 in your code? When the power is on, what is the voltage on D6, and on the mosfet gate?

But yes, I think the TC4429 is the right driver to use with a P-channel mosfet.

ShermanP:
Can you answer my question about the polarity of D6 in your code? When the power is on, what is the voltage on D6, and on the mosfet gate?

But yes, I think the TC4429 is the right driver to use with a P-channel mosfet.

Voltage input from power supply: 14.5v (simulating a full charge)
Pin D6 voltage: 5v
Gate voltage: 12v
Drain voltage 12v

Pin D6 voltage: 0v
Gate voltage: 0v
Drain voltage: 14.5v

I think the voltage for turning off the mosfet needs to be vin*-1.
D6 is the pin for controlling the driver, not a diode. Sorry for the confusion and thank you for helping me out.

HobbyMen:
Voltage input from power supply: 14.5v (simulating a full charge)
Pin D6 voltage: 5v
Gate voltage: 12v
Drain voltage 12v

Pin D6 voltage: 0v
Gate voltage: 0v
Drain voltage: 14.5v

I think the voltage for turning off the mosfet needs to be vin*-1.
D6 is the pin for controlling the driver, not a diode. Sorry for the confusion and thank you for helping me out.

OK, first, the TC4420 has to be powered at the same voltage as the source of the mosfet. So its Vdd has to be connected to your 14.5V VCC supply at P2, not to the "12V" drain. With D6 at 5V, which is supposed to be "off", the gate needs to be close to 14.5V to keep the mosfet off. But you've got the driver output at 12V, which is 2.5V below the source, which is probably the GS threshold voltage, so the mosfet stays on. If you power the driver from the 14.5V, its output will also be 14.5V, or very close to it, when D6 is 5V, and the mosfet will stay off. Sorry I didn't notice that before.

If you make that change, and change to the TC4429, your code should be right, and it should all work.

Hi,
Q2 is P-CH but you have it drawn wrong way around.
This where symbols like MOSFETS need D, S and G labels.

pch.jpg
Tom.. :slight_smile:

pch.jpg

larryd:
See if adding a 10k between the Gate and Source has any effect.


You should have added decoupling (.1uF ceramic) on all I.C. +5v pins to GND.

Assume the off board LED has a series dropping resistor.

Also nice to decouple the LMs as per LM datasheet 0.1 at input 0,33 output
nice work tom.

TomGeorge:
Hi,
Q2 is P-CH but you have it drawn wrong way around.
This where symbols like MOSFETS need D, S and G labels.

pch.jpg
Tom.. :slight_smile:

It is correctly drawn. 12v is the output of the mosfet and vcc is the input from the battery.

ShermanP:
OK, first, the TC4420 has to be powered at the same voltage as the source of the mosfet. So its Vdd has to be connected to your 14.5V VCC supply at P2, not to the "12V" drain. With D6 at 5V, which is supposed to be "off", the gate needs to be close to 14.5V to keep the mosfet off. But you've got the driver output at 12V, which is 2.5V below the source, which is probably the GS threshold voltage, so the mosfet stays on. If you power the driver from the 14.5V, its output will also be 14.5V, or very close to it, when D6 is 5V, and the mosfet will stay off. Sorry I didn't notice that before.

If you make that change, and change to the TC4429, your code should be right, and it should all work.

Thanks. I ordered some tc4429 drivers and when they arrive i will test this. Also the 12v net in the schematic is for easier understanding. It is connected through the mosfet to the input from the battery.

Hi,

pchedit.jpg
These sort of diagram may be okay for PCB layout, but are a pain when it comes to troubleshootng.
I call then "search-a-word" diagrams.
These circuits don't show the loads or any of the input and output devices the circuit is connected to.

Tom... :slight_smile:

pchedit.jpg

HobbyMen:
I ordered some tc4429 drivers and when they arrive i will test this. Also the 12v net in the schematic is for easier understanding. It is connected through the mosfet to the input from the battery.

Ok. Just to be clear, this is what I'm suggesting.

ShermanP:
Ok. Just to be clear, this is what I'm suggesting.

Thanks for the clarification. I should receive the drivers in a few days and will test this. Thank you to everyone for your help! It is much appriciated!

There is still some chance that your circuit will power up when you first connect power at J2. D6 should be low, but there may be some delay in bringing the driver's output pins high when it is first powered up. I'm not sure what the best solution would be for that. The simplest would be to just manually turn it off however you normally would. But after that it should work normally. Or you could build in some delay at the beginning of your code before you bring D6 high.

I think you will also need a pulldown resistor on D6 to make sure it stays low unless the processor is powered up and your code brings D6 high. 100K would be plenty.

ShermanP:
There is still some chance that your circuit will power up when you first connect power at J2. D6 should be low, but there may be some delay in bringing the driver's output pins high when it is first powered up, particularly with the 220uF capacitor on Vdd. I'm not sure what the best solution would be for that. The simplest would be to just manually turn it off however you normally would. But after that it should work normally. Or you could build in some delay at the beginning of your code before you bring D6 high.

I think you will also need a pulldown resistor on D6 to make sure it stays low unless the processor is powered up and your code brings D6 high. 100K would be plenty.

The pin D6 immediately turns high when the circuit receives power, but is otherwise low. There is a bypass switch on the mosfet for me to manually start the circuit and then it can control itself. The mosfet is there to cut the power if the voltage on the battery gets too low. There is a voltage divider that connects to A0 and measures the voltage. When it gets too low it sends an sms to a number and shuts off.
(everything i mentioned is either true now, or will be added to the code when i fix the driver issues)

“ but is otherwise low”

Or at power up ‘nothing’ or ‘tristate’ or ‘floating’ or ‘indeterminate’.

larryd:
“ but is otherwise low”

Or at power up ‘nothing’ or ‘tristate’ or ‘floating’ or ‘indeterminate’.

I think it is internally connected to the gnd pin when not powered up or set to LOW. I am not sure about this.