Skip to content

henryd24/esp32_mq2sensor_mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 GAS MONITORING

About

This code allows to monitor gas emissions thanks to the MQ2 sensor. The gases that are measured with this sensor are:

  • CO
  • LPG
  • CH4
  • Propane
  • Smoke

This is done by means of the interpolation that is done thanks to the graph given by the manufacturer.

MQ2 Gas Sensor Graph

In MQ2_data can see this process.

Scheme

MQ2 Gas Sensor Graph

MQ2 Gas Sensor Graph

If you use another PIN modify this in main.py the variable called mq2pinSignal

Settings

Para que este funcione, se debe modificar el archivo settings.json con los valores para que funcione correctamente, estos valores son:

{
    "ssid": "",
    "password_wlan": "",
    "mqtt_user": "",
    "mqtt_password": "",
    "mqtt_server": "",
    "mqtt_port": 1883,
    "mqtt_topic": ""
}
  • ssid : Name of the network to which the ESP32 will connect.
  • password_wlan : Network password.
  • mqtt_user : User to connect to the MQTT server.
  • mqtt_password : Password to connect to the MQTT server.
  • mqtt_server : Hostname of the server on which we have the MQTT service.
  • mqtt_port : Port on which the MQTT server listens.
  • mqtt_topic : Topic to which we will publish the data.

About

Read data from MQ2 sensor and send to a MQTT server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages