Interfacing MiCS-5524 CO, Alcohol, VOC Gas Sensor with Arduino
Interfacing MiCS-5524 CO, Alcohol, VOC Gas Sensor with Arduino to measure carbon monoxide, acetone, formaldehyde with Arduino C++ Code
- Suitable forB.Tech/Diploma Arduino students
- Build time1-2 weeks
- LevelBeginner
- Available atAjvika Labs, Kakinada
About this project
Overview
In this tutorial, we will be interfacing the MiCS-5524 CO, Alcohol, and VOC Gas Sensor Module with Arduino. The MiCS-5524 sensor uses MEMS technology to detect Gas concentration or gas leakage of CO, CH4, C2H5OH, C3H8, C4H10, H2, H2S, NH3, etc.
Earlier we used gas sensors like
CCS811
SGP30
BME680
MQ-135
, and
PMS5003
, etc to measure different gas concentrations, Volatile organic compounds & particulate matter concentrations. However one of the advantages of MiCS-5524 is that it can detect and measure the concentrations of potentially hazardous gases. Using the data, you can create a safety system.
Bill of Materials
Following are the components required for this tutorial.
S.N.
Components
Quantity
Purchase Link
Arduino Nano Board
Amazon
AliExpress
MiCS-5524 Sensor Module
Amazon
AliExpress
Jumper Wires
Amazon
AliExpress
Breadboard
Amazon
AliExpress
MiCS5524 CO, Alcohol and VOC Gas Sensor Module
The MiCS-5524 Gas Sensor Module is an advanced sensing device engineered to detect a range of gaseous substances in various environments.
At the core of this module is a highly sensitive metal oxide semiconductor (MOS) layer that is specifically designed to respond to gases such as carbon monoxide, alcohol, acetone, formaldehyde, and hydrogen. This sensitivity makes the MiCS-5524 a versatile tool in numerous safety-related and air quality monitoring applications.
The module’s compact size facilitates easy integration into different hardware configurations, making it ideal for both residential and industrial setups. Its low power requirements are an additional benefit, promoting prolonged operation which is crucial for continuous monitoring tasks.
Whether integrated into home safety alarms, incorporated into smart home systems, or used in industrial air quality management, the MiCS-5524 delivers reliable and accurate gas detection, making it an essential component in any project aimed at enhancing safety and monitoring air quality. Check
MiCS-5524 Datasheet
for more information.
Features & Specifications of MiCS5524
Operating Voltage
: 4.9 to 5.1V DC
Power Dissipation
: 0.45W
Output Type
: Analog signal
Measuring Ranges
:
Carbon Monoxide (CO): 1 – 1000 ppm
Ethanol (C2H5OH): 10 – 500 ppm
Hydrogen (H2): 1 – 1000 ppm
Ammonia (NH3): 1 – 500 ppm
Methane (CH4): Above 1000 ppm
Operating Conditions
:
Temperature: -30 to 85°C
Humidity: 5 to 95% RH (non-condensing)
Storage Conditions
:
Temperature: -40 to 85°C
Lifespan
: Over 2 years in air
Physical Dimensions
:
Circuit Board: 12mm x 16mm
Mounting Holes: Inner diameter 2mm, outer diameter 4mm
Weight
: 7 grams
Pinout of MiCS5524
Here’s the pinout for the MiCS-5524 MEMS Gas Sensor Module.
Pin Name
Description
5V
Power supply input; connect to a 5V supply.
GND
Ground pin; connect to the system ground.
A0
Analog Output; outputs a voltage proportional to detected gas concentrations.
EN
Enable pin; use to activate (high) or deactivate (low) the sensor.
Interfacing MiCS-5524 MEMS Gas Sensor Module with Arduino
Now let us interface the MiCS-5524 CO, Alcohol & VOC Gas Sensor with Arduino Board. The following diagram shows how to interface the MiCS-5524 Gas Sensor Module with an Arduino.
Connect the 5V pin on the Arduino to the 5V pin on the MiCS-5524.
Connect from the GND (Ground) pin on the Arduino to the GND pin on the MiCS-5524.
Connect the MiCS-5524’s A0 pin to one of the Arduino’s analog input pins (A0).
Connect the EN (Enable) pin on the MiCS-5524 to a digital pin on the Arduino (D2).
This setup allows the Arduino to power the MiCS-5524 sensor, read its analog output, and control its operation via the EN pin.
Source Code/Program
The sensor uses MEMS technology to support gas concentration detection of CO, CH4, C2H5OH, C3H8, C4H10, H2, H2S and NH3. To read all these values, DFRobot has developed a library. First download the library and add it to the Arduino IDE.
Download:
DFRobot MiCS-5524 Library
Copy the following code and past it on your Arduino IDE.
This Arduino code uses the DFRobot_MICS library to manage and read data from a MICS gas sensor module. It initializes the sensor, checks its power state, and waits for it to warm up. Once initialized, the code continuously measures and displays concentrations of various gases such as carbon monoxide, methane, ethanol, hydrogen, ammonia, and nitrogen dioxide on the serial monitor.
It also includes an option to put the sensor into sleep mode to conserve power after readings, though this feature is commented out by default.
#include "DFRobot_MICS.h"
#define CALIBRATION_TIME 2 // Default calibration time is three minutes
#define ADC_PIN A0 // Analog pin connected to the sensor's analog output
#define POWER_PIN 2 // Digital pin to power the sensor
DFRobot_MICS_ADC
mics
(
ADC_PIN
POWER_PIN
)
;
void
setup
(
)
{
Serial
begin
(
115200
)
;
while
(
!
Serial
)
;
// Wait for serial communication to initialize
// Attempt to initialize the sensor
while
(
!
mics
begin
(
)
)
{
Serial
println
(
"No devices found! Please check the connections."
)
;
delay
(
1000
)
;
}
Serial
println
(
"Device connected successfully!"
)
;
// Check the current power state of the sensor
uint8_t
mode
=
mics
getPowerState
(
)
;
if
(
mode
==
SLEEP_MODE
)
{
mics
wakeUpMode
(
)
;
Serial
println
(
"Sensor woken up successfully!"
)
;
}
else
{
Serial
println
(
"Sensor is already in wake-up mode."
)
;
}
// Wait for the sensor to complete its warm-up time
while
(
!
mics
warmUpTime
(
CALIBRATION_TIME
)
)
{
Serial
println
(
"Please wait until the warm-up time is over!"
)
;
delay
(
1000
)
;
}
Serial
println
(
"Sensor is ready for use."
)
;
}
void
loop
(
)
{
// Read gas data from the sensor
float
coConcentration
=
mics
getGasData
(
CO
)
;
float
ch4Concentration
=
mics
getGasData
(
CH4
)
;
float
c2h5ohConcentration
=
mics
getGasData
(
C2H5OH
)
;
float
h2Concentration
=
mics
getGasData
(
H2
)
;
float
nh3Concentration
=
mics
getGasData
(
NH3
)
;
float
no2Concentration
=
mics
getGasData
(
NO2
)
;
// Print the gas concentrations to the serial monitor
Serial
(
"CO (Carbon Monoxide): "
)
;
Serial
(
coConcentration
)
;
Serial
println
(
" PPM"
)
;
Serial
(
"CH4 (Methane): "
)
;
Serial
(
ch4Concentration
)
;
Serial
println
(
" PPM"
)
;
Serial
(
"C2H5OH (Ethanol): "
)
;
Serial
(
c2h5ohConcentration
)
;
Serial
println
(
" PPM"
)
;
Serial
(
"H2 (Hydrogen): "
)
;
Serial
(
h2Concentration
)
;
Serial
println
(
" PPM"
)
;
Serial
(
"NH3 (Ammonia): "
)
;
Serial
(
nh3Concentration
)
;
Serial
println
(
" PPM"
)
;
Serial
(
"NO2 (Nitrogen Dioxide): "
)
;
Serial
(
no2Concentration
)
;
Serial
println
(
" PPM"
)
;
Serial
println
(
)
;
delay
(
1000
)
;
// Wait for 1 second before the next reading
// Uncomment the line below to put the sensor to sleep mode after each reading
// mics.sleepMode();
}
Upload the above code to your Arduino Board.
Testing the MiCS-5524 Sensor Readings
Typically, the sensor requires a warm-up period (often around 24-48 hours after first powered up) and specific calibration to environmental conditions to ensure accuracy.
Once calibrated, place the sensor in different environmental conditions to see how it responds. This could include areas with no known gas exposure to test the baseline stability and areas where you expect gas presence.
I used perfumes to test the sensor and get some readings.
As shown above, the reading changes continuously based on the availability of different gases.
You can check out the
MiCS-5524 datasheet
for more information on how to calibrate the mics5524 sensor before using i
In this tutorial, we will be interfacing the MiCS-5524 CO, Alcohol, and VOC Gas Sensor Module with Arduino. The MiCS-5524 sensor uses MEMS technology to detect Gas concentration or gas leakage of CO, CH4, C2H5OH, C3H8, C4H10, H2, H2S, NH3, etc.
Earlier we used gas sensors like
CCS811
SGP30
BME680
MQ-135
, and
PMS5003
, etc to measure different gas concentrations, Volatile organic compounds & particulate matter concentrations. However one of the advantages of MiCS-5524 is that it can detect and measure the concentrations of potentially hazardous gases. Using the data, you can create a safety system.
Bill of Materials
Following are the components required for this tutorial.
S.N.
Components
Quantity
Purchase Link
Arduino Nano Board
Amazon
AliExpress
MiCS-5524 Sensor Module
Amazon
AliExpress
Jumper Wires
Amazon
AliExpress
Breadboard
Amazon
AliExpress
MiCS5524 CO, Alcohol and VOC Gas Sensor Module
The MiCS-5524 Gas Sensor Module is an advanced sensing device engineered to detect a range of gaseous substances in various environments.
At the core of this module is a highly sensitive metal oxide semiconductor (MOS) layer that is specifically designed to respond to gases such as carbon monoxide, alcohol, acetone, formaldehyde, and hydrogen. This sensitivity makes the MiCS-5524 a versatile tool in numerous safety-related and air quality monitoring applications.
The module’s compact size facilitates easy integration into different hardware configurations, making it ideal for both residential and industrial setups. Its low power requirements are an additional benefit, promoting prolonged operation which is crucial for continuous monitoring tasks.
Whether integrated into home safety alarms, incorporated into smart home systems, or used in industrial air quality management, the MiCS-5524 delivers reliable and accurate gas detection, making it an essential component in any project aimed at enhancing safety and monitoring air quality. Check
MiCS-5524 Datasheet
for more information.
Features & Specifications of MiCS5524
Operating Voltage
: 4.9 to 5.1V DC
Power Dissipation
: 0.45W
Output Type
: Analog signal
Measuring Ranges
:
Carbon Monoxide (CO): 1 – 1000 ppm
Ethanol (C2H5OH): 10 – 500 ppm
Hydrogen (H2): 1 – 1000 ppm
Ammonia (NH3): 1 – 500 ppm
Methane (CH4): Above 1000 ppm
Operating Conditions
:
Temperature: -30 to 85°C
Humidity: 5 to 95% RH (non-condensing)
Storage Conditions
:
Temperature: -40 to 85°C
Lifespan
: Over 2 years in air
Physical Dimensions
:
Circuit Board: 12mm x 16mm
Mounting Holes: Inner diameter 2mm, outer diameter 4mm
Weight
: 7 grams
Pinout of MiCS5524
Here’s the pinout for the MiCS-5524 MEMS Gas Sensor Module.
Pin Name
Description
5V
Power supply input; connect to a 5V supply.
GND
Ground pin; connect to the system ground.
A0
Analog Output; outputs a voltage proportional to detected gas concentrations.
EN
Enable pin; use to activate (high) or deactivate (low) the sensor.
Interfacing MiCS-5524 MEMS Gas Sensor Module with Arduino
Now let us interface the MiCS-5524 CO, Alcohol & VOC Gas Sensor with Arduino Board. The following diagram shows how to interface the MiCS-5524 Gas Sensor Module with an Arduino.
Connect the 5V pin on the Arduino to the 5V pin on the MiCS-5524.
Connect from the GND (Ground) pin on the Arduino to the GND pin on the MiCS-5524.
Connect the MiCS-5524’s A0 pin to one of the Arduino’s analog input pins (A0).
Connect the EN (Enable) pin on the MiCS-5524 to a digital pin on the Arduino (D2).
This setup allows the Arduino to power the MiCS-5524 sensor, read its analog output, and control its operation via the EN pin.
Source Code/Program
The sensor uses MEMS technology to support gas concentration detection of CO, CH4, C2H5OH, C3H8, C4H10, H2, H2S and NH3. To read all these values, DFRobot has developed a library. First download the library and add it to the Arduino IDE.
Download:
DFRobot MiCS-5524 Library
Copy the following code and past it on your Arduino IDE.
This Arduino code uses the DFRobot_MICS library to manage and read data from a MICS gas sensor module. It initializes the sensor, checks its power state, and waits for it to warm up. Once initialized, the code continuously measures and displays concentrations of various gases such as carbon monoxide, methane, ethanol, hydrogen, ammonia, and nitrogen dioxide on the serial monitor.
It also includes an option to put the sensor into sleep mode to conserve power after readings, though this feature is commented out by default.
#include "DFRobot_MICS.h"
#define CALIBRATION_TIME 2 // Default calibration time is three minutes
#define ADC_PIN A0 // Analog pin connected to the sensor's analog output
#define POWER_PIN 2 // Digital pin to power the sensor
DFRobot_MICS_ADC
mics
(
ADC_PIN
POWER_PIN
)
;
void
setup
(
)
{
Serial
begin
(
115200
)
;
while
(
!
Serial
)
;
// Wait for serial communication to initialize
// Attempt to initialize the sensor
while
(
!
mics
begin
(
)
)
{
Serial
println
(
"No devices found! Please check the connections."
)
;
delay
(
1000
)
;
}
Serial
println
(
"Device connected successfully!"
)
;
// Check the current power state of the sensor
uint8_t
mode
=
mics
getPowerState
(
)
;
if
(
mode
==
SLEEP_MODE
)
{
mics
wakeUpMode
(
)
;
Serial
println
(
"Sensor woken up successfully!"
)
;
}
else
{
Serial
println
(
"Sensor is already in wake-up mode."
)
;
}
// Wait for the sensor to complete its warm-up time
while
(
!
mics
warmUpTime
(
CALIBRATION_TIME
)
)
{
Serial
println
(
"Please wait until the warm-up time is over!"
)
;
delay
(
1000
)
;
}
Serial
println
(
"Sensor is ready for use."
)
;
}
void
loop
(
)
{
// Read gas data from the sensor
float
coConcentration
=
mics
getGasData
(
CO
)
;
float
ch4Concentration
=
mics
getGasData
(
CH4
)
;
float
c2h5ohConcentration
=
mics
getGasData
(
C2H5OH
)
;
float
h2Concentration
=
mics
getGasData
(
H2
)
;
float
nh3Concentration
=
mics
getGasData
(
NH3
)
;
float
no2Concentration
=
mics
getGasData
(
NO2
)
;
// Print the gas concentrations to the serial monitor
Serial
(
"CO (Carbon Monoxide): "
)
;
Serial
(
coConcentration
)
;
Serial
println
(
" PPM"
)
;
Serial
(
"CH4 (Methane): "
)
;
Serial
(
ch4Concentration
)
;
Serial
println
(
" PPM"
)
;
Serial
(
"C2H5OH (Ethanol): "
)
;
Serial
(
c2h5ohConcentration
)
;
Serial
println
(
" PPM"
)
;
Serial
(
"H2 (Hydrogen): "
)
;
Serial
(
h2Concentration
)
;
Serial
println
(
" PPM"
)
;
Serial
(
"NH3 (Ammonia): "
)
;
Serial
(
nh3Concentration
)
;
Serial
println
(
" PPM"
)
;
Serial
(
"NO2 (Nitrogen Dioxide): "
)
;
Serial
(
no2Concentration
)
;
Serial
println
(
" PPM"
)
;
Serial
println
(
)
;
delay
(
1000
)
;
// Wait for 1 second before the next reading
// Uncomment the line below to put the sensor to sleep mode after each reading
// mics.sleepMode();
}
Upload the above code to your Arduino Board.
Testing the MiCS-5524 Sensor Readings
Typically, the sensor requires a warm-up period (often around 24-48 hours after first powered up) and specific calibration to environmental conditions to ensure accuracy.
Once calibrated, place the sensor in different environmental conditions to see how it responds. This could include areas with no known gas exposure to test the baseline stability and areas where you expect gas presence.
I used perfumes to test the sensor and get some readings.
As shown above, the reading changes continuously based on the availability of different gases.
You can check out the
MiCS-5524 datasheet
for more information on how to calibrate the mics5524 sensor before using i
Technologies used
Hardware components
- Arduino
Software & tools
- Arduino IDE
What you get
- Working project / hardware kit, tested before delivery
- Complete source code with explanation
- Project demo and guidance for your viva
- Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed.
Payment is in two parts:
• 50% advance to start the project
• Remaining 50% before delivery
Note:
• Documentation and PPT are not included by default
• If you need documentation/PPT, it can be arranged for extra time and cost
We'll confirm the exact timeline and cost with you after reviewing your requirements.