Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Tutorial 5

Exercise 1
A simple intrusion detection system comprises a trip sensor which is connected to a server (home gateway) that
raises the alarm when movement is detected.
Design and simulate this system in Packet Tracer.

Answer
1. Click on the trip sensor to access the specification page. Read the specification page to understand how
to use a trip sensor.

2. Select ”Config” in the menu and set ”Gateway/DNS IPv4” to DHCP and ”IoT Server” to Home Gateway.

1
3. Click on ”FatsEthernet0” and make sure that ”On” is checked and that ”IP Configuration” is set to
DHCP.

4. Close the window.


5. Configure the Siren in the same way.

2
6. In order to access the Home Gateway web interface, you need to connect a Laptop to the it.

7. Configure the laptop as above if need be.


8. Click on the laptop; then select ”Desktop” in the menu; then click on ”Web Browser” in the window and
enter the URL (192.168.25.1), username (admin) and password (admin). You can now see all the devices
registered with the Home Gateway.

9. click on ”Conditions” and add the following rule.

3
10. close the window.
11. Test the system by holding down ”ALT” and click on the trip sensor. The alarm should go off.

Exercise 2
A simple access control system to control access to garage comprise an RFID reader, a lamp, and the garage
door. A valid card ID is between 100 and 200 exclusive. The garage door opens and the lamp is set to dim
when a valid ID is detected. The devices are connected wirelessly to the server (home gateway).

1. Configure the server to control the lamp and the garage door automatically.
2. To test the system, create 3 RFID cards 105, 27, 210.

Answer
1. follow the steps 1-4 of Exercise 1 above to configure each of the devices: lamp, garage door and RFID
reader.
2. click on the lamp; then select ”Advanced” at the bottom-right of the window.

3. click on ”I/O Config” and add a wireless interface in ”Network Adapter 2” as below.

4
4. close the window.
5. repeat the steps 2-3 for the Garage door and the RFID reader.

6. use a laptop to add the following rules via the Home Gateway web interface (just like in the Exercise 1
above)

7. now, create 3 RFID cards and set their ID numbers by changing the value of the attribute ”cardID”.

5
8. close this window.
9. now test the system by moving each of the RFID card close to the reader.

Exercise 3
Description
• The figure below shows a smoke detection and management system.
• If the smoke level in the air is above 40% the smoke detector output 1 (smoke detected), otherwise it
output 0 (no smoke detected).

6
• When smoke is detected the alarm goes off, the fan turns on and the window opens.
• These devices are controlled by the server, home gateway.
Questions
1. Design the system in Packet Tracer.
2. Simulate the system. Use an ”Old car” to create the smoke.

Answer
Similar way as for Exercise 2.

Exercise 4
Description
• The figure below shows a smart lamp system.
• The smart lamp is controlled by an Arduino-like micro-controller unit (MCU).
• The controller turns the lamp on when movement is detected and off otherwise.
Questions
1. Design and simulate the system in Packet Tracer.

7
Answer
1. Connect slot D0 of MCU to the slot D0 of the lamp using an ”IoT Custom Cable”.
2. Connect slot D1 of MCU to the slot D0 of the motion sensor using an ”IoT Custom Cable”.
3. click on the MCU, then select ”Programming”.

4. Click new to create a new project.

5. Give a name to the new project, e.g. ”myProject”; then select a template, e.g. ”Blink - JavaScript”.

8
6. Click ”Create”.
7. Double click ”main.js” to open the file.
8. Replace the code in the file by the following.

function setup() {
pinMode(0, OUTPUT);
pinMode(1, INPUT);
}

function loop() {
var x;
x = digitalRead(1);
if (x==HIGH) {
customWrite(0,2);
}
else {
customWrite(0,0);
}
delay(100);
}

9. Click on ”Run” to run the new program.

10. Check the bottom panel for errors.


11. Close the window

9
12. Test the system: Keep ”ALT” pressed and move the mouse over the motion sensor. The lamp should turn
on.

Exercise 5
Description
• The figure below shows a smart lamp system.
• The smart lamp is controlled by an Arduino-like micro-controller unit (MCU).

• The motion sensor detects movement.


• The controller turns the lamp on when movement is detected and off otherwise.
• The user can turn the system on or off using a push button.
Questions

1. Design and simulate the system in Packet Tracer.

Answer
1. Connect slot D0 of MCU to the slot D0 of the lamp using an ”IoT Custom Cable”.
2. Connect slot D1 of MCU to the slot D0 of the motion sensor using an ”IoT Custom Cable”.
3. Connect slot D2 of MCU to the slot D0 of the push button using an ”IoT Custom Cable”.
4. click on the MCU, then select ”Programming”.

10
5. Click new to create a new project.
6. Give a name to the new project, e.g. ”myProject”; then select a template, e.g. ”Blink - JavaScript”.

7. Click ”Create”.
8. Double click ”main.js” to open the file.

9. Replace the code in the file by the following.

11
function setup() {
pinMode(0, OUTPUT);
pinMode(1, INPUT);
pinMode(2, INPUT);
}

function loop() {
var x, y;
x = digitalRead(1);
y = digitalRead(2);
if (x==HIGH && y==HIGH) {
customWrite(0,2);
}
else {
customWrite(0,0);
}
delay(100);
}

10. Click on ”Run” to run the new program.


11. Check the bottom panel for errors.

12. Close the window


13. Test the system: Keep ”ALT” pressed and move the mouse over the motion sensor. Toggle the push
button turn the lamp on or off.

12

You might also like