How to Use a MiCS5524 Sensor to Monitor Indoor Air Quality
2021-10-27 | By Maker.io Staff
The MICS5524 is an incredibly simple to use and robust sensor for detecting the occurrence of various VOCs (Volatile Organic Compounds) and a variety of natural gasses, such as Carbon Monoxide (CO). This article gives a short overview of the sensor and its typical operating characteristics. It also discusses the Adafruit MICS5524 sensor breakout board, which simplifies using this handy gas sensor in your next project.
MICS5524 Characteristics and Typical Applications
Typical applications for the MICS5524 include indoor air quality monitoring, gas leakage detection, carbon monoxide warning systems, early fire and smoke detection, and measuring alcohol concentrations in the environment (e.g., for breathalyzer testing).
The Adafruit MICS5524 breakout board combines all required components on a tiny PCB that you can easily mount in a wide variety of projects.
Note that this sensor breakout board is not for use in safety-critical and medical applications — it is calibrated for DIY and maker projects. The sensor can detect carbon monoxide, ammonia, ethanol, hydrogen, methane, propane, and isobutane, reacting to the various gases with different sensitivity levels. The device can’t tell which particular chemical compound is detected, so it’s best to use the sensor in a well-known environment or as a measure to detect harmful gasses in general. For example, the sensor is ideal for detecting breath alcohol levels when used in a breathalyzer test, as the detection will most likely indicate the presence (or absence) of ethanol.
The sensor cannot tell which gas is detected — it can only detect the presence of certain gasses in the environment. You can find the sensor's sensitivity for each gas on the backside of the PCB.
You may need to calibrate the sensor when you intend to use it in an area with a high concentration of one of the previously mentioned chemical compounds. A fermentation tank is one such example. In this case, the gasses within the tank saturate the air, and the sensor will become less and less sensitive to changes over a long period. Note that this is a special application, and the sensor comes pre-calibrated from the factory. The device could be damaged by water, dirt, or prolonged exposure to smoke, as it might introduce impurities in the sensor. Please refer to the datasheet for more details about the calibration process and sensor characteristics.
How to Connect the MICS5524 to an Arduino
Connecting the MICS5524 sensor to an Arduino, for example, is easy to do. The breakout board only requires a 5V power supply and a connection to GND. It has an optional active-low enable input. The sensor is active as long as this input pin is pulled low or left floating. Pulling this pin high (to +5V) deactivates the sensor’s internal heating element and thus disables the sensor itself. Doing so can help conserve energy. However, keep in mind that the sensor will require a short warm-up time of around five seconds when turned on.
The breakout board contains a single analog output line corresponding to the concentration of one of the previously discussed chemical compounds in the air. Note that the sensor response is non-linear. Due to the previously mentioned saturation effect, the sensor’s response is stronger at low concentrations. You only need to connect this single output line to any analog input pin of your Arduino:
The Adafruit MICS5524 breakout board only requires you to connect three wires to use it with an Arduino.
A Simple Test Script
Thanks to the simple nature of the breakout board, the test script is also relatively short. All you must do to use this sensor in your projects is include a single analog input check. The program can then perform an action, such as turning on an LED, when the sensor reports a value above a certain threshold:
#define THRESHOLD 512 #define LED 13 unsigned long lastRequest = 0; void setup() { // Open a serial connection for debugging Serial.begin(9600); Serial.println("MiCS-5524 demo!"); // Pin 13 is connected to the internal LED on the // Arduino UNO pinMode(LED, OUTPUT); } void loop() { if(millis() - lastRequest > 100) { lastRequest = millis(); // Read the sensor value int sensor_value = analogRead(A0); // Print the value to the serial console Serial.println(sensor_value); // Turn on the LED if the reading exceeds a // certain threshold value (defined above). analogWrite(LED, (sensor_value > THRESHOLD)); } }
Summary
The MICS5524 is an incredibly simple yet powerful gas sensor that can detect multiple harmful chemical compounds in the air. Because this sensor can’t tell which particular gas is detected, it’s best used in a well-known environment where you know which gas to expect. This sensor is more responsive to low concentrations of these gases in the air because of a saturation effect. You can tackle this by performing multiple calibrations over an extended period. See the official datasheet for further details.
In pictures, it's sometimes hard to tell how large or small an object is. This image shows the MICS5524 breakout next to a one-dollar coin. The PCB is about the same size as the coin.
Connecting the sensor to an Arduino is incredibly simple. You only need to supply the breakout board with a +5V supply and a ground connection. The breakout board has a single analog output that corresponds to the measured gas concentration in the air. You can use an optional input to deactivate the sensor and conserve energy in mobile applications.
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum