100% found this document useful (2 votes)
118 views

Homework Robotics

The document describes programs to control stepper motors and servos using an Arduino board based on different input conditions: 1. A program is written to rotate a stepper motor clockwise or counter-clockwise at different speeds based on integer values received as input. 2. A program is written to rotate a servo motor to different pulse widths based on the on/off states of two switches. 3. A final program is described that controls a stepper motor and two DC motors simultaneously based on the on/off states of two switches, implementing different speed and rotation configurations for each motor.

Uploaded by

O Meter
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
118 views

Homework Robotics

The document describes programs to control stepper motors and servos using an Arduino board based on different input conditions: 1. A program is written to rotate a stepper motor clockwise or counter-clockwise at different speeds based on integer values received as input. 2. A program is written to rotate a servo motor to different pulse widths based on the on/off states of two switches. 3. A final program is described that controls a stepper motor and two DC motors simultaneously based on the on/off states of two switches, implementing different speed and rotation configurations for each motor.

Uploaded by

O Meter
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

1.

Write a program that will perform the following procedure:


When the Arduino receives an integer:
a. 1 – rotate stepper motor in clockwise direction by 50 steps(10rpm)
b. 3 – rotate stepper motor in clockwise direction by 100 steps(20rpm)
c. 5 – rotate stepper motor in counter clockwise direction by 80 steps(30rpm)
d. 7 – rotate stepper motor in counter clockwise direction by 120 steps(40rpm)

Program:
Wiring:

L298N module is used to drive the bipolar stepper motor. It has two H-Bridges
and each H-Bridge will drive one of the electromagnetic coils of a stepper motor. By
energizing these electromagnetic coils in a specific sequence, the shaft of a stepper
can be moved forward or backward precisely in small steps. However, the speed of a
motor is determined by the how frequently these coils are energized.
Stepper motor from old floppy disk drive

Output: (Observation)

When number “1” is entered, the stepper


motor turns clockwise slowly.

When number “3” is entered, the stepper


motor also turns clockwise but it is faster than
the previous.

When number “5” is entered, the stepper


motor turns counterclockwise.

When number “7” is entered, the stepper


motor turns counterclockwise but it is faster
than the previous rotation which is also a ccw.
Wiring:
The circuit wiring is created using a software called Fritzing. It is a CAD software
for the design of elctronics hardware.

Using L293D as motor driver for a Bipolar Stepper Motor


The simulation of the program is done in a software called Proteus 8
Professional. It is a propreity software tool suite used for electronic design
automation. It used by many to create schematics and circuit simulation.

Output: (same program is used)


2. Write a program that will perform the following procedure:
(using pin 9)
a. When only sw1(pin2) is closed, rotate the Servo with 1.25ms pulse width.
b. When only sw2(pin3) is closed, rotate the Servo with 1.5ms pulse width.
c. When both sw1 and sw2 are closed, rotate the Servo with 1.75ms pulse width.

Program:
Wiring:

Using Pin 9 of the Arduino Mega 2560 to drive the Servo Motor
Output:

When Switch 1 is pressed

When Switch 2 is pressed

When both Switch 1 and Switch 2 are pressed.


3. Make a program to implement the following events:
SW1 SW2 Stepper(7.2/step) Motor 1 Motor2
Pin2 Pin3 Pin15-Pin12 Pin11 Pin10 Pin6 Pin5
0 1 CLOCKWISE CLOCKWISE STOP
15STEPS 1 0
30rpm 30% DC
1 0 C. CLOCKWISE STOP C. CLOCKWISE
25 STEPS 0 1
10rpm 70% DC
0 0 STOP CLOCKWISE C. CLOCKWISE
1 0 0 1
40% DC 60% DC
1 1 STOP C. CLOCKWISE CLOCKWISE
0 1 1 0
100% DC 25% DC

Program:
Wiring:

It takes two L298N Module to execute the program. First L298 module is used
for the stepper motor and the other one is for the DC motors.
Output:

You might also like