Professional Documents
Culture Documents
Name/s:Fermin Clyde, Gagabi Rome, Lim Sean, Zurbano, Gene Date Performed:11-4-
2022
Date Submitted:11-4-
2022
Instructor:Engr. Mortos
1. Objective(s):
The activity aims to covers the discussions on how to interface motors including servo motors in
Arduino. It also includes the discussions on topic about its components and functions.
3. Materials
• Hook-up wires
• Servo Motor
• Potentiometer
4. Discussion
Electric Motor
An electric motor converts electrical energy into mechanical energy. It operates by means of receiving
power in rotary motion when current flows within a magnetic field. Motors are broadly classified by
the type of drive power used (source) – AC or DC Motor. They can also be further divided by the
rotational principle.
40
Figure 6.1 – Electric Motors
① When the outer magnets rotate (referred to as a rotating magnetic field),② The N and S
poles attract and repel each other, ③ Causing the magnet with the rotational axis (center) to
turn.
If we wind a conductive wire into a coil the magnetic force is combined, generating a large
magnetic flux along with North and South poles.
41
Figure 6.4- Electric motor coil winded with a conductive wire
Here we see an actual method used for rotating a motor by generating a rotational magnetic field
from a 3-phase AC source and conductive coils (3-phase AC is an AC signal with phases shifted
120°).
As mentioned above, the 3 phase coils (U, V, and W) are wrapped around an iron core, positioned
120° apart, with the higher voltage generated at the North pole(N) and the lower voltage at the
South pole(S). Since each phase varies sinusoidally, the pole (N/S) generated from each coil will
continue to change, along with the magnetic field.
If we look at just the North pole phase, it switches in order from the U coil → V coil → W coil →
U coil, enabling rotation.
DC Motor
42
Figure 6.7 – Structure of DC motor
This DC or direct current motor works on the principal, when a current carrying conductor is placed
in a magnetic field, it experiences a torque and has a tendency to move.This is known as motoring
action. If the direction of current in the wire is reversed, the direction of rotation also reverses.
When magnetic field and electric field interact they produce a mechanical force, and based on that
the working principle of DC motor is established.
The direction of rotation of a this motor is given by Fleming’s left hand rule, which states that if the
index finger, middle finger and thumb of your left hand are extended mutually perpendicular to
each other and if the index finger represents the direction of magnetic field, middle finger indicates
the direction of current, then the thumb represents the direction in which force is experienced by
the shaft of the DC motor. (electrical4u.com)
Servo Motor
There are some special types of application of electrical motor where rotation of the motor is
required for just a certain angle not continuously for long period of time. For these applications,
some special types of motor are required with some special arrangement which makes the motor
to rotate a certain angle for a given electrical input (signal). For this purpose servo motor comes
into picture. This is normally a simple DC motor which is controlled for specific angular rotation
with the help of additional servomechanism (a typical closed loop feedback control system). Now
day’s servo system has huge industrial applications.
A relay is an electromagnetic switch operated by a relatively small electric current that can turn on or
off a much larger electric current. The heart of a relay is an electromagnet (a coil of wire that becomes
a temporary magnet when electricity flows through it). You can think of a relay as a kind of electric
lever: switch it on with a tiny current and it switches on (“leverages”) another appliance using a much
bigger current. Why is that useful? As the name suggests, many sensors are incredibly sensitive
pieces of electronic equipment and produce only small electric currents. But often we need them to
drive bigger pieces of apparatus that use bigger currents. Relays bridge the gap, making it possible
for small currents to activate larger ones. That means relays can work either as switches (turning
things on and off) or as amplifiers (converting small currents into larger ones). (explainthatstuff.com)
(a) (b)
Figure 6.8 – Relay on Actions. (a) Unactive connection; (b) Active connection
When power flows through the first circuit (1), it activates the electromagnet (brown), generating a
magnetic field (blue) that attracts a contact (red) and activates the second circuit (2). When the power
is switched off, a spring pulls the contact back up to its original position, switching the second circuit
off again.
This is an example of a “normally open” (NO) relay: the contacts in the second circuit are not
connected by default, and switch on only when a current flows through the magnet. Other relays are
“normally closed” (NC; the contacts are connected so a current flows through them by default) and
switch off only when the magnet is activated, pulling or pushing the contacts apart. Normally open
relays are the most common.
5. Procedures
44
Part I: Interfacing Servo Motor to Arduino
Servo motors have three wires: power, ground, and signal. The power wire is typically red and should
be connected to the 5V pin on the Arduino board.
The ground wire is typically black or brown and
should be connected to a ground pin on the board.
The signal pin is typically yellow or orange and
should be connected to pin9 on the board.
voidsetup(){
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
voidloop(){
myservo.write(45); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
myservo.write(90); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
}
45
______________________________________________________________________________
______________________________________________________________________________
voidsetup(){
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
voidloop(){
val=analogRead(potpin); // reads the value of the potentiometer (value between
//0 and 1023)
val=map(val,0,1023,0,180); // scale it to use it with the servo (value between 0 and
//180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
}
4. Run the code and rotate the potentiometer. Observed what will happen to the servo motor as the
potentiometer is being rotated.
5. Change the value of 180 on the map function, to 90. What happened to the behavior of the servo
motor?
______________________________________________________________________________
______________________________________________________________________________
46
6. Supplemental Activity
1. Create an Arduino Program that uses delay sequence to control the angle of the
rotation of the servo motor. Table below shows the corresponding angle.
CODE:
#include <Servo.h>
Servo myservo;
void setup(){
myservo.attach(3);
}
void loop(){
myservo.write(180);
delay(1000);
myservo.write(120);
delay(1000);
myservo.write(90);
delay(1000);
myservo.write(45);
delay(1000);
myservo.write(0);
delay(1000);
47
}
OUTPUT:
180:
120:
90:
48
45:
49
0:
7. Conclusion:
50
8. Assessment (Rubric for Laboratory Performance):
__________________
Printed Name and Signature of Faculty Member
51