How to Use MQ7 Gas Sensors Whith Arduino+Android App

Intro: How to Use MQ7 Gas Sensors Whith Arduino+Android App


In this project show you, how receive MQ7 data from arduino with your android phone. Carbon monoxide(CO) is a very dengerous gas which is odorless, colorless. CO is produced from the partial oxidation of carbon dioxide, such as when operrating a stove or an internal combustion engine in an enclosed space.

Step 1: Step 1:Components Needed

Hardware

  • Bluetooth
  • ModuleMQ7-Sensor
  • Breadboard
  • Arduino Uno
  • Jumper Wire

Software

  • Arduino IDE
  • App Inventor 2 (for create your app).

Step 2: Watch the Video Tutorial

Step 3: Schematics

The circuit is so simple:
Arduino Pins: -------------------------- Bluetooth Module:

RX (Pin 0)----------------------------------------TX

TX (Pin 1)-----------------------------------------RX

5v---------------------------------------------------5v

Gnd-------------------------------------------------Gnd

Pin2,Gnd------------------------------------------Gnd

Arduino Pins: -------------------------- MQ-7(CO Sensor):


Vcc ------------------------------------------- 5V pin

GND ------------------------------------------ GND pin

A_Out ----------------------------------------- A0 pin

D_Out ----------------------------------------- pin 8.

HC-06 Bluetooth

Notes and Tips: You need to remove the RX and TX cables when you’re uploading the sketch to your Arduino. If the HC-06 Bluetooth Module asks for a password, It’s’1234′. Sometimes people connect the TX from the bluetooth module to the TX of the Arduino… that’s wrong and it won’t work. Make sure you connect it properly, the TX into RX and the RX into the TX.

Step 4: Arduino Sketch

const int AOUTpin=0;//the AOUT pin of the CO sensor goes into analog pin A0 of the arduino
const int DOUTpin=8;//the DOUT pin of the CO sensor goes into digital pin D8 of the arduino const int ledPin=13;//the anode of the LED connects to digital pin D13 of the arduino

int limit; int value;

void setup() { Serial.begin(9600);//sets the baud rate pinMode(DOUTpin, INPUT);//sets the pin as an input to the arduino pinMode(ledPin, OUTPUT);//sets the pin as an output of the arduino }

void loop() { value= analogRead(AOUTpin);//reads the analaog value from the CO sensor's AOUT pin limit= digitalRead(DOUTpin);//reads the digital value from the CO sensor's DOUT pin Serial.print("CO value: "); Serial.println(value);//prints the CO value Serial.print("Limit: "); Serial.print(limit);//prints the limit reached as either LOW or HIGH (above or underneath) delay(100); if (limit == HIGH){ Serial.println("Bad"); } else{ Serial.println("OK"); } }

Step 5: Android Application

App Inventor 2 project file:

Designer and Blocks code.

Share

    Recommendations

    • Optics Contest

      Optics Contest
    • Audio Contest 2018

      Audio Contest 2018
    • Plastics Contest

      Plastics Contest

    10 Discussions

    0
    None
    maynardm3

    9 months ago

    Can i add LCD display and show to result one result for android and one for lcd?

    2 replies
    0
    None
    diy_blokemaynardm3

    Reply 9 months ago

    ofcourse you can. Can add i2C lcd to arduino and send everything you want to that LCD

    0
    None
    SelvamS5

    1 year ago

    can i use the same coding for wifi module for creating an app?

    2 replies
    0
    None
    UfukT7SelvamS5

    Reply 1 year ago

    did you get any answers? I want to make it with wifi module too

    0
    None
    widyakun

    1 year ago

    Hey, I also want to build the same sensor but using MQ-2 Sensor, is there's any coding that I need to change?

    1 reply
    0
    None
    aram2700widyakun

    Reply 9 months ago

    If you use two sensors you have 2 ways:

    1- Use Delay to run codes for both sensors

    2- better solution: try to have multitasking in your arduino codes. So both codes run simlultaneously.

    0
    None
    JagadeeshA2

    1 year ago

    I want to use 2 sensors MQ7 and MQ135,is there any tutorial for using 2 sensors

    1
    None
    aycoolt

    1 year ago

    Hey, please how do you heat and calibrate the mq7 sensor