Categories

MS1100 Formaldehyde Benzene Concentration Gas Sensor Module and Arduino example

The sensor is mainly used for the detection of formaldehyde, toluene, benzene and other VOC gas. The sensor is a type of semiconductor products, widely used in equipment, ventilation equipment, ventilation fan, air filter, hood, hood etc..With high sensitivity and stability, it can detect more than 0.1ppm of the gas. It is suitable for the detection of formaldehyde, benzene, xylene and other volatile organic compounds in the air,small size, cheap, widely used in a variety of small appliances.

The sensor has two pins A0 and D0.
The A0 pin represents the detection of other content. The larger the amount of content detected, the larger the A0 analog value is. Unfortunately this can ve various VOC’s, you cannot detect individual ones.
The D0 pin represents whether the gas content exceeds the zero threshold. When it exceeds the threshold then D0 outputs a HIGH level; when it does not exceed the threshold value then D0 outputs LOW. You are able to adjust the zero threshold value by the potentiometer on the back.
The sensor has an LED to indicate whether the gas content exceeds the set zero limit.

Specs

Operating voltage: DC 5V
Operating current: 100mA
Maximum power: 1W
Operating temperature range: -25°C to 65°C

heating voltage: 5V + 2% (AC . DC)
Working current: 100mA (max)
circuit voltage: < DC12V
load resistance: 1K (adjustable)
detection concentration range :0-1000ppm (different gases different scope)
clean air voltage: < 1V
Sensitivity: > 3%
response time: < 5S (preheat 3-5 minutes)
response time:> 10S
component power consumption: �430mW
Working temperature: -10 ~ 60 oC (nominal temperature 20 oC)
Humidity: 90% RH (nominal humidity 65% RH)
lifespan : 5 years

Application:

For the home environment and other air fresheners detection. smoke control ventilation fans and other equipment suitable for testing the concentration range: 0 to 1000ppm qualitative detection of the gas

Parts

I used a sensor shield and connected the sensor to this – the sensor costs about $7.23

NameLink
Arduino UnoArduino UNO R3
MS1100 sensorMS1100 VOC Gas Sensor Module
Sensor shieldArduino Sensor Shield
Connecting wiremale to male + male to female and female to female DuPont cable

Connection

ArduinoModule
5vVcc
GndGnd
D2DOUT
A0AOUT

Code

Fairly simple, no libraries just checking the values of D2 and A0 – you can use other pins you would have to change the code

#define Aout A0
#define Dout 2
void setup()
{
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(Aout,INPUT);
  pinMode(Dout,INPUT);
}
void loop()
{
  // put your main code here, to run repeatedly:
  int a=analogRead(Aout);
  int b=digitalRead(Dout);
  Serial.print("D0:");
  Serial.print(b);
  Serial.print("   A0:");
  Serial.println(a);
  delay(500);
}

 

Output

Open the serial monitor. The greater the measured gas concentration, the greater the A0 value is.
When the detected gas exceeds the set zero limit, D0 is 1, the D1 LED on the sensor lights up; otherwise D0 is 0, and the D1 LED on the sensor is off.

This is what I saw

D0:0 A0:770
D0:0 A0:757
D0:0 A0:755
D0:0 A0:764
D0:0 A0:767
D0:0 A0:760
D0:0 A0:765
D0:0 A0:769

Share

Arduino and mics-5524 gas sensor example

In this example we look at a MICS 5524 gas module

The MiCS-5524 is a robust MEMS sensor for indoor carbon monoxide and natural gas leakage detection; suitable also for indoor air quality monitoring; breath checker and early fire detection.

Detectable gases

• Carbon monoxide CO 1 – 1000ppm
• Ethanol C2H5OH 10 – 500ppm
• Hydrogen H2 1 – 1000ppm
• Ammonia NH3 1 – 500ppm
• Methane CH4 >1000ppm

One thing to note is that this sensor is sensitive to multiple gasses, as you can see above – but does not know which gas it is

Connection

 

Arduino UnoMICS 5524 module
5v5v
GndGnd
A0A0

 

arduino and mics5524

arduino and mics5524

 

Parts List

Here are the parts I used

Part nameLink
Arduino UnoUNO R3 CH340G/ATmega328P, compatible for Arduino UNO
MICS 5524 module1PCS MiCS5524 CO Alcohol and VOC Gas Sensor Breakout Detector
Dupont cable Free shipping Dupont line 120pcs 20cm male to male + male to female and female to female jumper wire Dupont cablefor Arduino

 

Code

void setup()
{
  Serial.begin(9600);
  Serial.println("MiCS-5524 demo!");
}
 
void loop()
{
  int reading = analogRead(A0);
  Serial.println(reading);
  delay(100);
}

Output

OPen the serial monitor, if you have a gas source such as alcohol then you could test this further

MiCS-5524 demo!
61
57
57
56
56
56
57
56
56
56
56
55
54

 

Serial plotter example

 

Links

 

Share

