You are on page 1of 18

THE FEDERAL POLYTECHNIC ILARO

MECHATRONICS ENGINEERING DEPARTMENT

MCE 110 PRACTICAL MANUAL

FUNDAMENTAL OF MECHATRONICS (I)


Experiment 1

Title: Identification of a mechatronic system (household items)

Aim: To be able to identify household items that are characterized as a


mechatronic sysytem
Objectives: At the end of the experiment the student should be able:
1 To have a basic knowledge of a mechatronic system
2 To be able to identify household items that are characterized as a mechatronic
system

Significance: To use the knowledge acquired above to understand a mechatronics


system

Theoretical Background:
Mechatronics is the synergistic integration of mechanical engineering with electronics
and intelligent computer control in design and manufacturing of industrial products and
process. A mechatronic system integrates mechanical components, electronic
components, and software implemented either on a PC or MCU to produce a flexible
and intelligent system that performs the complex processing of signals and data.
In many cases, a mechatronic system can be used to improve the performance of a
system beyond what can be achieved using manual means. A typical example of an
household item that can be characterized as a mechatronic system is an automatic
washing machine. They have integrated sensors, controllers and a programmer to
measure the load, fill with water and adjust the temperature. Various programmes are
executed to agitate, wash, rinse and spin dry. In some cases they will even use hot air
drying. The system uses solenoid valves to fill and drain the drum. It has level and
temperature sensors, weight sensor and speed sensor. Depending on the programme,
these are all processed to activate the power control and speed of the motor.

Apparatus:
Washing Machine

Diagram:

1
Precaution: state necessary precautions to take when using a mechatronic system
Observation: state your observation
Conclusion: state your conclusion

Exercise:
1 Mention any other 5 household items that can be characterized as a mechatronic
system.
2 Draw any one out of the items mentioned in (1) above
3 How do you identify a mechatronic system?

2
Experiment 2

Title: Identification of components of a mechatronic system (household items)

Aim: To know the basic components of a mechatronic system


Objectives: At the end of the experiment the student should be able:
1 To understand the components of a mechatronic system
2 To know how to categorize an item as a mechatronic system
Significance: To use the knowledge acquired above to identify the components of a
mechatronics system

Theoretical Background: The components of a mechatronic system


Controller: This is the ‘mind’ of the mechatronic system, which processes user
commands and sensed signals to generate command signals to be sent to the
actuators in the system. The controller needs information about the state of the system.
Digital-to-Analog Converter: this helps to convert the command signals to the actuators
are from a digital to an analog form.
Drive Circuit: Amplifiers implemented in the form of drive circuits are used to amplify
the command signals sent to the actuators.
Actuator: This is the mechanism that converts electrical signals into useful
mechanical motion or action.
Sensors: A device that converts an environmental condition into an electrical signal.
Signal Conditioning: Mostly, the signals produced by the sensors are not in a form ready
to be read by the controller and thus signal conditioning operations are performed on
them.
Analog-to-Digital Converter: this helps to convert the conditioned or sensed signals to a
digital form (if not already in that form) and presented to the controller.

Apparatus:
Washing Machine
Diagram:

3
Precaution: state necessary precautions to take when handling any of the components
of a mechatronic system
Observation: state your observation
Conclusion: state your conclusion

Exercise:
1. State 2 examples each of the components of a mechatronics system
2. Considering an automatic washing machine as shown in experiment one, state
the function of the microprocessor as part of the component of a mechatronics
system

4
Experiment 3

Title: Design and simulation of 3 LED’s blinking simultaneously

Aim: To get familiarize with embedded system


Objectives: At the end of the experiment the student should be able:
1 To understand the microC program and proteus software
2 To know how to use it in building mechatronic system
Significance: To use the knowledge acquired above to build a working mechatronic
system

Theoretical Background: An Embedded System


Embedded system can be said to be a computer hardware system having software
embedded in it. It can be an independent system or it can be part of a large system. It is
also a microcontroller or microprocessor based system which is designed to perform a
specific task.

