CO2 Gas Sensor Breakout Board w/ UART & PWM Output - MH-Z19
-
RM175.00
- Product Code: MH-Z19
- Availability: In Stock
MH-Z19 NDIR infrared gas module is a common type, small size sensor, using non-dispersive infrared (NDIR) principle to detect the existence of CO 2 in the air, with good selectivity, non-oxygen dependent and long life. The built-in temperature sensor can do temperature compensation; it has digital output an analog voltage output.
It is developed by the tight integration of mature infrared absorbing gas detection technology, precision optical circuit design, and superior circuit design.
Applications
HVAC, building ventilation system, indoor air quality monitoring system
Features
Specification
Here is a simple diagram of how your sensor should be wired to your Arduino.
Gas Sensor Module | Arduino Pin |
VCC | 5V |
Ground | GND |
DO | - |
AO | A0 |
We also wanted to convert the voltage readings of 0-1023 from the sensor to a 0.0-5.0 value which would reflect the true voltage being read.
Run this code to your Arduino and you will be ready to detect changes in the level of detectable gasses!
const int gasSensor =0; void setup() { Serial.begin(9600); // sets the serial port to 9600 } void loop() { float voltage; voltage = getVoltage(gasSensor); Serial.println(voltage); delay(1000); } float getVoltage(int pin) { return (analogRead(pin) * 0.004882814); // This equation converts the 0 to 1023 value that analogRead() // returns, into a 0.0 to 5.0 value that is the true voltage // being read at that pin. }
Notes:
- After doing some research about this sensor it was discovered that while the MQ-135 can detect all of the gasses listed above, it cannot distinguish between them. If you are looking to specifically target one gas, it might be better to find a different sensor.
- This sensor also needs uses a heater to warm up the sensor. It has been advised to not use this with a small battery source as it will quickly drain your battery.
Tags: Gas Sensor