LUA library for reading values from MQ-135 air quality sensor via ESP8266 with NodeMCU
As I didn't find any library for accessing the MQ-135 measurements with LUA I wrote this library with is essentially a copy of the C library from GeorgK for Arduino.
This library has been tested with the MQ-135 sensor board by Flying-Fish which contains a resistor and a digital output.
Simply connect the board (1) to the NodeMCU (2) unit ike this:
- GND to GND
- VCC to 3V3
- AO to AO
Before you can use the sensor you are advised to "burn in" the sensor by having it powered on for 24 hours. After this time use the calibrate.lua script to get an average value for RZero after putting the board outside for 30 to 60 minutes and writing down the average RZero value shown.
Just check the MeasureAirQuality.lua script on how to use it. You don't have to modify the library as you can simply override the default values for your sensor programmatically.