IoT house
A IoT device monitoring the air quality in a house and sends alerts to the user if the air quality is bad.
Author: Mihăescu Răzvan-Andrei
GitHub Project Link: link_to_github
Description
A device that monitors the air quality in a house using multiple sensors and sends alerts to the user if the air quality is bad. The device will be connected to a Raspberry Pi Pico 2W and will use a display to show the data.
The indexes that will be monitored are:
- temperature
- humidity
- CO
- pressure
- noise
- ultraviolet radiation
- fine dust
- fire risk
These indexes will be shown on the display and it will be used an MicroSD card to store the data to be able to show graphs of the data over time. The device will be connected to a Wi-Fi network and will send alerts to the user if the air quality is bad.
In case of bad air quality, the device will start a buzzer to alert the user, and in case of not being at home, the device will send a notification to the user using a server.
Also, in case of high temperature or humidity, the device is able to turn on a fan to cool the room if the user sets this option.
The LCD display will be use to show the indexes in real time, but also graphs of the data over time. The indexes will be shown in different colors depending on the value of the index. For example, if the temperature is too high, the text will be red, if it is normal, it will be green and if it is too low, it will be blue. The same will be done for all the indexes.
Motivation
I choose this project because it could have a real usage in my life. I am a person that is very careful about the air quality in my house and I want to be able to monitor it in real time.
Also, I want to be able to see the data over time and be able to see if there are any changes in the air quality. I also want to be able to receive alerts if the air quality is bad, so I can take action and improve it.
In this modern world we live in, where air pollution and climate change are becoming more and more of a problem, I want to be very careful about the air quality in my house and prevent any problems that might occur so my health is not affected.
Architecture
The Rasperry Pi Pico 2W will be the main microcontroller of the project. It will be connected to multiple sensors that will monitor the air quality in the house.
The sensors will be connected to the microcontroller using I2C or SPI communication. The data from the sensors will be read by the microcontroller and will be displayed on the LCD display. This data will be stored on a MicroSD card to be able to show graphs of the data over time on the LCD display. The microcontroller will also be connected to a Wi-Fi network and will send alerts to the user if the air quality is bad.
There will also be mechanisms to prevend the rise of the temperature and humidity in the house, like a fan that will be turned on automatically if the temperature or humidity is too high.
The device will also have a buzzer that will be used to alert the user if the air quality is bad. The buzzer will be turned on automatically if the air quality is bad (eg. if the CO level is too high, if a fire is detected, if dust is too high etc.).
For very high risk, like fire, high measurements of CO or very high temperature, the device will send a notification to the user using a server through the Wi-Fi network to alert him even if he is not at home.
Log
Week 5 - 11 May
Week 12 - 18 May
Week 19 - 25 May
Hardware
- Raspberry Pi Pico 2W:
- Function: Acts as the main controller, coordinating the operations of sensors, buzzer, fan and the LCD display. Also, used to connect to the Wi-Fi network, send alerts to the user and process the data from the sensors.
- Raspberry Pi Pico 2W as Debugger:
- Function: Acts as a secondary microcontroller, used to test the code and components before integrating them into the main microcontroller. This will help to identify any issues with the code or components before they are used in the final project.
- Prototype board:
- Function: Acts as a base for the project, used to connect all components together.
- Model: 10x15cm.
- LCD display:
- Function: Acts as a user interface, used to display the data from the sensors in real time and show graphs of the data over time. The LCD will display the data in different colors depending on the value of the index. For example, if the temperature is too high, the text will be red, if it is normal, it will be green and if it is too low, it will be blue. The same will be done for all the indexes.
- Model: ILI9341 & XPT2046 (240x320 px).
- Temperature and humidity sensor:
- Function: Calculates the temperature and humidity in the house. The data will be displayed on the LCD display and stored on the MicroSD card.
- Model: DHT22.
- Pressure & Temperature sensor:
- Function: Calculates the pressure and temperature in the house. The data will be displayed on the LCD display and stored on the MicroSD card.
- Model: BMP280.
- Real-time clock:
- Function: Keeps track of the time and date. The data will be displayed on the LCD display and stored on the MicroSD card.
- Model: DS3231.
- Carbon monoxide sensor:
- Function: Calculates the CO level in the house. The data will be displayed on the LCD display and stored on the MicroSD card. If the CO level is too high, the buzzer will be turned on to alert the user.
- Model: MQ-7.
- Noise sensor:
- Function: Calculates the noise level in the house. The data will be displayed on the LCD display and stored on the MicroSD card.
- Dust particle sensor:
- Function: Calculates the dust level in the house. The data will be displayed on the LCD display and stored on the MicroSD card.
- Model: GP2Y1014AU0F.
- Fire sensor:
- Function: Detects flame and smoke in the house. If a fire is detected, the buzzer will be turned on to alert the user and a notification will be sent to the user using the server.
- Model: KY-026.
- Ultraviolet radiation sensor:
- Function: Calculates the UV radiation level in the house. The data will be displayed on the LCD display and stored on the MicroSD card.
- Model: GUVA-S12SD.
- Mini fan:
- Function: If the temperature or humidity is too high, the fan will be turned on to cool the room. The user can set this option in the code.
- Buzzer module:
- Function: If the air quality is bad (eg. if the CO level is too high, if a fire is detected, if dust is too high etc.), the buzzer will be turned on to alert the user. The buzzer will be turned on automatically if the air quality is bad.
Schematics
Place your KiCAD schematics here.
Bill of Materials
Device | Usage | Price |
---|---|---|
Rapspberry Pi Pico 2W | The microcontroller | 39,66 RON |
Rapspberry Pi Pico 2W | Used as debugger | 39,66 RON |
Prototype board | Used to connect all components together | 6,99 RON |
LCD display | Used to display the data from the sensors | 69,99 RON |
Temperature and humidity sensor | Used to measure the temperature and humidity in the house | 22,99 RON |
Pressure & Temperature sensor | Used to measure the pressure and temperature in the house | 8,49 RON |
Real-time clock | Used to keep track of the time and date | 18,99 RON |
Carbon monoxide sensor | Used to measure the CO level in the house | 32,13 RON |
Noise sensor | Used to measure the noise level in the house | 4,99 RON |
Dust particle sensor | Used to measure the dust level in the house | 29,99 RON |
Fire sensor | Used to detect flame and smoke in the house | 6,99 RON |
Ultraviolet radiation sensor | Used to measure the UV radiation level in the house | 6,20 £ |
Mini fan | Used to cool the room if the temperature or humidity is too high | 7,80 £ |
Buzzer module | Used to alert the user if the air quality is bad | 4,98 RON |
Software
Library | Description | Usage |
---|---|---|
embassy-rp | RP2350 Peripherals | Used for accessing the peripherals |
embedded-hal | Embedded Hardware Abstraction Layer | Used for accessing the hardware |
cortex-m | Provides low-level APIs for ARM Cortex-M processors | Interrupt handling and system control |
embassy-executor | Asynchronous executor for embedded systems | Used for managing tasks and scheduling |
ili9341 | ILI9341 LCD driver | Used for controlling the LCD display |
xpt2046 | XPT2046 touch controller | Used for controlling the touch screen |
bmp280 | BMP280 driver | Used for controlling the BMP280 sensor |
dht22-driver | DHT22 driver | Used for controlling the DHT22 sensor |
ds323x | DS3231 driver | Used for controlling the DS3231 sensor |