Interface MQ135 (Gas Sensor) with NodeMCU
In this Tutorial we will learn how to Interface MQ135 (Gas Sensor) with NodeMCU. We need Arduino IDE and MQ Sensor only for this tutorial. This is simple tutorial. We print ppm and rzero value on serial console only.
MQ 135 Sensor used for monitor the air quality especially CO2 with NodeMCU as microcontroller. You need MQ135 library and little modification to connect internet.
You may like also: Using Mq135 Sensor with InfluxDB
Hardware Required:
- NodeMCU
- MQ135 Sensor
- Breadboard
- Micro USB cable
- Connecting Wires
Software Required:
- Arduino IDE (with ESP8266 Library installed) Visit this : Arduino Support for ESP8266 with simple test code
Connection beetwen NodeMCU to MQ135
Connect NodeMCU GND to MQ135 GND
Connect NodeMCU VIN (5V) to MQ135 VCC
Arduino Sketch for Interface MQ135 (Gas Sensor) with NodeMCU
#include "MQ135.h" #define ANALOGPIN A0 MQ135 gasSensor = MQ135(ANALOGPIN); void setup() { // put your setup code here, to run once: Serial.begin(115200); } void loop() { // put your main code here, to run repeatedly: float rzero = gasSensor.getRZero(); //this to get the rzero value, uncomment this to get ppm value float ppm = gasSensor.getPPM(); // this to get ppm value, uncomment this to get rzero value Serial.println(rzero); // this to display the rzero value continuously, uncomment this to get ppm value Serial.println(ppm); // this to display the ppm value continuously, uncomment this to get rzero value }
Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog.
You may like also:
- Dynamic WLAN configuration for ESP32 Board | AutoConnect
- ESP32 BLE on Arduino IDE with UART Test
- ESP32 Bluetooth Low Energy (BLE) on Arduino IDE
- ArduinoOTA ESP32: Wi-Fi (OTA) Wireless Update from the Arduino IDE
- ESP32 with LoRa using Arduino IDE
- How To Use Grove-LCD RGB Backlight with NodeMCU
- NodeMcu to DHT Interface in Blynk app
- How To ON/OFF a bulb by Google voice assistant
- Arduino IDE | Arduino | Open Source Hardware/Softawre | Arduino Vs RPi
- WiFi LoRA 32 (V2) ESP32 | Overview | Introduction
- DHT11 sensor with ESP8266/NodeMCU using Arduino IDE
- Arduino Support for ESP8266 with simple test code
Pingback: MQ Gas Sensors | Gas Sensors ? - IoTbyHVM - Bits & Bytes of IoT