Gravity__130_DC_Motor_SKU__DFR0411-DFRobot

DFR0411 Gravity: 130 DC Motor Module

Introduction

Gravity 130 DC motor is a very interesting module, the module does not need additional motor driver board, you can use Arduino board to drive it easily. And the speed control could be realized with PWM signal. Very popular with DIY project.

Specification

Tutorial

We will use Arduino to control module speed.

Requirements

Connection Diagram

DFR0411 Gravity: 130 DC Motor Module Connection Diagram

Sample Code

Copy the sample code, and paste it in the Arduino IDE

    /* 130 DC Motor
     by DFRobot <https:www.dfrobot.com>

    */

    int motorPin = 3;   //Motor drive pin D3
    int motorSpeed;     //Define motor speed

    void setup()
    {
      Serial.begin(9600);
    }

    void loop()
    {

      for(motorSpeed = 0 ; motorSpeed <= 255; motorSpeed+=5)
      {
        analogWrite(motorPin, motorSpeed);   //PWM speed control
        delay(30);
      }
      for(motorSpeed = 255 ; motorSpeed >= 0; motorSpeed-=5)
      {
        analogWrite(motorPin, motorSpeed);   //PWM speed control
        delay(30);
      }
    }

FAQ

There are no questions about this product yet. If you have any problems or suggestions, you are welcome to email us or post on the DFRobot forum!

For any questions/advice/cool ideas to share, please visit the DFRobot Forum.

More Documents