0% found this document useful (0 votes)
16 views12 pages

Mte 320 Manual

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

Mte 320 Manual

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

320 LA

TAFAWA

BALEWUNIVEA
ERSITY

SAUCH
DOCTRINA MATERRARTIUM

Mecnantca
Eagiaerng

Mechatronit
Systems
Enaine rino
Electronic Engineering Computer
Engineering

Chemical
Engingering

ENGR. AMINU M. (WUNTI)


ARDUINOEXPERIMENTS

IR OBSTÁCLE SENSOR

OVERVIEW
is easy to calibrate. This sensor provides a
Based on simple basic idea, the sensor is build which no
used for most of the indoor applications where
detection range of.10- 30 cm.This sensor can be sensors.
principle as in all Infra - Red proximity
important ambient light is present. It follows the same
which reflects any object in front ofthe sensor.
The basic idea is to send infra red light though IR-LED

OBJECTIVE OF THEEXPERIMENT
Ifobject ís detected pin 13 willgo high (onboard LED
ON) and "object detected" message will be
displayed in serial monitor
LED OFF) and "object not detected"
If object is not detected pin 13 will go low (onboard
message will be displayed in serial monitor
EXPERIMENTAL SETUP

IR SENSOR 4
object SV to 5V

GND to GND

o/pto pin 7
LED pin 13

Page 3
ARDUINO EXPERIMENTS
0R SENSOR ARDUINO CODE

* Project name:
R sensor
Copyright
(c) Researchdesignlab.cam
*description. it object is detecied pin 13 wil go high (onboard LED oN) and object detected"
ssage will be displayed in serial monitor
tt abject is nat detected pin 13 wil go low (onboard LeD OFF) and "objct. nÍt détected!'
message iwill,be di_played in serialimonitor
void setup()

pinMode(7, INPUT); /initlalize the iR snsor pin asaninput;


-pinMode{13, OUTPUT); / initializé pín 13 led'as dutput
Serial.begin(9600)://baud rate

void Joop)

if(digitalRead(7) = LOw) /Y obigci detected IR sensor sends 0to pin 7

Serial.printin("OBJECT detected"); 'object detected" message will þe displàyedin serial monitor


digitalWrite(13, HIGH); /led pin 13will be huraed ön
else

Serial.printin("OBJECT notdetected"); #"object not detected" messege will be displayed in serial.


moritor :
digitalWrite(13, LOW); /led pin í3 will be turhed off
delay(1000); //delay of ong seccnd
}
After compilíng and uploading the above code, click on serial monitor in Ardunio.ide to observe
the output.

Page 4
ARDUINOEXPERIMENTS
ARDUINO IDE - SERIAL MONITOR

SERIAL
MONITOR

SERIAL MONITOR

Page 5
ARDUINO EXPERIMENTS
GASSENSOR
OVERVIEW
The liquefied Petroleum Gas (LPG) senso is suitable for
sensing LPG
propane and butane) concentration in the air, Thls can be used in Gas Leakage (Composed mostly
of
Detection equipment for
detecting the ISO-butane, Propane, LNG combustible Gases. If output goes above
the preset range,
indication will be shown as high otherwise It will remaln in idle condition
OBJECTIVE OF THE EXPERIMENT
IfGas is detected pin 13 will go high (onboard LED ON) and "gas detected"
message will be
displayed in serial monitor

If Gas is not detected pin 13 will go low (onboard LED OFF) and "gas not detected" message will
be displayed in serial monitor

EXPERIMENTAL SETUP

GAS SENSORE
Sv to 5v

D/0 to pin
LED pin 13

GND to GND

(Note:for testing, Get a cigarette lighter and half press the lighter button to spill out the GAS.)

Page 6
ARDUINOEXPERIMENTS
GAS SENSOR ARDUINO CODE

*PiOcct n:

*Copyogt
(c) Researchdesignlab.com
*descuption. it Gas is detected pin 3will go high (onboard LED ON)and "yas detected" rnessage wil!
be dispiaycd in seial monitor
It Gas is not detected pin 13 will go low (onboard LED OFF) and "gas not detected":
message will be displayed in serial monitor

void setup()

pinMode(7, INPUT); // initíalize the GAS sensor pin as an input:


pinMode(13, OUTPUT); 1/initializë pin13 led as output
Serial.begin(9600); //baud rate

void loop)

if(digitalRead(7) == HIGH) i/if gas detected GAS Sensor sends to pin 7


{
Serial.printin("gas detected"); "gas detected" message will be displayed in serial monitor
digitalWrite(13, HIGH); //led pin 13 willbe turned on

else

Serial.println("gas not detected'"); "gas not detected" message will be displayed in serial monitor
digitalWrite(13, LOW); //led pin 13 wil# be turned off
}
delay(1000); //delay of one secand
}
After compiling and uploading the above code, click on serial monitor in Ardunio ide to observe
the output.

