Fork me on GitHub

Project Notes

#286 SwitchPowerNFET

Low-side n-channel MOSFET switching of large loads with a microcontroller.

Build

Notes

The LEAP#66 SwitchNFET project demonstrated basic n-channel enhancement mode switching.

This is a common variation, where the gate control (switching) voltage is much lower than the voltage across the switched load. For example, using a 5V Arduino to switch a 24V load.

The standard configuration in such cases is low-side switch - where the MOSFET source is at the same voltage as the switching circuit ground.

The switching circuit will then toggle the MOSFET gate voltage between its high and low levels (say 0V and 5V for a 5V Arduino). But the voltage on the load side can be much higher.

The primary consideration is to ensure that the switching circuit voltage is large enough to turn the MOSFET hard on. This depends on the particular FET gate threshold voltage (Vgs) which will be listed in the datasheet.

In this example, I’m using an IRF3205 n-FET which has a Vgs of 2.0 to 4.0V. So a 5V switch circuit should be able to drive it hard on and off without any trouble.

IRF3205-Vds-Id-Vgs

Demonstration

As an example load, I am simply switching a series of LEDs with a 12V power supply.

The SwitchPowerNFET.ino sketch simple toggles the gate voltage every 5ms (i.e. at 100Hz). Since I’m using an Arduino Uno, the gate voltage will switch between 0V and 5V.

Performance

The first scope trace compares Vgs and Vds. With a LED load we get a little bit of a “soft-landing” when switching off.

  • CH1 (yellow): Vgs, offset -6V
  • CH2 (blue): Vds

scope-Vgs-Vds

To measure the current and to verify hard switching, this trace shows the voltage across the resistor:

  • when off, Vr = 0V
  • when on, Vr is approximately 1.4V, for a current of 1.4mA

scope-Vr

With a pure 10kΩ resistive load, it’s easier to see the hard on/off control.

  • CH1 (yellow): Vgs, offset -6V
  • CH2 (blue): Vds

scope-10k-load

Construction

Breadboard

Schematic

Build

Credits and References

About LEAP#286 MOSFETArduino

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics projects - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader