
- #ARDUINO SENSORS TUTORIAL MQ2 TUTORIAL HOW TO#
- #ARDUINO SENSORS TUTORIAL MQ2 TUTORIAL SERIAL#
- #ARDUINO SENSORS TUTORIAL MQ2 TUTORIAL CODE#

Sensitivity can be regulated by rotating the potentiometer. The higher the concentration of the gas, the bigger the output voltage of the SIG pin. Arduino UNO Gas Sensor 5V VCC GND GND NC NC Analog A0 SIG You can gain the present voltage through the SIG pin of sensor.
#ARDUINO SENSORS TUTORIAL MQ2 TUTORIAL SERIAL#
Serial.begin(9600) //Start Serial Communication at baud rate 9600 Analog Sense for MQ02 - MQ12 See the datasheetįloat sensor_voltage // Define as voltageįloat Clear_Air // Sensing resistance Get the value from the clear airįloat Convertion_Out // Resistance = 0 Get the value of clean Air via H2 Hydrogenįloat sensorValue // Getting sensor value

This smoke detector can be easily built onto a breadboard or a polka dot plate. concentration as per the datasheet of MQ-X sensors This project uses the MQ-2 sensor and an Arduino to determine and detect different smoke intensities.
#ARDUINO SENSORS TUTORIAL MQ2 TUTORIAL CODE#
14CORE Sample Test code for approximate the GAS Let us connect the MQ2 gas sensor to the Arduino.īegin by connecting the VCC pin to the Arduino’s 5V pin and the GND pin to the Arduino’s Ground pin. In our first experiment, we will read the analog output to determine the concentration of the gas and see if it is within acceptable limits. Experiment 1 – Measuring Gas Concentration using Analog Output (A0)
#ARDUINO SENSORS TUTORIAL MQ2 TUTORIAL HOW TO#
During the warm-up period, the sensor typically reads high and gradually decreases until it stabilizes. In this tutorial, we are going to learn: How light sensor works How to connect the light sensor to Arduino How to program Arduino to read the state from the light sensor Hardware Required Or you can buy the following sensor kit: 1 × DIYables Sensor Kit 30 types, 69 units Please note: These are affiliate links. It has high sensitivity and fast response time to measure and take the data.

If the sensor has recently been used, it will only take 5-10 minutes to fully warm up. How to Connect MQ2 Gas Sensor to Arduino MQ2 Gas Sensor to Arduino MQ2 Sensor is a gas module and it is suitable to detect Hydrogen, LPG, Smoke, CO, and Alcohol. When first used after a long period of storage (a month or more), the sensor must be fully warmed up for 24-48 hours to ensure maximum accuracy. Calibrating the MQ2 Gas Sensorīecause the MQ2 is a heater-driven sensor, the calibration of the sensor may drift if it is left in storage for an extended period of time. It is a versatile sensor that can detect LPG, smoke, alcohol, propane, hydrogen, methane, and carbon monoxide concentrations in the air. D0 becomes LOW when the gas concentration exceeds the threshold value (as set by the potentiometer), and HIGH otherwise.Ī0 produces an analog output voltage proportional to gas concentration, so a higher concentration results in a higher voltage and a lower concentration results in a lower voltage. Arduino How MQ2 Gas/Smoke Sensor Works & Interface it with Arduino Give your next Arduino project a nose for gasses by including the MQ2 gas sensor module. Connect it to the 5V output of your Arduino.ĭ0 indicates the presence of combustible gasses.