Page 7
Experiment on Speed Control of Stepper Motor
Aim: To control the speed of Stepper Motor using Arduino
Toolsand Components required:
1. Arduino Uno
2. Stepper Motor
3.. 10k ohm potentiometer
4. Bread board'
5. Arduino software
6. U2004 Darlington Array (in case of Unipolar stepper motor)
7. SN754410ne H-Bridge (in case of Bipolar stepper motor)

Theory:
a high degree of accuracy
Stepper motors, due to their unique design, can be controlled to
mounted with a series of
without any feedback mechanisms. The shaft of. a stepper,
are charged positively and
magnets, is controlled by a series of electromagnetic coils that
forward or backward in small "steps".
negatively in a specific sequence, precisely moving it
Bipolars, and it is very important to know
There are two types of steppers, Unipolars and
motors, there is a different circuit.
which type you are working with. For each of the

Circuits:

p12

IPEF Arduino ULN2004A

yt vasin rtzlng.urg

DEPARTMENT OF MECHATRONICS ENGINEERING


Unipolar Motor Schematic

MOTOR

Newer

ARDS DI

iO RER Ardulno

1.2EN
15
Quadruple
hatf
H-bridge 13

12
11

JA 10

Veo
$0A
Pry

Artung UNS

Bipolar Motor schematic

Progranm:
#include <Stepper.h>
const int stepsPerRevolution =200;
Stepper myStepper(stepsPerRevolution,8, 9, 10, 11);
int stepCount = 0; // number of steps the motor has taken
void setup() {

void loop() {
int sensorReading =analogRead(A0);
int motorSpeed = map(sensorReading, 0, 1023, 0, 100);

DEPARTMENT OF MECHATRONICS ENGINEERING


if (motorSpeed > 0) {
myStepper.setSpeed(motorSpeed);
myStepper.step(stepsPerRevolution/100);

Result: The speed of the Uni and Bipolar Stepper motor is controlled using Arduino

DEPARTMENT OF MECHATRONICS ENGINEERING


Experiment on Photo-resistor and LED using Arduino
Aim: To detect the light intensity using
Arduino UNO.

Tools and Components required:


1. Arduino UNO board
2. LED's

3. LDR Sensor (PhotoResistor)


4. Connecting Wires
5. Arduino Software.

6. Resistors

7. Bread Board

Theory:
Photo resistor allows interacting with the external environment, through intensity of light. It
is based on light resistance that senses the light and will allow the microcontroller in the
arduino to react and change the intensity of LED diode. The photo resistor creates a
different resistance based on the intensity or the light. Changing the resistance through
intensity changes the voltage too. The microcontroller reads different values and will light
up the Led with more or less intensity. A low resistance value willoccur when the sensor is
welllighted and a high resistance value will occur when it is in darkness.

Lunanous Fux Luminance


(Lumens) Candeka
m or Lux)

DEPARTMENT OF MECHATRONICS ENGINEERING


Obstacle detection using Sensors
Aim:To detect the obstacles and alert using
Arduino
Tools Required:
1. Arduino UNO Board
2. Ultrasoníc sensor
3. Test Board
4. Arduino Software
5. Connecting Cables
6. +5V buzzer/ LED

Circuit Diagram:

IC1

id RESET 3

15
2
16
28 AREF 3

16
AO
R 19
6
9
A2
Arduino 2
10
11
AA
2:
12 22
A5
23

11
17 25
26
13

GND

GND

Theory:
The ultrasonic sensor transmits sound waves and receives sound reflected from an object. When
ultrasonic waves are incident on an object, diffused reflection of the energy takes place overa wide
solid angle which might be as high as 180 degrees. Thus some fraction of the incident energy is
reflected back to the transducer in the form of echoes. If the object is very close to the sensor, the
sound waves returns quickly, but if the object is far away from the sensor, the sound waves takes
longer to return. But if objects are too far away from the sensor, the signal takes so long to come
back (or is very weak when it comes back) that the receiver cannot detect it. The sensor uses the
time it takes for the sound to come back from the object in front to determine the distance of an
object.

HC-SRO4

DEPARTMENT OF MECHATRONICS ENGINEERING


The distance tothe object (L) can then be calculated through the speed of ultrasonic waves (v) in the
medium by the relation, where,t' is the time taken by the wave to reach back tothe sensor and 'e'
is the angle between the horizontal and the path taken. If the object is in motion, instruments based
on Doppler shift are used. The ultrasonic sensor can measure distances in centimetres and inches. It
can measure from 0 to 2.5 meters, with a precision of 3 cm.

Program:

int const trigPin = 10;


int const echoPin = 9;
int const buzzPin = 2;

void setup()
{
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(buzzPin,OUTPUT);

void loop()

int duration, distance;


digitalWrite(trigPin, HIGH);
delay(1);
digitalWrite(trigPin, LOW);
duration =pulseln(echoPin, HIGH);
distance = (duration/2) / 29.1;
if (distance <= 50 && distançe >÷ 0) {
digitalWrite(buzzPin, HIGH);
}else {.
digitalWrite(buzzPin, LOW):.

delay(60);

Result:

The obstacle are detected using an ultrasonic sensor and arduino UNO.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy