Differences

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

Link to this comparison view

iothings:proiecte:2021:airqualityedgeimpulse [2022/01/23 22:11]
alexandra.covor [Introduction]
iothings:proiecte:2021:airqualityedgeimpulse [2022/01/25 22:11] (current)
alexandra.covor [Hardware Description]
Line 1: Line 1:
 ====== Air Quality Monitoring Using Edge Impulse ​ ====== ====== Air Quality Monitoring Using Edge Impulse ​ ======
 +
 +Author: Covor Alexandra, ACES
  
 Project repository: [[https://​github.com/​Alexandra182/​AirQuality-EdgeImpulse-ESP32]] Project repository: [[https://​github.com/​Alexandra182/​AirQuality-EdgeImpulse-ESP32]]
 +
 +Demo video: [[https://​www.youtube.com/​watch?​v=48sH_nrRz8E]]
  
 ===== Introduction ===== ===== Introduction =====
Line 18: Line 22:
   * LED - connected to a PWM pin of the ESP32.   * LED - connected to a PWM pin of the ESP32.
  
 +{{:​iothings:​proiecte:​2021:​alexandra_c:​circuit.jpeg?​400|}}
 ==== Wiring ==== ==== Wiring ====
  
Line 27: Line 32:
  
 The ESP32 development board is not officially supported by Edge Impulse, but their [[https://​docs.edgeimpulse.com/​docs/​porting-guide|Porting guide]] provides instructions on how to connect it to the platform. The first option to do this, and also the fastest and easiest to implement, is the Data Forwarder, which allows collecting data from the development board over a serial connection. The second option, and the one I chose to implement in this project, is sending data remotely, directly from the device, using the [[https://​docs.edgeimpulse.com/​reference/​ingestion-api|Ingestion API]] and (optionally) the [[https://​docs.edgeimpulse.com/​reference/​remote-management|Remote management protocol]]. ​ The ESP32 development board is not officially supported by Edge Impulse, but their [[https://​docs.edgeimpulse.com/​docs/​porting-guide|Porting guide]] provides instructions on how to connect it to the platform. The first option to do this, and also the fastest and easiest to implement, is the Data Forwarder, which allows collecting data from the development board over a serial connection. The second option, and the one I chose to implement in this project, is sending data remotely, directly from the device, using the [[https://​docs.edgeimpulse.com/​reference/​ingestion-api|Ingestion API]] and (optionally) the [[https://​docs.edgeimpulse.com/​reference/​remote-management|Remote management protocol]]. ​
-Using the Remote management protocol, I first opened a WebSocket connection from the ESP32 to **[[ws://​remote-mgmt.edgeimpulse.com]]** and I sent a JSON-encoded Hello request:+After creating a project on Edge Impulse, using the Remote management protocol, I first opened a WebSocket connection from the ESP32 to **[[ws://​remote-mgmt.edgeimpulse.com]]** and I sent a JSON-encoded Hello request:
  
 <​code>​ <​code>​
Line 140: Line 145:
  
 The last step was to deploy the trained model to the ESP32 development board. From the Deployment menu on Edge Impulse, I downloaded the Arduino library with the trained model and added it to my project. The last step was to deploy the trained model to the ESP32 development board. From the Deployment menu on Edge Impulse, I downloaded the Arduino library with the trained model and added it to my project.
-I used the instructions and the code sample provided [[https://​docs.edgeimpulse.com/​docs/​running-your-impulse-arduino|here]] and [[https://​docs.edgeimpulse.com/​docs/​cli-data-forwarder#​classifying-data-arduino|here]] to feed data from the air quality sensor to the classifier network. Also, in order to visualise the sensor readings and the inference output, I used [[https://​randomnerdtutorials.com/​esp32-plot-readings-charts-multiple/​|this]] tutorial to implement a webpage running on the ESP32. ​+I used the instructions and the code sample provided [[https://​docs.edgeimpulse.com/​docs/​running-your-impulse-arduino|here]] and [[https://​docs.edgeimpulse.com/​docs/​cli-data-forwarder#​classifying-data-arduino|here]] to feed data from the air quality sensor to the classifier network. Also, in order to visualise the sensor readings and the inference output, I used [[https://​randomnerdtutorials.com/​esp32-plot-readings-charts-multiple/​|this]] tutorial to implement a webpage running on the ESP32. ​For implementing the webpage used for configuring the WiFi connection, I used [[https://​randomnerdtutorials.com/​esp32-wi-fi-manager-asyncwebserver/​|this tutorial]].  
 The full code can be found in the [[https://​github.com/​Alexandra182/​AirQuality-EdgeImpulse-ESP32/​blob/​main/​inference_web_server/​inference_web_server.ino|inference_web_server.ino]] file.  The full code can be found in the [[https://​github.com/​Alexandra182/​AirQuality-EdgeImpulse-ESP32/​blob/​main/​inference_web_server/​inference_web_server.ino|inference_web_server.ino]] file. 
  
-{{:​iothings:​proiecte:​2021:​alexandra_c:​10.png?750|}}+The user has to connect to the Access Point named ESP-WIFI-MANAGER,​ access the following IP from a web browser: 192.168.4.1,​ and fill in the SSID and the password of the network: 
 + 
 +{{:​iothings:​proiecte:​2021:​alexandra_c:​11.png?​750|}} 
 + 
 +The next step is connecting to the WiFi network and accessing the previously assigned IP from a web browser, which will display the Air Quality dashboard:​ 
 + 
 +{{:​iothings:​proiecte:​2021:​alexandra_c:​12.png?750|}}
  
 Below is the logic diagram of the Arduino program: Below is the logic diagram of the Arduino program:
  
-{{:​iothings:​proiecte:​2021:​alexandra_c:​inference-web.drawio.png?|}}+{{:​iothings:​proiecte:​2021:​alexandra_c:​logic_diagram_3.png?|}}
  
-The **inference_web_server.ino** file contains the **getSensorReadings()** function, which constructs a JSON file with the sensor readings and the inference result: ​+The **inference_web_server.ino** file contains the **getSensorReadings()** function, which constructs a JSON object ​with the sensor readings and the inference result: ​
  
 <code c> <code c>
Line 255: Line 267:
 } }
 </​code>​ </​code>​
-==== Conclusions ====+===== Conclusions ​=====
  
 Future improvements to the project include gathering more data in order to properly train the model, as the current implementation is more of a proof of concept, and implementing alerts when anomalies in the data are detected. Future improvements to the project include gathering more data in order to properly train the model, as the current implementation is more of a proof of concept, and implementing alerts when anomalies in the data are detected.
Line 276: Line 288:
   - [[https://​github.com/​edgeimpulse/​ingestion-sdk-c|Edge Impulse C Ingestion SDK]]    - [[https://​github.com/​edgeimpulse/​ingestion-sdk-c|Edge Impulse C Ingestion SDK]] 
   - [[https://​github.com/​rafaelbidese/​ei-projects|Edge Impulse C Ingestion SDK Samples]] ​   - [[https://​github.com/​rafaelbidese/​ei-projects|Edge Impulse C Ingestion SDK Samples]] ​
 +  - [[https://​github.com/​me-no-dev/​ESPAsyncWebServer|ESPAsyncWebServer]]
 +  - [[https://​github.com/​me-no-dev/​AsyncTCP|AsyncTCP]]
  
 ==== Others ==== ==== Others ====
   - [[https://​randomnerdtutorials.com/​esp32-plot-readings-charts-multiple/​|ESP32 Plot Sensor Readings in Charts (Multiple Series)]] ​   - [[https://​randomnerdtutorials.com/​esp32-plot-readings-charts-multiple/​|ESP32 Plot Sensor Readings in Charts (Multiple Series)]] ​
 +  - [[https://​randomnerdtutorials.com/​esp32-wi-fi-manager-asyncwebserver/​|ESP32:​ Create a Wi-Fi Manager (AsyncWebServer library)]]
  
  
iothings/proiecte/2021/airqualityedgeimpulse.1642968704.txt.gz · Last modified: 2022/01/23 22:11 by alexandra.covor
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