0% found this document useful (0 votes)
17 views

Da 4

This document describes a lab assignment to automate a fan using Cisco Packet Tracer based on motion and wind sensor inputs. The fan should turn on when motion is detected and wind is not present, turn off when wind is present regardless of motion, and turn off when no motion is detected. The environment is set up with a motion sensor to detect people, a wind sensor to detect wind, and code in the SBC uses the sensor readings to control the fan's power accordingly.

Uploaded by

suyash agarwal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Da 4

This document describes a lab assignment to automate a fan using Cisco Packet Tracer based on motion and wind sensor inputs. The fan should turn on when motion is detected and wind is not present, turn off when wind is present regardless of motion, and turn off when no motion is detected. The environment is set up with a motion sensor to detect people, a wind sensor to detect wind, and code in the SBC uses the sensor readings to control the fan's power accordingly.

Uploaded by

suyash agarwal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

LAB ASSIGNMENT 4-

(Cisco Packet Tracer)

By- Suyash Agarwal


20BBS0123
Q1 Fan automation

The fan should be on/off under these conditions


1. When motion is detected
1.1. Wind is not present = turn ON
1.2. Wind is present = turn OFF
2. No motion is detected = turn OFF

Sensors
• Motion sensor to detect person
• Wind sensor to detect Wind
• Wind detector for error Correction and knowing if there is wind or not
Setting up environment for wind speed
Code in SBC
from gpio import *
from time import *

def main():
while True:
if digitalRead(2) > 0 or digitalRead(1) == LOW :
customWrite(0,0)
else :
customWrite(0,2)
delay(500)

if __name__ == "__main__":
main()

a. Wind is not present = turn ON


b. Wind is present = turn OFF

c. No motion is detected = turn OFF

You might also like