KRAKKUS.COM



Push-pull MOSFET gate driver

A schematic diagram shows a microcontroller circuit with GPIO pins, Vcc, and GND lines connected by wires.

Driving a MOSFET directly from a microcontroller can be a burning for the IO pin, especially when doing PWM, and even more when frequency goes up.

To combat that we can use this little circuit, a push-pull configuration using transistors. They handle the current and your IO pin stays safe.

Breadboard

Two white electronics prototyping breadboards sit on a flat surface, appearing clean and undamaged. A brass component with parallel metal plates on a black surface, possibly a heatsink or air cooling system.

The breadboard I will use for this example, always nice to know what we are working with.

The MOSFET

A small MOSFET IC with two legs soldered together, featuring pins on one end and etched text on its side.

This MOSFET is the 6035AL logic level MOSFET, I got it from AliExpress. Even with 3.3V at it's gate it can already switch 30A.

Bicycle light

A breadboard with electronic components and an unlit LED is shown on a green wire. An electronics breadboard with a small IC, resistors, and jumper wires is shown. A breadboard with an IC module and jumper wires, likely for prototyping an electronic circuit.

This light bulb does not consume 30A, that would make for a very bright light, and impossible to photograph or film.

These were used on bicycle headlights many years ago before LEDs became cheap enough.

This is a low side switching circuit, so one wire to the bulb goes into the positive power rail, and the other into the drain pin of the MOSFET.

That pin, when the MOSFET is on, connects to the source pin.

From there we connect to ground to complete the circuit.

Bottom transistor Q1

A PNP transistor rests on graph paper with multiple leads and unclear markings. A handwritten study note with circuit diagrams and component labels, featuring PNP transistors and incorrect

This is a PNP transistor. When the voltage at the base is lower than that on the emitter, It will start conducting. That will make the MOSFET's gate voltage - that is connected to the emitter pins of both transistors - drop to ground.

I always draw the pinout and schematic to a piece of paper because somehow, I easily get the pins mixed up and burn the transistors when testing.

Top transistor Q2

A small integrated circuit (IC) with multiple pins on a grid-patterned surface is shown. A handwritten math problem on lined paper with blank spaces for answers.

This is a NPN transistor. If we raise the voltage at the base to a higher voltage than is at the emitter, then it will start to conduct. Raising the MOSFET's gate voltage - still connected to the shared emitter pins - to VCC.

Together they make this a voltage follower, where the transistors take a small signal and turn it into a higher current driver.

Transistor pinout

An electronic project on a breadboard with various components and wires laid out for assembly.

When placed on the breadboard, the NPN and PNP transistors are not oriented in the same direction. And this is why I draw them on paper first, I never get them right the first time.

VCC and ground

A breadboard setup with components and jumper wires, featuring an op-amp IC chip and blue resistors. An electronic breadboard with components and jumper wires, featuring a green connection point and IC chip.

Transistor Q2 needs a connection to VCC, so it can power the gate of the MOSFET.

And transistor Q1 needs a connection to ground, to be able to turn it off again.

Please note that because they are transistors, they will never be conducting at the same time when controlled with the same signal. If these were MOSFETs, that would be a serious issue.

Want to know more about this? Let met know!

Gate resistor R1

A MOSFET transistor with blue silicone coating sits next to a low-value resistor on a marked surface. A low-value resistor on an electronic breadboard prevents ringing at a MOSFET gate when switching at high PWM

This is a low value resistor (100 ohms) to prevent ringing at the gate of the MOSFET. That becomes an issue when switching the MOSFET at a higher PWM frequency.

And because of the low value it can be very taxing on a microcontrollers IO pin. The peal current draw will be too high during switching. Which is why this circuit exists.

Logic input resistor R6

A small metal pin connector rests on grid-lined paper, with a flat top and bottom. A breadboard with electronic components and jumper wires, featuring resistors and LEDs connected to a power supply.

With the transistors in place and doing the heavy (current) lifting. We can now limit the current from the IO input to a safe level. We do this with a 1K ohms resistor.

Adding pins, power and signal

An electronics board with jumper wires, resistors, and capacitors surrounding an integrated circuit on a black surface. A breadboard with electronic components, jumper wires, and multimeters for testing a circuit. An Arduino microcontroller and various electronic components are mounted on a breadboard with resistors, diodes, and

The working circuit







Page generation time: 0.0098 seconds