0% found this document useful (0 votes)
53 views7 pages

Sample BEEE Worksheet

This document summarizes an experiment to design a simple DC motor control circuit using an Arduino Uno. The aim is to control the speed and direction of a DC motor. The apparatus includes an Arduino Uno, DC motor, L293D motor driver IC, connecting wires, and push button. The circuit diagram and Arduino code are provided to control the motor speed using pulse-width modulation and change the direction of rotation using a push button. The results show that the design of the simple DC motor control circuit was verified after uploading the program.

Uploaded by

Avishek Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views7 pages

Sample BEEE Worksheet

This document summarizes an experiment to design a simple DC motor control circuit using an Arduino Uno. The aim is to control the speed and direction of a DC motor. The apparatus includes an Arduino Uno, DC motor, L293D motor driver IC, connecting wires, and push button. The circuit diagram and Arduino code are provided to control the motor speed using pulse-width modulation and change the direction of rotation using a push button. The results show that the design of the simple DC motor control circuit was verified after uploading the program.

Uploaded by

Avishek Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Experiment Title.2.

Student Name: Avishek kumar UID: 21BCS9666


Branch: CSE Section/Group: 417A
Semester: 2nd Date of Performance:
Subject Name: BEEE Subject Code: 21ELH-101

1. Aim: To design simple DC motor control circuit

2. Apparatus: ARDUINO UNO, DC motor, L293D, connecting wires. Push button

3. THEORY

There are three different type of motors −


DC motor

Servo motor

Stepper motor
A DC motor (Direct Current motor) is the most common type of motor. DC motors normally have just
two leads, one positive and one negative. If you connect these two leads directly to a battery, the
motor will rotate. If you switch the leads, the motor will rotate in the opposite direction.

Warning − Do not drive the motor directly from Arduino board pins. This may damage the board.

Use a driver Circuit or an IC.

We will divide this chapter into three parts −

Just make your motor


spin Control motor speed

Control the direction of the spin of DC motor

4.CIRCUIT DIAGRAM
5. PROCEDURE..
NOTE--Follow the circuit diagram and make the connections as shown in the image given below.

Spin ControlArduino Code

int motorPin = 3;

void setup() {
}

void loop() {

digitalWrite(motorPin, HIGH);

Code to Note

The transistor acts like a switch, controlling the power to the motor. Arduino pin 3 is used to turn the
transistor on and off and is given the name 'motorPin' in the sketch.

6.FULL PROGRAM CODE


#define button 8
#define pot 0
#define pwm1 9
#define pwm2 10

boolean motor_dir = 0;
int motor_speed;
void setup() {
pinMode(button, INPUT_PULLUP);
pinMode(pwm1, OUTPUT);
pinMode(pwm2, OUTPUT);
}

void loop() {
motor_speed = analogRead(pot) / 4;
if(motor_dir)
analogWrite(pwm1, motor_speed);
else
analogWrite(pwm2, motor_speed);
if(!digitalRead(button)){ // If direction button is pressed
while(!digitalRead(button)); // Wait until direction button released
motor_dir = !motor_dir; // Toggle direction variable
if(motor_dir)
digitalWrite(pwm2, 0);
else
digitalWrite(pwm1, 0);
}
}

7.RESULT
Designing of simple DC motor control circuit using arduino is verified after uploading the program.

Evaluation Grid:

Sr. No. Parameters Marks Obtained Maximum Marks


1. Worksheet completion including writing 10
learning objectives/Outcomes.(To be
submitted at the end of the day).
2. Post Lab Quiz Result. 5
3. Student Engagement in 5
Simulation/Demonstration/Performance
and Controls/Pre-Lab Questions.
Signature of Faculty (with Date): Total Marks Obtained:

You might also like