0% found this document useful (0 votes)
10 views

Lesson 20 DC Motor Control

This lesson covers controlling a small DC motor using a RexQualis UNO R3 and a transistor. It includes hardware requirements, principles of using a breadboard power supply, and the L293D motor driver chip specifications. The document also provides code examples and experimental procedures for setting up the circuit and uploading the code to the UNO R3 board.

Uploaded by

Euronymous
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lesson 20 DC Motor Control

This lesson covers controlling a small DC motor using a RexQualis UNO R3 and a transistor. It includes hardware requirements, principles of using a breadboard power supply, and the L293D motor driver chip specifications. The document also provides code examples and experimental procedures for setting up the circuit and uploading the code to the UNO R3 board.

Uploaded by

Euronymous
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Lesson 20 DC Motor Control

Introduction

In this lesson, you will learn how to control a small DC motor using a UNO R3
and transistor.

Hardware Required

 1 * RexQualis UNO R3

 1 * Breadboard

 1 * Breadboard Power Supply Module

 1 * L293D IC

 1 * Fan blade and 3-6v motor

 5 * M-M Jumper Wire

 5 * 9V 1A Adapter

Principle

Breadboard Power Supply

The small DC motor is likely to use more power than a UNO R3 board digital
output can handle directly. If we tried to connect the motor straight to an UNO
R3 board pin, there is a good chance that it could damage the UNO R3 board.
So we use a power supply module provides power supply.

Product Specifications:

 Locking On/Off Switch

 LED Power Indicator


 Input voltage:6.5-9v(DC) via 5.5mm x 2.1mm plug

 Output voltage:3.3V/5V

 Maximum output current:700 mA

 Independent control rail output.0v, 3.3v, 5v to breadboard

 Output header pins for convenient external use

 Size:2.1 in x 1.4 in

 USB device connector on board to power external device

Setting up output voltage:

5V 3.3V

The left and right voltage output can be configured independently. To select the
output voltage, move jumper to the corresponding pins.

Note: power indicator LED and the breadboard power rails will not power on if
both jumpers are in the “OFF” position.

Important note:

Make sure that you align the module correctly on the breadboard. The
negative pin(-) on module lines up with the blue line(-) on breadboard and that
the positive pin(+) lines up with the red line(+).Failure to do so could result in
you accidently reversing the power to your project

L293D

This is a very practical chip that can independently control two DC motors. In
this experiment, just half of the chip is used. Since most pins on the right side
of the chip are used to control the second motor, they will not be used here.

L293D has two pins (Vcc1 and Vcc2) for power supply. Vcc2 is used to supply
power for the motor, while Vcc1 to supply for the chip. Since a small-sized DC
motor is used here, connect both pins to +5V. If you use a high power motor,
connect Vcc2 to an external power supply. At the same time, the GND of
L293D should be connected to that of the RuiiGuu Uno board.

DC Motor Specifications

 Voltage:3-6V

 Main Size:length 25mm,thickness 15 mm,width 20mm

 Motor Shaft Length:9mm,Shaft Diameter 2mm


 Rated Voltage:3V

 Reference Current:0.35-0.4A

 3V Rotating Speed:13000ROM

Code interpretation

#define E1 5 // Enable Pin for motor

#define I1 3 // Control pin 1 for motor

#define I2 4 // Control pin 2 for motor

void setup() {

pinMode(E1, OUTPUT);

pinMode(I1, OUTPUT);

pinMode(I2, OUTPUT);

void loop() {

analogWrite(E1, 153); // Run in half speed

digitalWrite(I1, HIGH);

digitalWrite(I2, LOW);

delay(10000);

// change direction

digitalWrite(E1, LOW);

delay(2000);

analogWrite(E1, 255); // Run in full speed


digitalWrite(I1, LOW);

digitalWrite(I2, HIGH);

delay(10000);

Experimental Procedures

Step 1:Build the circuit

Schematic Diagram
Step 2: Open the code:DC_Motor_Control_Code
Step 3: Attach Arduino UNO R3 board to your computer via
USB cable and check that the 'Board Type' and 'Serial Port' are
set correctly.

Step 4: Upload the code to the RexQualis UNO R3 board.


If it isn’t working, make sure you have assembled the circuit
correctly, verified and uploaded the code to your board. For
how to upload the code and install the library, check Lesson 0
Preface.

You might also like