Using IRF5305 E-Switch Module to control speed of motor with Arduino-IRF5305 Example 3/3

Project Video
Project Details

This article is on how to use the E-Switch module based on IRF5305 MOSFET module. This module can act as a switch and can be controlled as motor speed controller. All aspects of this module has been explained in the provided video at 3 different codes has been provided for different usage of this. Also we have tested the module to see how much current it can handle under HIGH (24V) and at Low (5V).

Image above shows Mosfet used as switch.

Image above shows MOSFET used to control a load connected at Drain pin.

Image above shows MOSFET used to control a load connected at Source pin.

Schematic diagram of E-Switch based on IRF5305 Mosfet

Schematic diagram of E-Switch based on IRF5305 Mosfet

See Basic Code to keep the IRF5305 Module always ON with Arduino -IRF5305 Example 1
See This Code turns IRF5305 Module ON and OFF for 3 seconds with Arduino -IRF5305 Example 2

Project Code

 * This is Arduino Sketch for Tutorial video 
 * explaining the 5305 MOSFET used as switch 
 * This sketch will control speed of a motor or intensity of light using PWM
 * Written by Ahmad Shamshiri on Sep 12, 2018 at 23:23 in Ajax, Ontario, Canada
 * For
 * Watch instruciton video for this code:
 * This code is "AS IS" without warranty or liability. Free to be used as long as you keep this note intact.
int motorPin =9;// pin to connect to motor module
int mSpeed = 0;// variable to hold speed value
int mStep = 15;// increment/decrement step for PWM motor speed
void setup() {
  // demo
  pinMode(motorPin,OUTPUT);// set mtorPin as output
  Serial.begin(9600);// initialize serial motor
  Serial.println("Robojax Demo");


void loop() {
  //  tutorial

analogWrite(motorPin, mSpeed);// send mSpeed value to motor
    Serial.print("Speed: ");
    Serial.println(mSpeed);// print mSpeed value on Serial monitor (click on Tools->Serial Monitor)
  mSpeed = mSpeed + mStep;
  // See video you for details.
  if (mSpeed <= 0 || mSpeed >= 255) {
    mStep = -mStep;


Required File(s)

If you found this Arduino course helpful, please support me so I can continue creating content like this. support me via PayPal