Apparatus:
1 microcontroller (PIC16F877A)
3 x 100 ohms Resistor
Personal Computer
3 x LEDs
MicroC prog suite
Proteus software
5v power supply

Diagram: R3
PIC16F8
5v R2

R1 D3
77A
5
D2

D1

Procedure:
1. Open the microC and Proteus software on your computer.
2. Create and save a new project.
3. Write your microC code on the microC environment.
4. Make the circuit connection on the proteus environment.
5. Simulate when done
6. Test the program.

Precaution: state your precautions


Observation: state your observation
Conclusion: state your conclusion

Exercise:
1. Write out the code used above
2. State the 2 typical application of the system above

6
Experiment 4

Title: Temperature measurement with Temperature sensor(LM35) and Arduino

Aim: To be able to understand system measurement


Objectives: At the end of the experiment the student should be able:
1 To know how to interface temperature sensor with Arduino to measure
temperature
2 To understand Arduino programming in building measurement systems
3 To know the operation of a temperature sensor

Significance: To use the knowledge acquired to build a temperature measurement


system used for temperature measurement

Theoretical Background: Temperature Sensor(LM35) and Arduino


With the advancement in technology, measurement system can be built by interfacing
temperature sensor LM35 with Arduino will help to monitor temperature around the
range of the sensor and then display it on the serial monitor. Arduino is an open-source
electronics platform based on easy to use hardware and software. LM35 is an analog
temperature sensor whose output voltage varies linearly with change in temperature. It
can measure temperature from -55℃ to +150℃. The voltage output of the LM35
increases 10mV/℃ rise in temperature and can be operated from a 5V supply.

Apparatus:
1 x Arduino Uno
1 x temperature sensor(LM35)
Personal Computer
1 Breadboard
Jumper wires

Diagram:

Arduino Uno TempSensor


LM35
5v
Vcc

Out
A2
Gnd
GND

7
Source Code/Programs:
int pinTemp = A2; //defines pin numbers

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(pinTemp, INPUT);
}

void loop() {
// put your main code here, to run repeatedly:
int temp =analogRead(pinTemp); //Reads the analog pin
temp = temp * 0.5; //converts output(mv) to readable celcius

Serial.print("Temp: ");
Serial.print(temp);
Serial.println("C"); //prints the temperature status on serial monitor

delay(2000);
}

Procedure:
1. Open the Arduino software IDE on your computer.
2. Create and save a new project.
3. Write/Compile your Arduino code on the Arduino IDE environment.
4. Setup the circuit connection as shown in the diagram above on the breadboard.
5. Upload the code to 4.
6. Test the program and measure the temperature by viewing it on Arduino serial
monitor.

Precaution: state your precautions


Observation: state your observation
Conclusion: state your conclusion

Exercise:
1. State the reasons for variations in temperature values.
2. State the 2 typical application of the system above.

8
Experiment 5

Title: Distance measurement with Ultrasonic sensor and Arduino

Aim: To be able to understand system measurement using ultrasonic sensor and


Arduino
Objectives: At the end of the experiment the student should be able:
1 To know how to interface ultrasonic sensor with Arduino to measure
temperature
2 To understand Arduino programming in building systems
3 To know the operation of an ultrasonic sensor

Significance: To use the knowledge acquired to build a distance measurement system


used for distance measurement

Apparatus:
1 x Arduino Uno
1 x Ultrasonic sensor(HC-SR04)
Personal Computer
1 Breadboard
Jumper wires

Theoretical Background: Ultrasonic Sensor(HC-SR04) and Arduino

With the advancement in technology, measurement system can be built by interfacing


