KRAKKUS.COM

How to Drive a Low-Side MOSFET with Arduino/ESP32

By far, the easiest way to switch a load on and off is to drive a MOSFET directly. This can be from a microcontroller or any other source that produces a logic high or low signal.

When driving a MOSFET directly from a 3.3V ESP32 or 5V Arduino, you must use a Logic Level MOSFET like the 6035AL used in this guide. Standard MOSFETs often require 10V at the gate to fully turn on, which a microcontroller cannot provide.

Why Use a Low-Side Switch Configuration?

In electronics, low-side switching is the most common way to control high-power loads like motors, LEDs, or heaters using a microcontroller. In this setup, the MOSFET is placed between the load and the ground (GND).

While this configuration is highly efficient, remember that the load is always "hot" (connected to VCC). The switching happens on the return path to ground, which is the standard approach for most DC power control applications.

MOSFET Low-Side Switch Schematic

Simple Low-Side N-Channel MOSFET Switch Schematic for Microcontrollers

This circuit is just that. There are only a few components needed to make it work.

The load

MOSFET driver circuit turns load on, 6V bulb at 0.3A, 2W max Bicycle light bulb load, 6V, 0.3A, 2W, suitable for breadboard experimentation Breadboard load circuit with 6V, 0.3A bicycle light bulb and MOSFET to ground, turning load on Bicycle light bulb load for breadboard experiment: 6V, 0.3A, 2W Small bicycle light bulb load (6V, 0.3A, 2W) for breadboard experiment

Small bicycle light bulb (6V, 0.3A) used as load for breadboard experiment Bicycle light bulb load for breadboard experiment

First, we need a load. I will use a very small bicycle light bulb, 6V at 0.3A, so 2 WATT at most, perfectly suitable for a breadboard experiment.

If I were to use a big light bulb, it would be very bright, and I would not be able to take good pictures or video of it.

It needs 2 wires, the order does not matter. With a bit of flux and quick soldering, we can actually solder the wires to the metal without destroying the bulb itself.

Then with a bit of heat shrink tube I made it a bit more appealing. In hindsight, the wires are a bit too long, might shorten them for the other articles in this series.

Finally, a bit of solder on the ends so I can put them in a breadboard.

Breadboard

Breadboard with MOSFET module for prototyping circuits

I will use a short breadboard for this, on the right side of the image you can see the underside of the board. Those metal strips are U shaped, so from the top you can insert the components legs and if they are in the same strip, they will connect.

Choosing an N-Channel MOSFET for Low-Side Switching

Breadboard MOSFET insertion with bent legs for visibility, 6035AL logic level MOSFET

I inserted the MOSFET into the board, with the legs of it bent a bit outward, so we can better see what's connected to it.

Looking at the previous image, we can also see that each leg is in its own metal connection strip.

The MOSFET itself is the 6035AL logic level MOSFET. Even with 3.3V at its gate it can already switch 30A.

While the 6035AL can handle high current, remember that breadboards are limited. For loads over 5A, you should move from a breadboard to a PCB or soldered prototype to avoid melting the plastic.

From VCC to ground

MOSFET switch controls 30A DC motor from 2 rails MOSFET switch controls 30A at 3.3V gate, power bulb from top rails

From left to right, the pins of the MOSFET are gate, drain and source.

I want to power the bulb from the 2 rails at the top of the board.

So, to follow the circuit, the positive rail goes into the bulb, and the other end into the drain of the MOSFET.

If the MOSFET is on, that drain pin connects to the source pin.

MOSFET drain connects to source pin via black wire, completing circuit when MOSFET is on

With that black wire, the source pin goes back to the negative rail of the board. Making the circuit complete (if the MOSFET is on of course).

Crucially, ensure your microcontroller ground is connected to the power supply ground. Without a common ground, the logic signal has no reference, and the MOSFET won't switch correctly.

Power supply

Power supply module with variable supplies and constant 5V connection Complete circuit requires MOSFET on, external power supply connects via separate header pins to constant 5V supply Electronic breadboard with variable supplies and constant 5V power supply Breadboard circuit with FET using separate header pins for external power supply, constant 5V supply powers bulb Multimeter with variable supplies showing zero volts, constant 5V supply powering bulb

I use separate header pins to connect the board to an external power supply.

It shows zero volts, those are the variable supplies. But I have it plugged into the constant 5V supply at the most right connectors, those are always on and 5V is enough to get the bulb glowing.

Gate resistor

Breadboard circuit with 220 Ohm gate resistor for MOSFET protection and PWM input Blue LED with 220 Ohm gate resistor for MOSFET protection Breadboard circuit with 220 Ohm gate resistor protects MOSFET logic signal Breadboard circuit with 220 Ohm gate resistor protects MOSFET logic signal provider and gate from damage

We need a resistor to protect the logic signal provider AND the gate of the MOSFET. Nothing special or high frequency is going on, so I just use a generic 220 Ohm resistor. That will keep both safe.

PWM input

Portable radio with frequency selection and channel settings, connected to antenna and charging base Breadboard PWM input module with 220 Ohm resistor for safe signal conditioning Breadboard circuit with 20 Ohm resistor for safe PWM input control of three LEDs in sequence Portable radio with FEE branding and digital display for status indicators and controls AFE PWM input module with LED indicator and adjustable duty cycle control Electronics experimentation setup with oscilloscope, multi-meter, breadboard, and various components

Now with the signal generator connected to the gate of the MOSFET and the source (which is also ground), we can now play with the duty cycle of the PWM signal.

And we can now see that the bulb indeed changes brightness when changing the duty-cycle.







Page generation time: 0.0087 seconds