Skip to main content
Version: ACS CC

IoT house

A IoT device monitoring the air quality in a house and sends alerts to the user if the air quality is bad.

info

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.

diagram

Log

Week 5 - 11 May

Week 12 - 18 May

Week 19 - 25 May

Hardware

  1. 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.
  1. 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.
  1. Prototype board:
  • Function: Acts as a base for the project, used to connect all components together.
  • Model: 10x15cm.
  1. 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).
  1. 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.
  1. 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.
  1. 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.
  1. 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.
  1. 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.
  1. 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.
  1. 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.
  1. 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.
  1. 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.
  1. 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

DeviceUsagePrice
Rapspberry Pi Pico 2WThe microcontroller39,66 RON
Rapspberry Pi Pico 2WUsed as debugger39,66 RON
Prototype boardUsed to connect all components together6,99 RON
LCD displayUsed to display the data from the sensors69,99 RON
Temperature and humidity sensorUsed to measure the temperature and humidity in the house22,99 RON
Pressure & Temperature sensorUsed to measure the pressure and temperature in the house8,49 RON
Real-time clockUsed to keep track of the time and date18,99 RON
Carbon monoxide sensorUsed to measure the CO level in the house32,13 RON
Noise sensorUsed to measure the noise level in the house4,99 RON
Dust particle sensorUsed to measure the dust level in the house29,99 RON
Fire sensorUsed to detect flame and smoke in the house6,99 RON
Ultraviolet radiation sensorUsed to measure the UV radiation level in the house6,20 £
Mini fanUsed to cool the room if the temperature or humidity is too high7,80 £
Buzzer moduleUsed to alert the user if the air quality is bad4,98 RON

Software

LibraryDescriptionUsage
embassy-rpRP2350 PeripheralsUsed for accessing the peripherals
embedded-halEmbedded Hardware Abstraction LayerUsed for accessing the hardware
cortex-mProvides low-level APIs for ARM Cortex-M processorsInterrupt handling and system control
embassy-executorAsynchronous executor for embedded systemsUsed for managing tasks and scheduling
ili9341ILI9341 LCD driverUsed for controlling the LCD display
xpt2046XPT2046 touch controllerUsed for controlling the touch screen
bmp280BMP280 driverUsed for controlling the BMP280 sensor
dht22-driverDHT22 driverUsed for controlling the DHT22 sensor
ds323xDS3231 driverUsed for controlling the DS3231 sensor