Experiment 1
Experiment 1
Internet of Things
School of Computing
Department of Software Engineering
Mekelle University
Mekelle, Tigray, Ethiopia
Table of Contents
Objective........................................................................................................................................... 3
Introduction.......................................................................................................................................3
Equipment Used................................................................................................................................3
Experiment procedure.......................................................................................................................5
Part 1............................................................................................................................................5
Part 2............................................................................................................................................7
Part 3............................................................................................................................................7
Data and Result.................................................................................................................................8
Discussion.........................................................................................................................................8
Conclusion and Recommendation.....................................................................................................8
figure 1 .............................................................................................................................................
figure 2..............................................................................................................................................
figure 3..............................................................................................................................................
figure 4..............................................................................................................................................
figure 5..............................................................................................................................................
2
1. Objective
The main aim of this experiment is to design a security system using tinkercad simulator
that senses a persons entry and give a sound to alert to the whom is concerned about.
2. Introduction
3. Equipments Used
The equipments used in this experiment are tinkercad materials.
• Arduino UNO R3
Arduino UNO is a microcontroller board primarily based at the atmega328p. It has 14
digital input/output pins of which 6 can be used as PWM outputs, 6 analog inputs, a
16MHz ceramic resonator, a USB connection, a power jack , an ICSP header, and a reset
button.
3
• Bread board
A breadboard is a rectangular plastic board with a bunch of tiny holes in it. These holes
let us easily insert electric components to prototype an electronic circuit, like a battery,
switch, resistor and an LED.
In this Experiment I try to use 4 LEDs which demonstrates how far or close we are from the
sensor.
• 4 Resistors
A resistor is a passive electrical component that regulates the flow of electrical current in an
electronic circuit. In this experiment 4 resistors are used for the LEDS to prevent them from
burning out.
4
Figure 4. Resistor
5
the first LED will glow if we are in the range of 10cm.
• The second LED connected to pin number 5.
the second LED will glow if we are in the range 10 and 20cm.
• The third LED is connected to pin number 6.
the third LED will glow if we are in the range 20 and 30cm
• The fourth LED is connected to pin number 7.
the fourth LED glow if we are in a distance greater than 30cm.
Step 3: connecting ultrasonic with breadboard
• The Groundpin of the Ultrasonic is connected to the negative pin of breadboard.
• The power pin of the ultrasonic is connected to the power pin of breadboard.
• The echo pin of the Ultrasonic is connected to the pin number 2 of the Arduino.
• The Trig pin of the ultrasonic is connected to the pin number 3 of the Arduino.
Step 4: connecting buzzer with breadboard
• The negative of the buzzer connected to the groundpin of breadboard.
• The positive of the piezo is connected to the pin number 7 of Arduino.
Void setup()
{
pinmode(trigpin, output);
pinmode(led1, output);
pinmode(led2, output);
pinmode(led3, output);
pinmode(led4, output);
pinmode(buzzer, output);
pinmode(echopin, input);
}
void loop()
{
// activate the sensor
digitalwrite(trigpin, LOW);
delay microsecond(2);
digitalwrite(trigpin, HIGH);
delay microsecond(10);
digitalwrite(trigpin, LOW);
6
int duration = pulseIN(echopin, HIGH);
// convert from time to distance
int distance = duration * 0.0343/2;
if(distance <=10)
{
digitalwrite(led1, HIGH);
digitalwrite(led2 LOW);
digitalwrite(led3 LOW);
digitalwrite(led4 LOW);
tone(buzzer, 262);
}
else if (distance>10 && distance <=20)
{
digitalwrite(led2, HIGH);
digitalwrite(led1, LOW);
digitalwrite(led3,LOW);
digitalwrite(led4,LOW);
tone(buzzer,150);
}
else if(distance>25 && distance <=30)
{
digitalwrite(led3,HIGH);
digitalwrite(led1, LOW);
digitalwrite(led2, LOW);
digitalwrite(led4, LOW);
tone(buzzer, 120);
}
else
{
digitalwrite(led4,LOW);
digitalwrite(led1,LOW);
digitalwrite(led2,LOW);
digitalwrite(led3,LOW);
noTone(buzzer);
}
7
• Taking sample distance values the following result was obtained.
6. DISCUSSION
The result shows that as the distance between the restricted area and the object is too close
both the tone frequency of the buzzer and the LED becomes high, as a result the authorized
person becomes informed about the event so fast. In the reverse if the distance increases the
tone frequency of the buzzer and the LED becomes LOW. Then the less the authorized person
is awared about the event.
7. QUESTION
Question1: what if for example a thief is trying to enter to my house and no one is in my house to be
alerted? At that instant how my house can be secured from thief or unauthorized person?
Question2: how the position of the entry person can be known?
8. CONCLUSION
In this experiment using ultrasonic sensor, arduino uno, buzzer, buzzer and breadboard a
security system is proposed and tested. As a result a successful outcome was gained. An
objects distance was measured and detected by ultrasonic distance measure and the buzzer
and the LEDs reacted according the input gained. This system is significant to enhance our
place secured.
9. RECOMMENDATION
This system can be more valuable for security if we enhance some concepts like adding
camera that can capture the object in entry to have a full information about that object and
take reaction according to.
8
9