Lab 12 - Gas Sensor and BMP 180 Series Sensor Interface
Lab 12 - Gas Sensor and BMP 180 Series Sensor Interface
Lab No: 12
Introduction to Gas Sensor and BMP 180 series sensor Interface
OBJECTIVE:
To imitate the design to detect different gases whether hazardous or poisonous using MQ
Series sensor family and calculating pressure and depth of an object lying using Arduino.
BACKGROUND:
About MQ Series Sensors
There are quite a few different gas sensors you can use together with My Sensors. Detect
alcohol, methane (fart-sensor?), fire etc. We list a few in the buying guide below. The
example provided here uses the MQ2 sensor to detect air quality.
In below mentioned table the names of several sensors are mentioned with their specific
gas detections as given below:
Table
The voltage that the sensor outputs changes accordingly to the smoke/gas level that
exists in the atmosphere. The sensor outputs a voltage that is proportional to the
concentration of smoke/gas.
In other words, the relationship between voltage and gas concentration is the
following:
The greater the gas concentration, the greater the output voltage
The lower the gas concentration, the lower the output voltage
Hardware Setup
CODE
int redLed = 12;
int greenLed = 11;
int buzzer = 10;
int smokeA0 = A5;
// Your threshold value
int sensorThres = 400;
void setup() {
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
Serial.begin(9600);
}
void loop() {
int analogSensor = analogRead(smokeA0);
Hardware Connections
Code:
#include <Wire.h>
#include <Adafruit_BMP085.h>
Adafruit_BMP085 bmp;
void setup()
{
Serial.begin(9600);
if (!bmp.begin())
{
Serial.println("BMP180 sensor not found");
while (1) {}
}
}
void loop() {
Serial.print("Temperature = ");
Serial.print(bmp.readTemperature());
Serial.println(" *C");
Serial.print("Altitude = ");
Serial.print(bmp.readAltitude(101500));
Serial.println(" meters");
Serial.println();
delay(1000);
}
LAB TASK 1:
Make a small prototype by whom one may know the exact depth at which any object lie and
what is the temperature and actual depth over there. Along with this one may also interface
MQ2 sensor in order to detect the gas
LEARNING OUTCOMES:
Upon successful completion of the lab, students will be able to:
LO1: Understand the basic working of different types sensors
LO2: Control the working pf sensors and runtime evaluation