Professional Documents
Culture Documents
The task gives us the directive to design and implement a burglar alarm system
given the mentioned list of resources. The job of the system is to;
a) Detect an intruder
This is done through the use of an ultrasonic sensor that sends out and
receives sound waves. If the waves bounce off an object in this case an
intruder the sensor picks this up. The system is meant to pick up any object
that comes within two meters of the house
This is done through the use of three output devices; an LED light, buzzer and
LCD screen. When an intruder comes within two meters of the house the red
LED light and the buzzer will go off every two seconds and the LCD will tell the
occupants of the house how far away the intruder is.
// Libraries
#include <LiquidCrystal.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
lcd.begin(16,2);
pinMode(LEDBUZZ, OUTPUT); // initialise the LED/Buzzer pin
as output
pinMode(TRIGPIN, OUTPUT); // initialise the trigger pin as
output
pinMode(ECHOPIN, INPUT); // initialise the echo pin as input
}
void loop() {
// put your main code here, to run repeatedly:
// Setup ultrasonic sensor
digitalWrite (TRIGPIN,LOW);
delayMicroseconds(10);
digitalWrite (TRIGPIN,HIGH);
delayMicroseconds(7);
duration = pulseIn(ECHOPIN,HIGH);
Serial.print("Distance = ");
Serial.print(distanceCm);
Serial.print("cm");
// Output to LCD
lcd.setCursor(0,0);
lcd.print("Intruder alert!");
lcd.setCursor(0,1);
lcd.print("Dist: ");
lcd.print("distanceCm");
}
}
// Calculate distance
long Distance (long time)
{
long calc;
calc = ((time * 0.034) / 2);
return calc;
}
Task2:
1. Context description and advantages of the system described in scenario two.
Task 2 presents us with the task of monitoring the lighting inside a house.
Using a LDR/photocell we keep track of the light intensity inside the house
and we can then switch on the light. The above two coupled with connecting
the system to the internet and ThingSpeak means all these operations can be
conducted remotely. The house owner can monitor the light intensity
remotely or see that the light(LED) turns on when it gets dark. Advantages of
the system include but not limited to;
A. Peace of mind for the house owner. Human beings generally feel much
safer when they are aware of everything going on with their
possessions even if it is as simple as the light intensity in the home.
B. Improved security for the property. Having the lights turn on when it
gets dark even if no one is around may deter potential thieves since if
they see the lights they will assume someone is home.
C. Electricity savings. Having the lights on when they actually need to be
on saves a lot in the long run in electricity bills for the homeowner as
the consume less electricity. This also translates into environmental
benefits.
// Libraries
#include <ESP8266WiFi.h>
// Pin mappings
#define LDR A0
static const uint8_t D0 = 16;
WiFiClient client;
void setup()
{
pinMode(ledPin, OUTPUT);
Serial.begin(115200);
delay(10);
Serial.println("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
void loop()
{
Serial.print("Light: ");
Serial.print(lightIntensity);
Serial.println("%. Send to Thingspeak.");
}
client.stop();
Serial.println("Waiting...");
delay(1000);
}
As a home system without the need for any complex calculations or analysis the
above system falls into
Task3:
1. Describe embedded systems as an enabling technology in IoT
Task 4:
1. Describe physical security and the importance it stands in IoT.