กลับหน้าหลัก
views
How to Use Arduino FET Drive Module for Motor Control with PWM
Last updated on

How to Use Arduino FET Drive Module for Motor Control with PWM


How to Use Arduino FET Drive Module for Motor Control with PWM

The FET Drive Module (MOSFET Drive Module) is a power switching board that uses the IRF540 MOSFET. It supports 3.7-27V and up to 10A current, making it effective for driving small DC motors. The module accepts PWM signals from Arduino, allowing you to control motor speed as well as turn it on and off.

Circuit diagram showing Arduino UNO connected to FET Drive Module, 5V power supply, and DC Motor with labeled pins

Required Components

  • Arduino UNO R3 with USB cable
  • FET Drive Module PWM Switch Control Board (MOSFET IRF540)
  • 5V DC Power Supply (Adapter or Regulated Supply)
  • DC Motor 3-6V (vertical type)
  • Motor propeller
  • Jumper wires (M-M, M-F, F-F)
  • Breadboard MB-102 (optional for neat wiring)

Wiring the Circuit

The wiring is divided into 3 main sections.

1. Connect Arduino to FET Module

ArduinoFET Drive Module
Pin D5PWM pin
GNDGND

Pin D5 on Arduino is PWM-capable, sending a duty-cycle signal to control the MOSFET’s switching behavior.

2. Connect 5V DC Power Supply to the Module

5V Power SupplyFET Drive Module
Positive (+)DC+
Negative (−)DC−
Close-up comparison of DC+ and DC- terminal positions on the FET Module board with clear polarity labels

3. Connect DC Motor to the Module

DC MotorFET Drive Module
Red wire (+)OUT+
Black wire (−)OUT−

Attach the propeller to the motor shaft to clearly observe the rotation.

FET Module board with labeled pins: DC+, DC-, OUT+, OUT-, PWM, GND for easy identification

Arduino Code to Control Motor via Serial

The code below uses Serial Monitor to accept character commands. Send + to run the motor and - to stop it.

#define MOTOR_PWM 5   // Arduino PWM pin connected to FET Module PWM pin

void setup() {
  Serial.begin(9600);
  pinMode(MOTOR_PWM, OUTPUT);
  digitalWrite(MOTOR_PWM, LOW);  // Motor off at start

  Serial.println("+ to start motor");
  Serial.println("- to stop motor");
}

void loop() {
  if (Serial.available() > 0) {
    char command = Serial.read();

    if (command == '+') {
      digitalWrite(MOTOR_PWM, HIGH);
      Serial.println("Motor running");
    } else if (command == '-') {
      digitalWrite(MOTOR_PWM, LOW);
      Serial.println("Motor stopped");
    }
  }
}

How to use:

  1. Upload the code to Arduino UNO
  2. Open Serial Monitor (Tools → Serial Monitor)
  3. Set Baud Rate to 9600
  4. Type + and click Send → motor spins
  5. Type - and click Send → motor stops

Adjusting Motor Speed with PWM

If you want to vary speed instead of just on/off switching, replace digitalWrite with analogWrite using values from 0-255.

analogWrite(MOTOR_PWM, 128);  // 50% PWM duty cycle, motor runs at half speed

For example, to make the motor speed increase or decrease based on values sent via Serial, you can extend the code accordingly.

Important Notes

  • Connect the 5V DC power supply directly to the DC+ / DC- terminals of the Module. Do not use the 5V pin on Arduino for motor power, as the current is too high and may damage the board.
  • Always double-check the polarity before powering on.
  • If using a motor that requires higher voltage, use an appropriate power supply matching the motor’s specifications.

Reference Video

https://www.youtube.com/embed/0e6QjdzZCR8

อยากทำโปรเจคแบบนี้?

รับทำโปรเจค Arduino / IoT จบงานไว ส่งงานครบ พร้อมสอน

If you need Arduino project service or urgent IoT development, see full service details on the home page

จ้างทำโปรเจคเลย

Project estimate

Want something like this? Open the estimate page.

The long form is now on a separate estimate page, so this article stays clean.

ความคิดเห็น

รีวิวจากคนใช้งานจริง

รีวิวจากลูกค้าและคนที่เคยใช้งาน

ถ้าเคยสั่งงาน เคยอ่านหน้านี้แล้วได้ประโยชน์ หรือมีข้อเสนอแนะ ฝากรีวิวไว้ได้เลย

กำลังโหลดรีวิว...