Stufin
Home Quick Cart Profile

High Speed DC Toy Motor with Fan (2pcs)

Buy Now on Stufin

Pin Configuration

  • High Speed DC Toy Motor with Fan (2pcs) Documentation
  • Pin Description:
  • The High Speed DC Toy Motor with Fan comes with two motors, each having 2 pins. The pins are not labeled explicitly, but they can be identified by their function. Below is a detailed description of each pin:
  • Motor Pin 1 ( Positive / Red Wire ):
  • Function: Positive Power Supply (VCC)
  • Description: This pin is connected to the positive terminal of the DC power supply.
  • Connection: Connect to the positive terminal of a DC power source, such as a battery or a DC adapter.
  • Motor Pin 2 ( Negative / Black Wire ):
  • Function: Negative Power Supply (GND)
  • Description: This pin is connected to the negative terminal of the DC power supply.
  • Connection: Connect to the negative terminal of a DC power source, such as a battery or a DC adapter.
  • Connection Structure:
  • When connecting the motor to a power source, ensure the correct polarity is observed to avoid damaging the motor. Follow the steps below:
  • 1. Identify the power source: Determine the DC power source you will be using, such as a battery or a DC adapter.
  • 2. Determine the polarity: Identify the positive (VCC) and negative (GND) terminals of the power source.
  • 3. Connect the positive wire: Connect the red wire (Motor Pin 1) to the positive terminal of the power source.
  • 4. Connect the negative wire: Connect the black wire (Motor Pin 2) to the negative terminal of the power source.
  • 5. Secure the connections: Ensure the connections are secure and not loose to prevent damage to the motor or power source.
  • Example Connection:
  • Suppose you are using a 3V DC battery as the power source. To connect the motor, follow these steps:
  • 1. Identify the power source: 3V DC battery
  • 2. Determine the polarity: Positive terminal (VCC) is the anode (+) and negative terminal (GND) is the cathode (-)
  • 3. Connect the positive wire: Connect the red wire (Motor Pin 1) to the anode (+) of the 3V DC battery
  • 4. Connect the negative wire: Connect the black wire (Motor Pin 2) to the cathode (-) of the 3V DC battery
  • 5. Secure the connections: Ensure the connections are secure and not loose
  • By following these steps, you can properly connect the High Speed DC Toy Motor with Fan to a DC power source and begin using it in your IoT project.

Code Examples

High Speed DC Toy Motor with Fan (2pcs) Documentation
Overview
The High Speed DC Toy Motor with Fan is a compact, high-performance motor designed for various IoT projects and applications. It features a built-in fan for cooling and is suitable for use in robotics, drones, and other small-scale systems. This documentation provides a comprehensive guide on how to use this component, including code examples in different programming languages.
Specifications
Operating Voltage: 3-6V DC
 Rated Current: 100-150mA
 Speed: 10000-12000 RPM
 Fan Size: 20mm x 20mm x 10mm
 Motor Size: 27mm x 12mm x 15mm
 Weight: 20g (each motor)
Pinout
The motor has three pins:
VCC (Red): Positive power supply pin
 GND (Black): Ground pin
 Signal (Yellow): Control signal pin (PWMed for speed control)
Code Examples
### Example 1: Arduino - Simple Motor Control
In this example, we will demonstrate how to control the motor speed using an Arduino board.
Hardware Requirements
Arduino Uno or compatible board
 High Speed DC Toy Motor with Fan (2pcs)
 Breadboard and jumper wires
Code
```c
const int motorPin = 9;  // Signal pin connected to digital pin 9
void setup() {
  pinMode(motorPin, OUTPUT);
}
void loop() {
  // Set motor speed to 50% (12000 RPM / 2)
  analogWrite(motorPin, 128);
  delay(1000);
// Set motor speed to 25% (6000 RPM / 2)
  analogWrite(motorPin, 64);
  delay(1000);
// Stop the motor
  analogWrite(motorPin, 0);
  delay(1000);
}
```
### Example 2: Raspberry Pi (Python) - Motor Control with PWM
In this example, we will demonstrate how to control the motor speed using a Raspberry Pi and Python.
Hardware Requirements
Raspberry Pi 3 or compatible board
 High Speed DC Toy Motor with Fan (2pcs)
 Breadboard and jumper wires
Code
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
motor_pin = 18  # Signal pin connected to GPIO 18
GPIO.setup(motor_pin, GPIO.OUT)
pwm = GPIO.PWM(motor_pin, 50)  # 50 Hz PWM frequency
while True:
    # Set motor speed to 50% (12000 RPM / 2)
    pwm.start(50)
    time.sleep(1)
# Set motor speed to 25% (6000 RPM / 2)
    pwm.start(25)
    time.sleep(1)
# Stop the motor
    pwm.stop()
    time.sleep(1)
```
### Example 3: ESP32 (MicroPython) - Motor Control with PWM
In this example, we will demonstrate how to control the motor speed using an ESP32 board and MicroPython.
Hardware Requirements
ESP32 DevKitC or compatible board
 High Speed DC Toy Motor with Fan (2pcs)
 Breadboard and jumper wires
Code
```python
import machine
import time
motor_pin = machine.Pin(18, machine.Pin.OUT)  # Signal pin connected to GPIO 18
pwm = machine.PWM(motor_pin, freq=50)  # 50 Hz PWM frequency
while True:
    # Set motor speed to 50% (12000 RPM / 2)
    pwm.duty(512)  # 10-bit PWM resolution (0-1023)
    time.sleep(1)
# Set motor speed to 25% (6000 RPM / 2)
    pwm.duty(256)
    time.sleep(1)
# Stop the motor
    pwm.duty(0)
    time.sleep(1)
```
Note: In the above examples, the motor speed is controlled using PWM (Pulse Width Modulation). The duty cycle of the PWM signal determines the motor speed. A higher duty cycle results in a higher motor speed.