Temperature and CO, CO2, and Combustable Gasses Measuring Device - Arduino Project

Temperature/Gas Measuring Device

The Temperature/Gas Measuring Device is a simple Arduino based project which measures the temperature of a surrounding and the environment's CO, CO2, and Combustible Gasses concentration between an ultrasound distance sensor and an object and then projects it onto an LCD.This project was built to help me with my Thesis in which I have to measure the amount or proportion relative to the surrounding air of CO2 produced by crickets at various temperatures. The CO2 sensor might be replaced by a different one but it is good enough for this experiment. It is a simple project which I designed in the span of about 45 to 60 minutes.





All you will need for this project is:


  • An Arduino UNO
  • An LCD (Liquid Crystal Display specifically LCM1602C)
  • An Ultrasound Distance Sensor (Specifically MQ-9 FC-22)
  • A thermostat
  • A Potentiometer (10kΩ)
  • Wires
  • And the open-source Arduino Software (You can download it for free at https://www.arduino.cc/en/Main/Software)
  • A 220  Ω  Resistor


The software I use to sketch these pictures doesn't have the MQ-9 FC-22 gas sensor so I had to replace it with a RGB diode.

Even though I showed you the diagram of how the device should be wired, you should check what to plug in where on your device. I will explain why everything is wired in the way it is.

Let's start with the thermostat. It first needs to be connected to the circuit. You first connect the thermostat to the GND wire and then you connect it with the 5V wire (These wires have already been connected to the breadboard. This means that you just need to plug the thermostat into the right holes in the breadboard.) You then connect the thermostat into the A0 analog inlet. You plug it into the A0 analog inlet to make the arduino recieve the values recorded on the thermostat.

The MQ-9 CO, CO2 and Combustible gasses sensor is wired up simply. The Vcc pin is connected to the 5V inlet on the arduino. The GND pin is connected to the GND inlet on the arduino. The DO pin isn't connected to anything in this project. The AO pin is connected to the A1 analog inlet on the arduino.

The potentiometer is connected very similarly. You first connect it to the GND wire then the 5V wire. You then connect it to the Vee pin on the LCD. This potentiometer is used to change the contrast of the LCD screen.

The LCD screen is connected through many pins. The first pin (GND) connects to the GND wire, the second pin (Vcc) connects to the 5V wire. The third (Vee) connects to the potentiometer. The fourth pin (RS) connects to the digital outlet 12 on the arduino, this is to state where the characters will appear. The fifth pin (R/W) connects to the GND wire. The sixth pin (E) connects to the digital outlet 11 on the arduino, this sets the LCD into a state where it is able to project things. Pins DB0 through DB7 connect to the digital inlets on the Arduino board. The BL+ pin connects to the 5V wire through a 220Ω resistor and the BL- pin connects to the GND wire.

Here is how I wired up my Arduino.








When your board is wired up you can start coding. Here is the simplest version of the code.


#include <LiquidCrystal.h>
const int tempPin = A0;
const int gasPin = A1;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {

 lcd.begin(16, 2); 
}

void loop() {  

 lcd.clear(); 
 lcd.setCursor(0, 0);
 lcd.print("Tmp: "); 
 lcd.print(measureTemperature()); 
 lcd.print("C"); 
 lcd.setCursor(0, 1);
 lcd.print("Gas: ");
 lcd.print(measureGas());
 lcd.print("ppm");

 delay(1000);

}

float measureTemperature(){

 int sensorVal = analogRead(tempPin);
 float voltage = (sensorVal/1024.0) * 5.0;
 return ((voltage - 0.5) * 100) - 7;
}

int measureGas(){

 return analogRead(gasPin); 
}

Komentáre

  1. This is really nice blog. i feel happy to read this CO2 Gas Transmitter blog information.Thanks for sharing this information with us. Acorn Controls Pvt.Ltd. is also one of the best company that manufacturer and supply the Ultrasonic Flow Meter.

    OdpovedaťOdstrániť

Zverejnenie komentára