Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the pythone code Objectives:1.Control the door when the movement is detected by the motion sensor. 2. To indicate the soumde level inside the home using

image text in transcribed
image text in transcribed
the pythone code
image text in transcribed
Objectives:1.Control the door when the movement is detected by the motion sensor. 2. To indicate the soumde level inside the home using Sound sensor. Follow the below instructions to complete this activiry: 1. Add the following derices to the logical workspace. a. IoT device: Motion sensor, Sound sensor, RGE LED b. Controller. SBC b. Network device IoT custom Cable Follow the below instructions to complete this activity: 1. Add the following devices to the logical workspace. a. IoT devices: Motion sensor, Sound sensor, RGB LED b. Controller. SBC b. Netrork device: Io I custom Cable c. End devices: Door, Window, Home Speaker, Potentiometer. 2. Connect all the IoT devices and end devices to SBC using IoT Custom Cable. 3. Connect Home Speaker and potentiometer to generate sound in the envronment. 4. Write a python program in the SBC using Programming option. 5. In the program, assign the sound sensor and motion iensor as INPUT devices to SBC. 6. In the program, assign the Door, Window and RGB LED as OUTPUT devices from SBC 7. Une the following Logic in the program to activate the IoT Devices a. If the sound level is above 150, then Window should be OPEN and RCE LED must glow in RED color. b. If the sound level is lest than 150, then Window should be CLOSED and RCE IED must glow in GREEN color 6. If the motion sensef detects any object, then the DOOR should be OPEN: d. If the motion sensor doean't detect any object, then DOOR should be CLOSED 8. ALT-ROTATE the move the potentiometer to increase the volume and verify the results. CSSE2204. Lab Activity 11-PKT5 - To control the IoT devices using SBC Python Code: from gpio import * from time import * pinMode(0, INPUT); pinMode(1, INPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(3, OUTPUT); pinMode(2, OUTPUT); while True: if digitalRead (1)>150 : customWrite (5,1); digitalWrite(2, 1023); digitalWrite (3,0); else: customWrite (5,0); digitalWrite( 2,0); digital Write (3, 1023); if digitalRead (0)=HIGH : customWrite (4,1) else: customWrite (4,0)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions