Arduino LM35 + MQ2

5,237

19

10

Introduction: Arduino LM35 + MQ2

In this project i want a device that uses bolt MQ2 and LM35 for a basic alert system

Step 1: What We Need?

1. First we need an arduino microcontroller

2. LM35 temperature sensor

3. MQ2 smoke and gas sensor

4. We need 6 1K ohm resistors

5. 5 Leds

6. Some jumper wires

7. 1 Breadbord

8. 1 Buzzer

Step 2: Lets Hook Up LM35 and Its Leds

First connect LM35 and leds just like in the picture and then connect middle leg of LM35 to arduinos analog pin 0 and right leg to + line and left leg to - line and connect blue leds + output to pin 13 and - input to - line with 1K resistor yellow leds output pin 12 and - input to - line with 1K resistor red leds output to pin 11 and - input to - line with 1K resistor and that is it

Step 3: Lets Hook Up MQ2 and Its Leds and Buzzer

First connect everything just like in the picture connect right leg of the sensor to analog pin 1 and vcc to + and gnd to - and connect buzzers - to - with 1K resistor and + to pin 8 and blue leds - to - with 1K resistor and + to pin 9 and red leds - to - with 1K resistor and + to pin 10 and thats it

Step 4: Code

Sorry but I couldnt write it to here but you can write it from the video and from the pictures

Step 5: Video

Hope you can make it and use it

Microcontroller Contest 2017

Participated in the
Microcontroller Contest 2017

Sensors Contest 2017

Participated in the
Sensors Contest 2017

Be the First to Share

    Recommendations

    • Puzzles Speed Challenge

      Puzzles Speed Challenge
    • "Can't Touch This" Family Contest

      "Can't Touch This" Family Contest
    • CNC Contest 2020

      CNC Contest 2020

    10 Discussions

    0
    sriutpalnath
    sriutpalnath

    8 months ago

    I have seen your video in YouTube and I need the code to do it and the pic that you shared is not so visible, So if you can share the code it can be a great help to me.
    Hoping that you will be sharing the code.

    0
    DenizG1
    DenizG1

    Reply 8 months ago

    can you give me your email so i can send you the code file

    0
    michaelc702
    michaelc702

    2 years ago

    Is transistor used for this circuit? If is used, what type is it?

    0
    DenizG1
    DenizG1

    Reply 2 years ago

    Yeah we use lm35 sensor like transistor

    0
    the_3d6
    the_3d6

    3 years ago

    This circuit and code won't produce proper readings from MQ type sensors - they require heating/cooling cycles for proper operation. Check my instructable, I've described theory and provided code and schematics: https://www.instructables.com/id/Arduino-CO-Monitor-Using-MQ-7-Sensor/

    0
    DenizG1
    DenizG1

    Reply 3 years ago

    it should work just fine

    0
    the_3d6
    the_3d6

    Reply 3 years ago

    Indeed, for MQ2 there are no indications in its datasheet that it should run through measuring cycles. Although it is strange, because it uses exactly the same physical principle as MQ7, just with different sensitive layer, so it would be logical to expect that the same procedure is needed...
    Have you tried to measure samples with known concentrations and check if received values are correct?

    0
    DenizG1
    DenizG1

    Reply 3 years ago

    yep they are correct but sometimes sensor stucks and i have to restart it and it works fine as usual after that. But i dont know why it does that maybe because of cheap arduino or the cheap sensor.

    0
    the_3d6
    the_3d6

    Reply 3 years ago

    What do you mean by "stucks"? Provides the same value over time, not responding to what is happening, or arduino program isn't updating values? Is it correlated with high concentrations measurements or with arduino cable motion?