Differences

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

Link to this comparison view

iothings:proiecte:2021:gasdetector [2022/01/20 21:23]
narcisa.guran
iothings:proiecte:2021:gasdetector [2022/01/24 15:47] (current)
narcisa.guran
Line 1: Line 1:
-====== Smoke/ Gas detector ======+====== Smoke/Gas detector ====== 
 + 
 +Author: Narcisa Guran \\ 
 +Source code on Github: https://​github.com/​narcisaguran/​gas-sensor-using-esp32 \\ 
 +Youtube video: https://​www.youtube.com/​watch?​v=R_Ayc8Ipyoc
  
 ===== Description ===== ===== Description =====
Line 7: Line 11:
 ===== Hardware Implementation ===== ===== Hardware Implementation =====
 The hardware schematic contains the following devices: \\ \\ The hardware schematic contains the following devices: \\ \\
- - ESP32-WROOM-32 (integrated Wifi and Bluetooth) \\ + - ESP32-WROOM-32 (integrated Wifi and Bluetooth), ADC with 12-bits resolution (values between 0-4095) \\ 
- - MQ-2 Smoke/​Combustible Gas sensor \\+ - MQ-2 Smoke/​Combustible Gas sensor. For this application we will use the analog output (AO) pin to measure the gas level in the room. \\
  - 5V battery, or any device that can provide 5V (e.g. Arduino Uno 5V pin) \\ \\  - 5V battery, or any device that can provide 5V (e.g. Arduino Uno 5V pin) \\ \\
  
Line 28: Line 32:
 ===== Wifi Connection ===== ===== Wifi Connection =====
  
-The Wifi connection is set up using Bluetooth using Bluetooth Teminal HC-5 application. ​+The Wifi connection is set up using Bluetooth using Bluetooth Teminal HC-5 application. ​[1] \\
 First connect to the Bluetooth device using the app and give Wifi credentials (SSID and password). After that the Wifi connection is established and the Bluetooth connection is disabled. Wifi and Bluetooth use the same antenna on ESP32 devices and they cannot coexist. The Wifi credentials are saved and loaded every time the ESP device is powered. ​ First connect to the Bluetooth device using the app and give Wifi credentials (SSID and password). After that the Wifi connection is established and the Bluetooth connection is disabled. Wifi and Bluetooth use the same antenna on ESP32 devices and they cannot coexist. The Wifi credentials are saved and loaded every time the ESP device is powered. ​
 If you want to change the credentials just reboot the device and introduce them again in application. If you want to change the credentials just reboot the device and introduce them again in application.
  
 {{ :​iothings:​proiecte:​2021:​narcisag:​bluetooth_app.jpg?​400 |}} {{ :​iothings:​proiecte:​2021:​narcisag:​bluetooth_app.jpg?​400 |}}
 +
 +\\
 +The EEPROM (electrically erasable programmable read-only memory) saves the last introduced Wifi credentials until new ones are introduced in app and tries to connect to them when device is booted.
  
 ===== ThingSpeak Data Ingestion ===== ===== ThingSpeak Data Ingestion =====
Line 39: Line 46:
 {{ :​iothings:​proiecte:​2021:​narcisag:​thingspeak_app.jpg?​400 |}} {{ :​iothings:​proiecte:​2021:​narcisag:​thingspeak_app.jpg?​400 |}}
  
-{{ :​iothings:​proiecte:​2021:​narcisag:​thingspeak_web.jpg?​400 |}}+{{ :​iothings:​proiecte:​2021:​narcisag:​thingspeak_web.jpg?​700 |}} 
 + 
 +===== Email Alert ===== 
 + 
 +The project has the feature to send an alert email to the apartment owner using IFTTT service. [2] \\ The email address is hardcoded in the json that is sent by the http post request via Webhook. 
 +A gmail address was created prior to sending the alert. This is the email address used to send messages to the hardcoded owner address. 
 + 
 +===== Conclusions ===== 
 + 
 +This project is a good application to monitor the gas level in a room. You have the possibility to view in real time the values collected by  the sensor via ThingSpeak platform service and to receive an email alert if the threshold has been exceeded. Also, you have the possibility to connect to Wifi from any place because the SSID and password are not hardcoded in the source code. You can connect to the device via Bluetooth prior to a Wifi connection and set-up the credentials. \\ 
 +For IoT beginners it is a good way to start. The project is rather simple when it comes to hardware, but it focuses more on the connectivity and infrastructure side making it more reliable and easy to use. 
 + 
 +===== Further Improvements ===== 
 + 
 +It will be interesting to have all setup done with a configuration file (json) sent via an application from smartphone and to set the Wifi credentials along with the email address and ThingSpeak channel information and not have them hardcoded.  
  
 ===== Resources ===== ===== Resources =====
 +[1] https://​robotzero.one/​esp32-wi-fi-connection-bluetooth/​ \\
 +[2] https://​www.circuitbasics.com/​how-to-send-a-text-message-with-ifttt/​ \\
 +
  
iothings/proiecte/2021/gasdetector.1642706621.txt.gz · Last modified: 2022/01/20 21:23 by narcisa.guran
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