You are on page 1of 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