Mosfet turns off after a short while, Im at a total loss right now.

Hey.
So this project I'm working on, Has a Mosfet gate that's controlled through a high side switch and an attiny. The thing wrong is, The MOSFET turns on when i connect the batteries to the circuit, But turns off after a short while.
Things I've done:

  1. Thought it was a voltage issue, But the charge pump shows a constant 13V output.
  2. Thought it was a MOSFET issue, took it out, tested it, It's working perfectly.
  3. Thought it was a microcontroller issue, so connected an led with the pin driving the high side switch, it lights up perfectly.
    I can't figure how to measure gate voltage, because every time i connect the multimeter probes to the gate and some ground, the gate charges up and turns on. The interesting thing is it almost feels like a capacitor, ( which MOSFETs basically are ) , when it turns off after a while, I can disconnect the battery and reconnect it and the mosfet turns back on for a short while, almost proportional to the time i kept it disconnected.
    least of my problem, the battery display shows 0% just as soon the relay turns on, even when theres no short or even a minute voltage drop across the batteries,it could be that the module is faulty. But i have a much much bigger problem above.
    heres my circuit.
    One more thing ive forgot to mention, theres some sort of leakage when i have the attiny disconnected, a very faint amount of current flows throw the converters and turns on the onboard led of the buck converter with a really low brightness.

I stared at your schematic for a good couple of minutes. Still i'm having problems understanding what you are trying to do.

Please re-orient your parts so it's readable.

Schematics go from left to right (signal flow). Positive voltage on top, ground on the bottom.

Here's a good guide on what you should strive to do.

// Per.

That mosfet driver circuit is just plain wrong, there is no voltage source.

The charge pump does nothing as shown. Diodes in series just add voltage drop.

As shown, you’ll likely destroy the output of the attiny since there is no current limiting resistor in series with the base of the 2N2222.

As already mentioned, the schematic in general is incomprehensible.

Hi,
Can you explain what you are aiming to do with your project please?

A more logical layout will help with your circuit diagram, start within a gnd wire across the bottom of the diagram and work from there.

Tom..... :slight_smile:

Im really having a hard time with drawing schematics, im a total beginner in this case. So i checked my circuit and the collector of the b772 IS connected to the positive line of the voltage doubler. The voltage doubler works fine. Now im torn between doing this whole circuit draw again or fix my mistakes here and getting help.

One more thing,

Zapro:
Here's

// Per.

thanks, but the attiny has outputs and also inputs, so where do i put it?
In light of the video, The 12V , battery, 5V line go on the left most. Then comes the Charge pump , then the high side driver and then the mosfet connecting to load and ground.

But where do i put the relay logic system? in essence its also in the middle with the charge pump, but its work is more similler to the mosfet. And what do i do with all these many wires overlapping eachother? isnt it a hindrance? should i use different colours for wires that overlap but dont connect?

TomGeorge:
Hi,
Can you explain what you are aiming to do with your project please?

A more logical layout will help with your circuit diagram, start within a gnd wire across the bottom of the diagram and work from there.

Tom… :slight_smile:

Hi

The basic thing im trying to do is,

The attiny switches off the mosfet when a certain voltage threshold is met.
The relay functions on its own.

I dont have access to neither logic level mosfets or always active 12V source, hence the charge pump to provide just enough voltage and current for the mosfet gate, as the mosfet has to switch large current from its drain to source ( or source to drain ?) , hence a low side switch is not an option.

and then step up and step down the voltage as necessary !

simple enogh… i guess, or was simple when i thought of this.

WattsThat:
That mosfet driver circuit is just plain wrong, there is no voltage source.

The charge pump does nothing as shown. Diodes in series just add voltage drop.

As shown, you’ll likely destroy the output of the attiny since there is no current limiting resistor in series with the base of the 2N2222.

As already mentioned, the schematic in general is incomprehensible.

the voltage pump works fine, its the schematic thats wrong. the collector of the pnp connects to the charge pump positive line.

Theres 1k ohm resistance between the pin and base… another mistake.

Should i start from scratch, again?

okay, after a few hours of checking, I replaced the high side driver with a bjt push-pull driver, which i wonder why i didn't do at the first place. I didn't knew it ran on reverse logic, so almost when i had no hair left to pull, I accidentially touched the base to ground and it turned on, so i changed my code accordingly. Turns out, the driver was okay in the first place. The thing wrong is the charge pump sigh , i dont know whats wrong, but it was the very first thing i assembled and tested for a constant 13V output, but now somewhy it only charges up to a few points above 5V and then discharges to 3V and thats when the mosfet turns off. But i can swear it rose to 13V and stayed even with a 2K ohm resistor as load.

SO now i can think of two options,

  1. The 20mA ( i have 250 ohm resistance in place ) from the io pin cant drive the charge pump efficiently, so i have to make another high side driver or more preferably a bjt push pull as a high side switch. ( i would need to change a whole bunch of things to make a simple transistor low side switch, so in total, push-pull is easier )

  2. make yet another push-pull driver to use as a not gate ( BJT push-pull is a quite handy thing i learned tbh ) and implement it like this
    OR, 3.charge the gate through 1k resistor so the voltage doesn't fall as fast.
    But these are just assumptions, I don't know for sure even if I'm going in the right direction.

I decided not to make a whole schematic again without properly understanding the process of doing it, and i think its pretty safe to say the other components of the circuit works fine.