ultrasonic sensor HC-SR04 with Arduino to help to measure the distance around the
range of the sensor and then display it on the serial monitor. Arduino is an open-source
electronics platform based on easy to use hardware and software. The ultrasonic
sensor is used. It acts as a Sonar. It sends an ultrasonic wave of a certain frequency
that comes back after hitting the object and calculates the time traveled by it.
Ultrasonic sensors are great tools used to measure distance and detect objects without
any actual contact with the physical world. It is used in several applications, like in
measuring liquid level, checking proximity and even more popularly in automobiles to
assist in self-parking or anti-collision systems. This is an efficient way to measure small
distances precisely. In this project, I used the HC-SR04 Ultrasonic Sensor with Arduino
to determine the distance of an obstacle from the sensor. The basic principle of
ultrasonic distance measurement is based on ECHO. When sound waves are
transmitted in the environment then waves return back to the origin as ECHO after
striking on the obstacle. Thus, the traveling time of both sounds means outgoing time
and returning time to origin after striking on the obstacle needs to be calculated with
relation to the speed of the sound.

9
Diagram:

VCC
2 5V
TRIG
3 ECHO
GND GND
Arduino Uno HC-SR04
Sensor

Source Code/Programs:

The arduino code is seen below:


int echoPin=2; //defines pin numbers
int trigPin=3;
long duration, inches, cm; //defines variables

void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //starts the serial communication
pinMode(trigPin, OUTPUT); //sets the trigPin as output
pinMode(echoPin, INPUT); //sets the echoPin as input

10
}

void loop() {
// put your main code here, to run repeatedly:

digitalWrite(trigPin, LOW); //clears the trigPin


delayMicroseconds (5);
digitalWrite(trigPin, HIGH); //sets the trigPin on HIGH state for 10
microseconds
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH); //Reads the echoPin, returns the sound wave
travel time in microseconds
inches = (duration/2)/74; //calculating the distance
cm = (duration/2)/29.1;

Serial.print(inches); //prints the distance on the serial monitor


Serial.print("in, ");
Serial.print(cm);
Serial.println(" cm");
Serial.println();
delay(100);
}
Procedure:
1. Open the Arduino software IDE on your computer.
2. Create and save a new project.
3. Write/Compile your Arduino code on the Arduino IDE environment.
4. Setup the circuit connection as shown in the diagram above on the breadboard.
5. Upload the code to 4.
6. Test the program and measure the distance by viewing it on the Arduino serial
monitor.

11
Precaution: state your precautions
Observation: state your observation
Conclusion: state your conclusion
Exercise:
1. State the reasons for variations in distance values.
2. State the 2 typical application of the system above.
Experiment 6

Title: Identification of different drives

Aim: To be able to understand different drives such as actuators, ac and dc motors


Objectives: At the end of the experiment the student should be able:
1 To know the difference between different drives
2 To understand their operation

Significance: To be able to apply them to build various systems.

Apparatus:
1 x Servo Motor
1 x Stepper Motor

Theoretical Background: Servo Motor and Stepper Motor


Servo Motor
A servo motor is a rotary machine that converts electrical energy into mechanical
energy. It is a small device that has an output shaft. This shaft can be positioned to
specific angular positions by sending the servo a coded signal. Servomotors are known
as rotary or linear actuators. They are used in radio-controlled airplanes to position
control surfaces like the elevators, in radio-controlled cars and robots. It has three wires;
Red wire for power(+5v), Brown wire for ground and yellow wire for control.

Stepper Motor
A stepper motor is a brushless, synchronous motor, which divides a full rotation into a
number of steps. They are manufactured with steps per revolution of 12, 24, 72, 144,
180 and 200. The motor can be controlled with or without feedback. It can spin in
various directions. To move a stepper motor means moving a certain number of steps
in one direction or the other and then tell the speed at which to step in that direction.

Precaution: state your precautions


Observation: state your observation
Conclusion: state your conclusion
Exercise:
1. Draw the diagram of a stepper motor and a servo motor.
2. State one application each of the two motors mentioned above.

12
Experiment 7

Title: Demonstration of the use of Stepper Motor with Arduino and a driver

Aim: To be able to demonstrate how to use a stepper motor with Arduino


Objectives: At the end of the experiment the student should be able:
1 To know how to interface a stepper motor with Arduino
2 To understand the operation of a stepper motor
3 To know the importance of a driving circuit in a system

Significance: To use the knowledge acquired to build various systems where a stepper
motor is applicable.

