Professional Documents
Culture Documents
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
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
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.
Exercise:
1. Write out the code used above
2. State the 2 typical application of the system above
6
Experiment 4
Apparatus:
1 x Arduino Uno
1 x temperature sensor(LM35)
Personal Computer
1 Breadboard
Jumper wires
Diagram:
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.
Exercise:
1. State the reasons for variations in temperature values.
2. State the 2 typical application of the system above.
8
Experiment 5
Apparatus:
1 x Arduino Uno
1 x Ultrasonic sensor(HC-SR04)
Personal Computer
1 Breadboard
Jumper wires
9
Diagram:
VCC
2 5V
TRIG
3 ECHO
GND GND
Arduino Uno HC-SR04
Sensor
Source Code/Programs:
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:
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;
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
Apparatus:
1 x Servo Motor
1 x Stepper Motor
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.
12
Experiment 7
Title: Demonstration of the use of Stepper Motor with Arduino and a driver
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
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:
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
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
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:
17