IoT Lab5 2020 21 Sem5 I010
IoT Lab5 2020 21 Sem5 I010
5.To program smart home application using MCU board using cisco
packet tracer.
Submission deadline: Announced in the class (Progress must be show in class – marks will be based on viva)
File name: IoT-Lab4-2021-20-Sem5-rollno.docx/pdf/doc
Part A
Aim: To program smart home application using MCU board using cisco packet tracer.
Procedure:
1. Reuse your last lab session packet tracer and make a new copy of it.
2. Add a MCU board
At the bottom left corner of the Packet Tracer window, locate and click the [components] icon in
the top row, and the [boards] icon in the bottom. Click on MCU board and then click in the
Logical workspace to add the board
3. Add sensors
At the bottom left corner of the Packet Tracer window, locate and click the [components] icon in
the top row, and the [sensor] icon in the bottom. Click on motion sensor and temperature and
then click in the Logical workspace to add them
Network layout
Deepak Chaudhary Roll no : I010 Batch : A1
Blocky programming
Blockly is a visual programming editor which uses graphical blocks to represent code concepts like
variables, logical expressions, loops, and more. It helps students to better understand and apply
programming principles without having to worry about the specific syntax of a specific programming
language.
Links:
IoT application
Part 1- https://www.youtube.com/watch?v=UikLZuR6QLY
Part 2 - https://www.youtube.com/watch?v=OaJBqvWRy1E
Deepak Chaudhary Roll no : I010 Batch : A1
Observations:
- Connecting all the devices ( Motion sensor , Temperature Sensor, Coffee Maker, Ceiling Fan ,
Lawn Sprinkler ) with MCU board using the IoT custom cable )
2. Write a program to turn ON the ceiling fan or AC in the room, if motion sensor has detected
presence in the room. Screen shot of code and output
Code :
Deepak Chaudhary Roll no : I010 Batch : A1
Output :
- Click on Run button , hover on motion sensor and press Alt key and the result will be “1023”
which means that motion sensor is detecting the presence and the fan will be turned ON.
Deepak Chaudhary Roll no : I010 Batch : A1
- As we hover on motion sensor the fan turn ON and MCU gives output as 1023 and when
there is no hover , no motion is detected and hence the fan automatically gets turned OFF.
3. Write a program to turn ON the lawn sprinkler if temperature sensor has detected value
greater than 28 degrees Celsius. Screen shot of code and output.
(28 degrees converted to 654.72 according to conventions)
Code :
Deepak Chaudhary Roll no : I010 Batch : A1
Output :
- As the temperature rises above 30 degrees , the sprinkler gets turned ON.
Output :
- Since the temperature is less than 18 degrees , the coffee maker is turned ON.
Conclusion (few lines): In this lab , we learnt how MCU works in cisco packet tracer and how is it
connected with other devices . We did blocky programming for setting up the required conditions in
the above questions and got the desired outputs.