Key features:

  • 0.35A - 0.40A
  • Operating voltage: 1V - 6V

Small motor for hobby/projects. Operates from 1V to 6V.

See full description
The product is not available for shipping to the selected country.

Description

Description

Project: DC Motor Control (Direction & Speed) with Arduino & L293D

In this project, we will learn how to drive a simple Toy Hobby Motor using the integrated circuit L293D.

Why do we need the L293D?

The Arduino cannot provide enough current to drive a motor directly from its pins (it will burn out!). The L293D acts as a "switch": it takes commands from the Arduino and supplies current from an external battery to the motor.

What you will need:

  • 1x Arduino Uno
  • 1x DC Motor (Type 130)
  • 1x L293D motor driver integrated circuit
  • 1x Battery Holder (e.g., 4xAA for 6V)
  • Breadboard & Wires

The Wiring (The Circuit)

Place the L293D on the breadboard. The semicircle (notch) indicates the "top" side (Pins 1 and 16).

Power Connections:

  1. Pin 16 (VCC1): To the 5V of the Arduino (chip power supply).

  2. Pin 8 (VCC2): To the (+) of the Battery (motor power supply).

  3. GND (Pins 4, 5, 12, 13): Connect all together to the ground (GND) of the Arduino AND to the (-) of the Battery. Attention: They must share a common ground!

Control Connections (Arduino):

  1. Pin 1 (Enable 1,2): To Pin 9 of the Arduino (for speed control with PWM).

  2. Pin 2 (Input 1): To Pin 3 of the Arduino.

  3. Pin 7 (Input 2): To Pin 4 of the Arduino.

Motor Connections:

  1. Pin 3 (Output 1): To one wire of the Motor.

  2. Pin 6 (Output 2): To the other wire of the Motor.


The Code (Sketch)

Upload the following code. The motor will start slowly, accelerate, stop, and then rotate in reverse.

C++

// Pin Definitions const int enablePin = 9; // Controls speed (PWM) const int in1Pin = 3; // Controls direction A const int in2Pin = 4; // Controls direction B void setup() { // Set pins as outputs pinMode(enablePin, OUTPUT); pinMode(in1Pin, OUTPUT); pinMode(in2Pin, OUTPUT); } void loop() { // --- STEP 1: Move Forward --- digitalWrite(in1Pin, HIGH); // One end positive digitalWrite(in2Pin, LOW); // The other end negative // Accelerate from 0 to 255 (Maximum) for (int speed = 0; speed <= 255; speed++) { analogWrite(enablePin, speed); delay(20); } delay(1000); // Wait 1 second // --- STEP 2: Stop --- digitalWrite(in1Pin, LOW); digitalWrite(in2Pin, LOW); analogWrite(enablePin, 0); delay(1000); // --- STEP 3: Move Backward --- digitalWrite(in1Pin, LOW); // Reverse polarity digitalWrite(in2Pin, HIGH); analogWrite(enablePin, 200); // Constant speed (about 80%) delay(2000); // Run for 2 seconds // Stop before repeating the cycle digitalWrite(in1Pin, LOW); digitalWrite(in2Pin, LOW); delay(1000); }

How it works:

  • Rotation Direction: When in1 is HIGH and in2 is LOW, the current flows in one direction. When reversed, the motor spins in the opposite direction.

  • Speed: The enablePin acts like the throttle. Using the command analogWrite(enablePin, 255) gives full throttle, while 128 gives half speed.

Manufacturer

OEM
See full description

Specifications

Specifications

Electric Current
DC
Rounds Per Minute
-

Important information

Specifications are collected from official manufacturer websites. Please verify the specifications before proceeding with your final purchase. If you notice any problem you can report it here.

See all specifications

Description & Specifications

Project: DC Motor Control (Direction & Speed) with Arduino & L293D

In this project, we will learn how to drive a simple Toy Hobby Motor using the integrated circuit L293D.

Why do we need the L293D?

The Arduino cannot provide enough current to drive a motor directly from its pins (it will burn out!). The L293D acts as a "switch": it takes commands from the Arduino and supplies current from an external battery to the motor.

What you will need:

  • 1x Arduino Uno
  • 1x DC Motor (Type 130)
  • 1x L293D motor driver integrated circuit
  • 1x Battery Holder (e.g., 4xAA for 6V)
  • Breadboard & Wires

The Wiring (The Circuit)

Place the L293D on the breadboard. The semicircle (notch) indicates the "top" side (Pins 1 and 16).

Power Connections:

  1. Pin 16 (VCC1): To the 5V of the Arduino (chip power supply).

  2. Pin 8 (VCC2): To the (+) of the Battery (motor power supply).

  3. GND (Pins 4, 5, 12, 13): Connect all together to the ground (GND) of the Arduino AND to the (-) of the Battery. Attention: They must share a common ground!

Control Connections (Arduino):

  1. Pin 1 (Enable 1,2): To Pin 9 of the Arduino (for speed control with PWM).

  2. Pin 2 (Input 1): To Pin 3 of the Arduino.

  3. Pin 7 (Input 2): To Pin 4 of the Arduino.

Motor Connections:

  1. Pin 3 (Output 1): To one wire of the Motor.

  2. Pin 6 (Output 2): To the other wire of the Motor.


The Code (Sketch)

Upload the following code. The motor will start slowly, accelerate, stop, and then rotate in reverse.

C++

// Pin Definitions const int enablePin = 9; // Controls speed (PWM) const int in1Pin = 3; // Controls direction A const int in2Pin = 4; // Controls direction B void setup() { // Set pins as outputs pinMode(enablePin, OUTPUT); pinMode(in1Pin, OUTPUT); pinMode(in2Pin, OUTPUT); } void loop() { // --- STEP 1: Move Forward --- digitalWrite(in1Pin, HIGH); // One end positive digitalWrite(in2Pin, LOW); // The other end negative // Accelerate from 0 to 255 (Maximum) for (int speed = 0; speed <= 255; speed++) { analogWrite(enablePin, speed); delay(20); } delay(1000); // Wait 1 second // --- STEP 2: Stop --- digitalWrite(in1Pin, LOW); digitalWrite(in2Pin, LOW); analogWrite(enablePin, 0); delay(1000); // --- STEP 3: Move Backward --- digitalWrite(in1Pin, LOW); // Reverse polarity digitalWrite(in2Pin, HIGH); analogWrite(enablePin, 200); // Constant speed (about 80%) delay(2000); // Run for 2 seconds // Stop before repeating the cycle digitalWrite(in1Pin, LOW); digitalWrite(in2Pin, LOW); delay(1000); }

How it works:

  • Rotation Direction: When in1 is HIGH and in2 is LOW, the current flows in one direction. When reversed, the motor spins in the opposite direction.

  • Speed: The enablePin acts like the throttle. Using the command analogWrite(enablePin, 255) gives full throttle, while 128 gives half speed.

Manufacturer

OEM
Electric Current
DC
Rounds Per Minute
-

Important information

Specifications are collected from official manufacturer websites. Please verify the specifications before proceeding with your final purchase. If you notice any problem you can report it here.