CCS811 digital gas sensor and Arduino example

In this example we will connect a CCS811 gas sensor to an arduino, lets look at the sensor

CCS811 is a low-power digital gas sensor solution, which integrates a gas sensor solution for detecting low levels of VOCs typically found indoors, with a microcontroller unit (MCU) and an Analog-to-Digital converter to monitor the local environment and provide an indication of the indoor air quality via an equivalent CO2 or TVOC output over a standard I2C digital interface.

Features

Integrated MCU
On-board processing
Standard digital interface
Optimised low power modes
IAQ threshold alarms
Programmable baseline
2.7mm x 4.0mm LGA package
Low component count
Proven technology platform

Specs

InterfaceI²C
Supply Voltage [V]1.8 to 3.6
Power Consumption [mW]1.2 to 46
Dimension [mm]2.7 x 4.0 x 1.1 LGA
Ambient Temperature Range [°C]-40 to 85
Ambient Humidity Range [% r.h.]10 to 95

Parts List

 

 

AmountPart Type
1CJMCU-811 CCS811 Air Quality Gas Sensor
1UNO R3 CH340G/ATmega328P, compatible for Arduino UNO R3

 

 

Schematics/Layout

 

Remember and connect WAKE to gnd

arduino and ccs811 layout

arduino and ccs811 layout

 

arduino and ccs811 schematic

arduino and ccs811 schematic

Code

Again we use a library this is the adafruit one – you can use the library manager and add this.

And this is the out of the box example

#include "Adafruit_CCS811.h"
Adafruit_CCS811 ccs;
void setup() {
Serial.begin(9600);
Serial.println("CCS811 test");
if(!ccs.begin()){
Serial.println("Failed to start sensor! Please check your wiring.");
while(1);
}
//calibrate temperature sensor
while(!ccs.available());
float temp = ccs.calculateTemperature();
ccs.setTempOffset(temp - 25.0);
}
void loop() {
if(ccs.available()){
float temp = ccs.calculateTemperature();
if(!ccs.readData()){
Serial.print("CO2: ");
Serial.print(ccs.geteCO2());
Serial.print("ppm, TVOC: ");
Serial.print(ccs.getTVOC());
Serial.print("ppb Temp:");
Serial.println(temp);
}
else{
Serial.println("ERROR!");
while(1);
}
}
delay(500);
}

 

Output

Open the serial monitor – this is what I saw. The higher CO2 level was when I breathed on the sensor

CO2: 400ppm, TVOC: 0ppb Temp:28.28
CO2: 400ppm, TVOC: 0ppb Temp:47.75
CO2: 400ppm, TVOC: 0ppb Temp:25.00
CO2: 400ppm, TVOC: 0ppb Temp:26.49
CO2: 1228ppm, TVOC: 126ppb Temp:25.68
CO2: 575ppm, TVOC: 26ppb Temp:9.59
CO2: 400ppm, TVOC: 0ppb Temp:26.49
CO2: 400ppm, TVOC: 0ppb Temp:105.81

 

Video

In this video we import the library, we compile and program the Arduino and then we open the serial monitor. The higher reading is when I blew on the sensor

Links

ccs811 datasheet

CJMCU-811 CCS811 Air Quality Gas Sensor

Share

MQ-135 gas sensor

MQ-135 gas sensor is a hazardous gas detection apparatus for the family, the environment, suitable for ammonia, aromatic compounds, sulfur, benzene vapor, smoke and other gases harmful gas detection, gas-sensitive element test concentration.

Air quality sensor is for detecting a wide range of gases, including NH3, NOx, alcohol, benzene, smoke and CO2. Ideal for use in office or factory, simple drive and monitoring circuit.

The sensitivity of the sensor can be adjusted by using the potentiometer.

MQ-135

MQ-135

FEATURES
* High sensitivity to Sulfide, benzene Department of steam, smoke and other harmful gases
* Long life and low cost
* Simple drive circuit

Connection

here are the connections for my sensor

ArduinoGas Sensor
5VVCC
GNDGND
NCDO
Analog A0AO

Code

void setup()
{
  Serial.begin(9600);
}
 
void loop()
{
  float sensorVoltage;
  float sensorValue;
 
  sensorValue = analogRead(A0);
  sensorVoltage = sensorValue/1024*5.0;
 
  Serial.print("sensor voltage = ");
  Serial.print(sensorVoltage);
  Serial.println(" V");
  delay(1000);
}

Results

Again look at the serial monitor, you need to let the sensor stabilise. Remember it consists of a heating element, so you effectively have to let the sensor ‘heat up’.

sensor voltage = 0.30 V
sensor voltage = 0.31 V
sensor voltage = 0.33 V
sensor voltage = 0.34 V
sensor voltage = 0.35 V
sensor voltage = 0.32 V
sensor voltage = 0.31 V
sensor voltage = 0.30 V

Links

Mq-135 datasheet

 
MQ-135 Air Quality Sensor Hazardous Gas Detection Module for Arduino

Share