Air Quality Monitoring System

Mihaela Florescu - AAC

Project Description

The scope of this project is to create an air quality monitoring system using an ESP32 board and a BMP180 sensor. This system will check some environment parameters such as temperature, pressure, altitude and humidity. These values read by the sensor will be send to a web page.


Hardware Description

In order to develop this project, the following components have been used: ESP32 MCU, BMP180 sensor, breadboard and jumper wires.

  • ESP32 is a low-power system on a chip microcontroller with integrated Wi-Fi and dual-mode Bluetooth.
  • BMP180 is an atmospheric sensor. It is ideal for measuring temperature, pressure, altitude and humidity. It is low power consumption (3uA) and can work on low voltages. The sensor used for this project has 4 pins: VCC, GND and I2C Interface pins - SDA (Serial Data pin) and SCL (Serial Clock pin).

ESP32 specifications:

  • Single or Dual-Core 32-bit LX6 Microprocessor with clock frequency up to 240MHz.
  • 520 KB of SRAM, 448 KB of ROM and 16 KB of RTC SRAM.
  • Supports 802.11 b/g/n Wi-Fi connectivity with speeds up to 150 Mbps.
  • Support for both Classic Bluetooth v4.2 and BLE specifications.
  • 34 Programmable GPIOs.

BMP180 senzor specifications:

  • Operating voltage: 1.3V – 3.6V
  • Input voltage: 3.3V to 5.5V
  • Peak current: 1000uA
  • Consumes 0.1uA standby
  • Maximum voltage at SDA, SCL : VCC + 0.3V
  • Operating temperature: -40ºC to +80ºC

In order to connect the sensor to the ESP32 board, the following pins need to be linked:

  • VIN pin of BMP180 must be connected to VIN pin of ESP32
  • GND pin of BMP180 must be connected to any GND pin of ESP32
  • SDA pin of BMP180 must be connected to GPIO 21 of ESP32 (which is marked as P21 on the board)
  • SCL pin of BMP180 must be connected to GPIO 22 of ESP32 (which is marked as P22 on the board)


Software Description

The software part of this project is divided in 2 main functions:

  • setup() function - code from here is executed once. In this part of the code, the following functions are called:
    1. initWifi() - this method initializes the WiFi connection and returns the IP Address where the web page is located.
 void initWifi()
{
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  Serial.print("Connecting to WiFi ..");
  while (WiFi.status() != WL_CONNECTED)
  {
    Serial.print('.');
    delay(1000);
  }
  Serial.println(WiFi.localIP());
} 
  1. initBmp() - this method initializes the BMP180 sensor
 void initBmp()
{
  if (!bmp.begin()) 
  {
    Serial.println("BMP180 sensor not found");
  }
} 
  • loop() function - code from here is executed forever, in a loop. In this part of the code, the web page is created and the environment parameters are read.

For the development of this project, the following libraries have been used:

  • Wifi.h - it is used to connect to Wifi and create the web page
  • Adafruit_BMP085.h - it is used to initialise the BMP180 sensor and read the temperature, pressure, humidity parameters. For reading these parameters, the following methods from this library have been used: readTemperature(), readPresure(), readHumidity.
#include <WiFi.h>
#include <Adafruit_BMP085.h>

Conclusion

In conclusion, the scope of this project was to create an air quality monitoring system, by reading some environment parameters such as temperature, pressure, altitude, humidity and send them to a web page.


Bibliography

iothings/proiecte/2021/airqualitymonitoringsystem.txt · Last modified: 2022/01/27 22:05 by mihaela.florescu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0