Apparatus:
1 x Arduino Uno
1 x Stepper Motor (28BYJ-48 4-Phase 5V DC)
1 x ULN2003AN Motor driver
Personal Computer
1 Breadboard
Jumper wires

Theoretical Background: Stepper Motor and ULN2003AN driving circuit

A stepper motor is used to get the precise control of the motor shaft. They are used in
robot arm, 3D printers, CNC machines etc. In full step mode, stepper motors have a 1 to
64 reduction gearbox and each full 360º rotation consist of 32 steps. The ULN2003
driver is commonly used to control a stepper motor.
ULN2003 is a relay driver IC use to drive loads that require a large voltage or current. It
consists of 7 pairs of Darlington transistors, each pair can withstand 500mA and 50V.
there are 4 transistors in this module which has 4 LEDs to show the activity of 4 motor
control pins.

DIAGRAM:

STEPPER
IN1 MOTOR
11 MOTOR 13
ARDUINO BOARD
UNO 10 IN2
Source Code/Programs:
The Arduino code is seen below:

#include<Stepper.h> // include motor library


const int stepsPerRevolution = 2048; //number of steps per revolution
(32 x 64)
const int rpm = 12;
stepper stepper1 = Stepper (stepsPerRevolution, 8, 9, 10, 11);
void setup () {
stepper1. setSpeed(rpm); //set speed to 12 RPM
}
void loop () {
stepper1.step(stepsPerRevolution); //rotates clockwise for 5seconds
delay (100);
Stepper1.step(-stepsPerRevolution); // rotates counterclockwise for 5seconds
delay (100);
}
Procedure:
1. Open the Arduino software IDE on your computer.
2. Create and save a new project.
3. Write/Compile your Arduino code on the Arduino IDE environment.
4. Setup the circuit connection as shown in the diagram above on the breadboard.
5. Upload the code to 4.
6. Test the program.
Precaution: state your precautions

14
Observation: state your observation
Conclusion: state your conclusion
Exercise:
1. State the 2 typical application of a stepper motor.
2. State the reason for using a driver in the circuit.

Experiment 8

Title: Demonstration of the use of Servomotor with Arduino

Aim: To be able to demonstrate how to use a servo motor with Arduino


Objectives: At the end of the experiment the student should be able:
1 To know how to interface a servo motor with Arduino
2 To understand the operation of a servo motor

Significance: To use the knowledge acquired to build various systems where a servo
motor is applicable.

Apparatus:
1 x Arduino Uno
1 x Servo motor(SG90)
Personal Computer
1 Breadboard
Jumper wires

Theoretical Background: Servomotor(SG90) and Arduino

Servo motors are high torque motors which are commonly used in robotics and several
other applications because it is easy to control their rotation. Servomotors have a
geared output shaft which can be electrically controlled to turn 1º at a time. It has three
pins; Vcc (red wire), GND (brown) and the signal pin (yellow wire). The signal pin feeds
the control signal from the microcontroller to the servo and is used to control the servo
motor by turning its shaft to any desired angle.
DIAGRAM:

ARDUINO UNO SERVO MOTOR


8 Signal
Vcc Vcc
GND GND
15
Source Code/Programs:
The Arduino code is seen below:

#include <Servo.h> // include motor library


Servo servo ; // creates an object for the library
Int angle = 10;
void setup () {
servo. attach (9); //attach the servo object created to pin D9 of the
microcontroller
servo. write(angle); //it turns the servo to 0º
}
void loop () {
for (angle = 10; angle < 180; angle++) //scan from 0º to 180º
{
servo. write(angle);
delay (15);
}
for (angle = 180; angle > 180; angle--) //scan back from 180º to 0º
{
servo. write(angle);
delay (15);
}
}
Procedure:
1. Open the Arduino software IDE on your computer.
2. Create and save a new project.
3. Write/Compile your Arduino code on the Arduino IDE environment.
4. Setup the circuit connection as shown in the diagram above on the breadboard.
5. Upload the code to 4.
16
6. Test the program.

Precaution: state your precautions


Observation: state your observation
Conclusion: state your conclusion
Exercise:
1. State the 2 typical application of a servo motor

17

You might also like