Skip to main content

Controlling an actuator with a N-channel Mosfet

What is Mosfet?

A MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor) is a type of transistor used to switch or amplify electrical signals in electronic devices. It’s one of the most common components in electronic circuits, especially in digital and analog systems.

Structure

A MOSFET has three main terminals — Gate, Drain, and Source. The Gate is separated from the channel by a thin insulating layer of silicon dioxide (SiO₂).

Operation

A small voltage applied to the Gate controls the current flow between the Drain and Source terminals. By adjusting this voltage, the MOSFET can act as a switch (turning the current on or off) or as an amplifier (controlling the level of current flow).

Types

There are two main types of MOSFETs, we will be using a N-channel Mosfet in this tutorial.e

  1. N-channel MOSFETs: These conduct when a positive voltage is applied to the Gate relative to the Source.
  2. P-channel MOSFETs: These conduct when a negative voltage is applied to the Gate relative to the Source.

Wiring

  1. Source (S) to GND
  2. Drain (D) to actuator(-) & to diode(-)
  3. Gate (G) to GND via 1k resistor & to Pin 13
  4. Power Supply(+) to actuator(+) & diode(+)
  5. Power Supply(-) to GND

mosfet.png

Basic Example

This basic example is effectively the blink sketch, the TinkerKit Mosfet operates just like any other digital device.

#define actuatorPin 13
    
void setup() {
      pinMode( actuatorPin, OUTPUT );
    }
    
void loop() {
      digitalWrite( actuatorPin, HIGH );
      delay( 1000 );
      
      digitalWrite( actuatorPin, LOW );
      delay( 1000 );
    }