3V 2000RPM High Speed DC Toy Motor (Pack of 25) Documentation
The 3V 2000RPM High Speed DC Toy Motor is a compact, high-performance motor designed for various IoT applications. With a speed of 2000 RPM and a voltage rating of 3V, this motor is suitable for robotics, DIY projects, and other applications where high speed and low voltage are required.
The motor has two terminals:
Positive (+) terminal: Connect to the positive power supply (3V)
Negative (-) terminal: Connect to the negative power supply (GND)
### Example 1: Basic Motor Control using Arduino
In this example, we will use an Arduino Uno board to control the motor. We will connect the motor to the Arduino's digital pin 9 and use the `analogWrite()` function to control the motor speed.
Arduino Uno board
3V 2000RPM High Speed DC Toy Motor
Breadboard and jumper wires
Arduino IDE (version 1.8.13 or later)
Code
```c
const int motorPin = 9; // PWM pin for motor control
void setup() {
pinMode(motorPin, OUTPUT);
}
void loop() {
// Set motor speed to 50% (1000 RPM)
analogWrite(motorPin, 128);
delay(1000);
// Set motor speed to 100% (2000 RPM)
analogWrite(motorPin, 255);
delay(1000);
// Stop the motor
analogWrite(motorPin, 0);
delay(1000);
}
```
### Example 2: Motor Control using Raspberry Pi and Python
In this example, we will use a Raspberry Pi board to control the motor using Python. We will connect the motor to the Raspberry Pi's GPIO pin 18 and use the `RPi.GPIO` library to control the motor speed.
Raspberry Pi board
3V 2000RPM High Speed DC Toy Motor
Breadboard and jumper wires
Raspbian OS (version 10 or later)
Python 3.x
RPi.GPIO library (version 0.7.0 or later)
Code
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
# Define motor pin
motor_pin = 18
GPIO.setup(motor_pin, GPIO.OUT)
# Set motor speed to 50% (1000 RPM)
GPIO.PWM(motor_pin, 50).start(50)
time.sleep(1)
# Set motor speed to 100% (2000 RPM)
GPIO.PWM(motor_pin, 50).start(100)
time.sleep(1)
# Stop the motor
GPIO.output(motor_pin, GPIO.LOW)
time.sleep(1)
```
These examples demonstrate the basic usage of the 3V 2000RPM High Speed DC Toy Motor in different contexts. You can modify the code to suit your specific application requirements.