0% found this document useful (0 votes)
19 views4 pages

Aksh Iot2

Uploaded by

Gayatri Belide
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views4 pages

Aksh Iot2

Uploaded by

Gayatri Belide
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

VASAVI COLLEGE OF ENGINEERING

(AUTONOMOUS)
(Affiliated to Osmania University)
Ibrahimbagh, Hyderabad – 500 031.
DEPARTMENT OF : Computer Science & Engineering
NAME OF THE LABORATORY : IoT lab
Name:E.Akshaya Roll No. : 1602-21-733-005 Page No. :
WEEK - 02
Buzzer and BME280 onboard sensor on Raspberry PI

PRELAB QUESTIONS - 02

1.What is a sensor? List different types of Analog and Digital sensors.


Ans:
A sensor is a device that detects and responds to inputs from the physical environment, such as
light, heat, motion, or pressure.

Types of Sensors:
1.Analog Sensors: Thermistors (Temperature), Photocells (Light), Potentiometers
(Position).
2.Digital Sensors: Digital Temperature Sensors, Infrared Motion Sensors, Ultrasonic
Range Finders.

2.Give the details of BME280 sensor. What are the ranges supported by this sensor?
Ans:
The BME280 is an integrated environmental sensor developed by Bosch, capable of measuring
temperature, humidity, and pressure.

Ranges Supported:
1.Temperature: -40°C to +85°C
2.Humidity: 0% to 100% relative humidity
3.Pressure: 300 to1100 hPa (hectopascals)

3.What is an IO expander?
Ans:
An IO expander is a hardware device used to increase the number of input/output (I/O) pins
available on a microcontroller or microprocessor, allowing it to control more devices or read more
sensors. It typically communicates with the main processor via serial interfaces like I2C or SPI

4.What are the power modes supported by BME280?


Ans:

Power Modes Supported by BME280:

1.Sleep Mode: Minimal power, functions halted except serial interface.


2.Forced Mode: Single measurement on demand, then returns to sleep.
3.Normal Mode: Cycles between measurement and standby for regular updates.
VASAVI COLLEGE OF ENGINEERING
(AUTONOMOUS)
(Affiliated to Osmania University)
Ibrahimbagh, Hyderabad – 500 031.
DEPARTMENT OF : Computer Science & Engineering
NAME OF THE LABORATORY : IoT lab
Name:E.Akshaya Roll No. : 1602-21-733-005 Page No. :

5.Write the applications of BME280.


Ans:
Applications of BME280:
1.Weather monitoring.
2.Indoor climate control.
3.Health and wellness monitoring.
4.Environmental sensing for IoT.
5.Altitude and pressure measurements.

6.What are the applications of buzzer & push buttons?


Ans:
Applications of Buzzer:
1.Alarm systems (e.g., smoke alarms).
2.User feedback for electronic devices.
3.Timers and clocks alerts.
Applications of Push Buttons:
4.User input for electronic projects.
5.Starting/stopping machinery.
6.Interface controls for devices.
VASAVI COLLEGE OF ENGINEERING
(AUTONOMOUS)
(Affiliated to Osmania University)
Ibrahimbagh, Hyderabad – 500 031.
DEPARTMENT OF : Computer Science & Engineering
NAME OF THE LABORATORY : IoT lab
Name:E.Akshaya Roll No. : 1602-21-733-005 Page No. :

LAB PROGRAM - 02

1) Write a program to Control buzzer using push down buttons


Code:

import sys
sys.path.append('/home/pi/Adafruit-Raspberry-Pi-Python-Code- legacy/Adafruit_MCP230xx')
from Adafruit_MCP230XX import Adafruit_MCP230XX
import time
mcp Adafruit_MCP230XX(busnum = 1, address = 0x20, num gpios = 16)
mcp.config(4, mcp.OUTPUT)
mcp.config(9, mcp.INPUT)
mcp.config(11, mcp.OUTPUT)
while True:
mcp.output(4,0)
if mcp.input(9)==0:
mcp.output(11,1)
mcp.output(4,1)
else:
mcp.output(11,0)
mcp.output(4,0)

OUTPUT:
VASAVI COLLEGE OF ENGINEERING
(AUTONOMOUS)
(Affiliated to Osmania University)
Ibrahimbagh, Hyderabad – 500 031.
DEPARTMENT OF : Computer Science & Engineering
NAME OF THE LABORATORY : IoT lab
Name:E.Akshaya Roll No. : 1602-21-733-005 Page No. :
2) Write a program to read data from BME280 onboard sensor on Raspberry PI
development kit
Code:

import sys
import time
sys.path.append('/home/pi/ETS_IOT KIT demo/DemoCode/BME280')
import BME280lib as BME
while True:
temperature, pressure, humidity=BME.readBME280A11()
print ("Temperature:", temperature, "C")
print ("Pressure :", pressure ,"hPa")
print ("Humidity :", humidity, "%")
time.sleep(3)

OUTPUT:

You might also like