The Hobby Gearmotor with a 48:1 gearbox is a small, efficient, and reliable DC motor that is ideal for hobbyists and professionals alike. It is designed to provide high torque at low speeds, which is perfect for robotics, automated projects, and any application where precise motion control is required.
Pin Number | Description | Notes |
---|---|---|
1 | Motor + (Vcc) | Connect to positive power supply |
2 | Motor - (GND) | Connect to ground |
#include <Arduino.h>
// Define motor control pins
const int motorPin1 = 3; // Motor pin connected to Arduino's pin 3 (PWM)
const int motorPin2 = 4; // Motor pin connected to Arduino's pin 4
void setup() {
// Set motor control pins as outputs
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
}
void loop() {
// Spin motor clockwise
analogWrite(motorPin1, 128); // Set speed (0-255)
digitalWrite(motorPin2, LOW);
delay(2000); // Run for 2 seconds
// Stop motor
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
delay(1000); // Stop for 1 second
// Spin motor counterclockwise
digitalWrite(motorPin1, LOW);
analogWrite(motorPin2, 128); // Set speed (0-255)
delay(2000); // Run for 2 seconds
// Stop motor
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
delay(1000); // Stop for 1 second
}
Q: Can I run the motor directly from an Arduino pin? A: No, the Arduino pin cannot supply enough current. Use a motor driver.
Q: What is the maximum load I can put on the motor shaft? A: The maximum load depends on the torque rating. Exceeding 2 kg-cm at 6V may cause damage.
Q: How can I reverse the motor's direction? A: Reverse the polarity of the motor's power connections, or use an H-bridge motor driver.
Q: Can I use PWM to control the motor speed? A: Yes, PWM can be used to control the speed effectively.
Q: How do I mount the motor to my project? A: Use the mounting holes on the gearbox to secure the motor with screws.