Differences

This shows you the differences between two versions of the page.

Link to this comparison view

iothings:proiecte:2022sric:airqualitysystem [2023/06/01 18:40]
ioan_marian.dan [Air Quality Monitoring System]
iothings:proiecte:2022sric:airqualitysystem [2023/06/02 03:19] (current)
ioan_marian.dan [Hardware Description]
Line 1: Line 1:
-====== Air Quality Monitoring System ======+====== Air Quality Monitoring System ​using BMP280 Sensor ​======
  
 Ioan-Marian Dan-Hariton - SRIC Ioan-Marian Dan-Hariton - SRIC
  
 +Demo: [[https://​youtu.be/​MTQ_KuXFTSU]]
 ==== Project Description ==== ==== Project Description ====
  
Line 18: Line 19:
   * **OLED 0.96” Screen**: an OLED screen which has a reduced energy consumption,​ only 0.08W. The interface type is IIC;   * **OLED 0.96” Screen**: an OLED screen which has a reduced energy consumption,​ only 0.08W. The interface type is IIC;
   * **Buzzer module**: just a regular buzzer which operates on 3.3V or 5V and which has an I/O interface.   * **Buzzer module**: just a regular buzzer which operates on 3.3V or 5V and which has an I/O interface.
-ESP32 specifications:​+WEMOS LOLIN32 ​ESP32 specifications:​
   * Single or Dual-Core 32-bit LX6 Microprocessor with clock frequency up to 240MHz.   * 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.   * 520 KB of SRAM, 448 KB of ROM and 16 KB of RTC SRAM.
Line 44: Line 45:
   * I/O interface   * I/O interface
  
 +{{:​iothings:​proiecte:​2022sric:​general_connections.jpg?​200|}}
  
 In order to connect all the components to the ESP32, we used in most part the SCL/22 and SDA/21 pins on the board. For connecting each component to board we did the following configuration:​ In order to connect all the components to the ESP32, we used in most part the SCL/22 and SDA/21 pins on the board. For connecting each component to board we did the following configuration:​
Line 61: Line 63:
   * I/O pin of the buzzer to GPIO 14 pin of ESP32   * I/O pin of the buzzer to GPIO 14 pin of ESP32
  
 +At first, the board was a little bit tricky because when I wanted to upload the code on it, there was an error **"​Wrong boot mode detected"​**. I searched for this error on google and I found a documentation which says:
 +
 +//"​Depending on the kind of hardware you have, it may also be possible to **manually put your ESP32 board into Firmware Download mode** (reset).
 +
 +For development boards produced by Espressif, this information can be found in the respective getting started guides or user guides. ​
 +For example, to manually reset a development board, hold down the Boot button (**GPIO0**) and press the EN button (EN (CHIP_PU)).
 +For other types of hardware, try pulling **GPIO0** down."//​
 +
 +As the board I used, WEMOS LOLIN32, has just one **Reset** button and not 2 buttons (Boot and EN), I had to pull the **GPIO0** pin down (connect it to **GND** on the board) and then, after I pressed the **Upload** button in the Arduino IDE, I had to hold the **Reset** button until it appeared **Connecting...** in Arduino'​s console. After that, when I wanted to test the code uploaded on the board, I had to disconnect the **GPIO0** pin from **GND**. This had to be done every time I uploaded a new version of code.
  
  
Line 68: Line 79:
 ==== Software Description ==== ==== Software Description ====
  
-In the setup() function, there is the code for connecting to Wi-Fi and also the pin declaration for the buzzer:+For this to work, I had to set manually the I2C Address for the BMP280 sensor. Even if the object mySensor seems to be a BME280 instead of a BMP280, it still works as they are almost the same, the BME280 also reads humidity:  
 +<​code>​ 
 +BME280 mySensor; 
 +mySensor.setI2CAddress(0x76);​ 
 +</​code>​ 
 + 
 +Also, another definitions are the ones for the screen and for the buzzer: 
 +<​code>​ 
 +#define SCREEN_ADDRESS 0x3C 
 +#define BUZZER_PIN 14 
 +</​code>​ 
 + 
 +In the **setup()** function, there is the code for connecting to Wi-Fi and also the pin declaration for the buzzer:
  
 <​code>​ void setup() <​code>​ void setup()
Line 90: Line 113:
 </​code>​ </​code>​
  
-        ​Also there is the function which displays the text on the screen:+Also there is the function which displays the text on the screen:
  
 <​code>​ void testscrolltext(String pressure, String alt, String temp) { <​code>​ void testscrolltext(String pressure, String alt, String temp) {
Line 105: Line 128:
 } </​code>​ } </​code>​
  
-  ​In the loop() function there is a part where the html page is created:+In the **loop()** function there is a part where the html page is created:
   ​   ​
 <​code>​ if (currentLine.length() == 0) { <​code>​ if (currentLine.length() == 0) {
Line 120: Line 143:
             ​             ​
             client.println("<​body><​h1>​BMP280 Sensor Data</​h1>"​);​             client.println("<​body><​h1>​BMP280 Sensor Data</​h1>"​);​
-            //​Serial.println(pressure + " " + alt + " " + temp); 
             ​             ​
             testscrolltext(pressure,​ alt, temp);             testscrolltext(pressure,​ alt, temp);
Line 153: Line 175:
             client.println();​             client.println();​
  </​code>​  </​code>​
 +
 +I had some difficulties synchronising the data that is showed on the web page with the one showed on the display, so values which are present on the display may differ from the values on the webpage.
 +
 +The idea is that, because of the connection to the internet, the data is sent later to the web page, compared to the display where it is sent almost instantly.
  
 For the development of this project, the following libraries have been used: For the development of this project, the following libraries have been used:
-- SparkFunBME280.h is used to initialise the BMP280 sensor and read the temperature,​ pressure, altitude parameters. For reading the parameters, the following functions are used: readFloatPressure(),​ readFloatAltitudeMeters(),​ readTempC() +  * **SparkFunBME280.h** is used to initialise the BMP280 sensor and read the temperature,​ pressure, altitude parameters. For reading the parameters, the following functions are used: **readFloatPressure()****readFloatAltitudeMeters()****readTempC()**. 
-- Wifi.h - it is used to connect to Wifi and create the web page +  * **Wifi.h** - it is used to connect to Wifi and create the web page. 
-- Adafruit_SSD1306.h is used to initialise the OLED Screen and for displaying text on it, we must println() on the display and then call the display() function to actually display the text.+  * **Adafruit_SSD1306.h** is used to initialise the OLED Screen and for displaying text on it, we must println() on the display and then call the display() function to actually display the text.
  
 ---- ----
Line 166: Line 192:
 In conclusion, the scope of this project was to create an air quality monitoring system, by reading environment parameters such as temperature,​ pressure, altitude and send them to a web page and on a display. Also, the buzzer will make a sound when the temperature is above 29°C. In conclusion, the scope of this project was to create an air quality monitoring system, by reading environment parameters such as temperature,​ pressure, altitude and send them to a web page and on a display. Also, the buzzer will make a sound when the temperature is above 29°C.
  
 +{{:​iothings:​proiecte:​2022sric:​display_values.jpeg?​300|}}
 +{{:​iothings:​proiecte:​2022sric:​web_page_values.png?​400|}}
  
 ---- ----
Line 171: Line 199:
 === Bibliography === === Bibliography ===
  
-[[https://​randomnerdtutorials.com/​esp32-with-bmp180-barometric-sensor/]] +  * [[https://​cleste.ro/​placa-dezvoltare-nodemcu-wifi-bluetooth-esp32.html]] 
-[[https://​randomnerdtutorials.com/​esp32-web-server-arduino-ide/​]] +  * [[https://​cleste.ro/​modul-senzor-de-presiune-atmosferica-bmp280.html]] 
-[[https://www.electronicshub.org/getting-started-with-esp32/]] +  * [[https://​cleste.ro/​ecra-oled-0-96-inch.html]] 
-[[https://www.apogeeweb.net/circuitry/bmp180-pinout-feature-specification.html]]+  * [[https://​cleste.ro/​modul-buzzer.html]] 
 +  * [[https://​randomnerdtutorials.com/​esp32-pinout-reference-gpios/]] 
 +  * [[https://​randomnerdtutorials.com/​esp32-adc-analog-read-arduino-ide/]] 
 +  ​* ​[[https://​randomnerdtutorials.com/​esp32-web-server-arduino-ide/​]] 
 +  ​* ​[[https://randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/]] 
 +  ​* ​[[https://docs.espressif.com/projects/esptool/​en/​latest/​esp32/​advanced-topics/boot-mode-selection.html?​highlight=manual%20boot]] 
 + 
 + 
 +---- 
  
  
iothings/proiecte/2022sric/airqualitysystem.1685634012.txt.gz · Last modified: 2023/06/01 18:40 by ioan_marian.dan
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