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
- Operating Voltage: 5v
- Interface type: Gravity 3-pin digital sensor interface
- Dimension: 52 * 27 mm
- Weight: 40 g
Tutorial
We will use Arduino to control module speed.
Requirements
- Hardware
- DFRduino UNO R3 x1
- IO Expansion Shield for Arduino V7.1 x1
- 130 DC motor module x1
- Software
- Arduino IDE Version 1.6.5 Download Arduino IDE
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. |
---|