How to use gas sensors with Arduino || Arduino tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 เม.ย. 2024
  • In this tutorial I'm demonstrating how to use MQ-2/MQ-5 gas sensors with Arduino. These little devices may be used in gas leakage detectors.
    The MQ-2 is suitable for detecting LPG, i-butane, propane, methane, hydrogen and even smoke.
    The MQ-5 detects LPG, natural gas and town gas.
    Many other gas sensors can be used in exactly the same way, e.g. MQ-3, MQ-6 or MQ-135. Just read the datasheet, use the appropriate load resistor and experiment with the "sensorValue" in my Arduino code.
    Project page - you can download Arduino code and see schematic used in this video here:
    ElectronFun.com/project_2.php
    Datasheets:
    MQ-2: www.pololu.com/file/0J309/MQ2...
    MQ-5: www.parallax.com/sites/defaul...
    See how to calibrate an MQ-2 gas sensor:
    • How to calibrate an MQ...
    See all my Arduino tutorials here:
    th-cam.com/users/playlist?list...
    Subscribe to get notified about my new videos:
    / subscription_c. .
    ----------------------------------------------------------------------------------------------
    TH-cam channel: / electron. .
    Google+: plus.google.com/+Electronfuncom
    Facebook: / electronfunpage
    Twitter: / electronfun
    Website: ElectronFun.com
    ----------------------------------------------------------------------------------------------
    Video, edit, voice by Chris Lorkowski
    Music composed and performed by Bensound - Happiness
    www.bensound.com
    Sound effects recorded by Mark DiAngelo - Blop
    soundbible.com
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 984

  • @zorrog.2947
    @zorrog.2947 6 ปีที่แล้ว +5

    Hi there, I'd like to build a CO2 gas sensor using an MQ-135 gas sensor, for my environmental science class. How can I adapt this project to an MQ-135 sensor? Also, the links to your datasheets don't seem to work. Can I get access to your datasheets? How can I create a similar datasheet for an MQ-135 sensor? Any assistance is most appreciated. Cheers!

    • @ElectronFunCom
      @ElectronFunCom  6 ปีที่แล้ว +1

      You don't have to change anything in this project, if you want to get a value between 0 and 1023. I fixed the datasheet links, thanks for letting me know they were broken.

  • @gopikrishnanr8379
    @gopikrishnanr8379 9 ปีที่แล้ว +6

    Thanks for posting this video.. I found it very useful. Have you though not connecting the Audrino directly to sensor and use wifi to exchange messages?

    • @ralfsdw
      @ralfsdw 4 ปีที่แล้ว

      You need something to read the analog values from the sensor before transmitting them over wifi anyway

  • @y4khalil
    @y4khalil 4 ปีที่แล้ว +1

    Hello, thanks for this wonderful video. Can I use any of the MQ- series to measure the quantity of gas inside the storage tank?

  • @saularias5308
    @saularias5308 8 ปีที่แล้ว

    Very good video. Simple and clear explanations. My son and I bought an MQ-4 yesterday and now I understand how to connect it to the Arduino. Thank you very much!

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Saul Arias Thanks a lot! Have fun with your project :)

  • @naveenmittal
    @naveenmittal 8 ปีที่แล้ว +4

    hi,
    i want to measure air quality at home and thinking of getting MQ-135 but i am not sure if sensitivity is highly enough to detect low gas level. i know that CO should be under 6 ppm in healthy air quality, will this sensor measure that?
    thanks in advance

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +naveen mittal Hi, I don't know the exact answer to your question. To measure gas concentration in ppm you would need a calibrated sensor. I know that these MQ type sensors are not very accurate, I wouldn't trust them so much.

    • @rich1051414
      @rich1051414 5 ปีที่แล้ว +1

      If you want to use this properly, you need to calibrate every startup, after warming up for 3 minutes, expose to open air, and then in your code, zero out the value. Then only measure based on the offset. This makes the readings more sane and accurate. Otherwise you will notice drift on every startup depending on the material composition of the heater and materials near it, as they will off-gas differently as they age, and should be discounted from the readings.

  • @syedayman9322
    @syedayman9322 9 ปีที่แล้ว +4

    I did not yet get my answer? in order to preheat the sensor, do I need to use the resistor or only use straight 5v power. My datasheet said it needs to preheat for 24 hours, but it does not mention if I need to use the resistor or not, my values with out preheat are coming in like:
    0
    344
    200
    523
    123
    882
    1023
    0
    50
    122
    The values are very unstable, but do you think it will be fixed after the pre heat??
    I am a very frequent viewer of yours, I like all of your projects,A quick answer will be apreciated, thanks in advance

    • @syedayman9322
      @syedayman9322 9 ปีที่แล้ว

      Syed Ayman Waiting for your reply

    • @xosphere_1562
      @xosphere_1562 5 ปีที่แล้ว

      three years no reply 😔😔

  • @Mudbloodprincess98
    @Mudbloodprincess98 2 ปีที่แล้ว

    Thanks for the great video! The resistor leads are a little hard to see, does it go from the ground rail to the same row as the B pins?

  • @urvirelekar7189
    @urvirelekar7189 5 ปีที่แล้ว

    Thank you for the video. Sir, How do we calibrate the gas sensor to sense a specific compound? I read the datasheet it said we have to connect a resistor or potentiometer to measure a specific compound. How do I do that, sir?

  • @gopikabg5403
    @gopikabg5403 7 ปีที่แล้ว +3

    The values in serial monitor are voltage values.Am i correct?I want resistance values too.Is it possible?

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      Yes, these are voltage values between 0-5V - there are 1024 steps. Watch my vide entitled: How to make a simple Arduino ohmmeter - you will learn how to get resistance values.

  • @abdallahegypt
    @abdallahegypt 4 ปีที่แล้ว +1

    Hi, that's a great video, could you please tell me how you can make another one for detecting multi gases in the same time or if it's possible can you make another video , thanks in advance for you reply.

  • @dinil21
    @dinil21 9 ปีที่แล้ว +1

    hey nice work man. keep it up and thanks for the lesson.

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Dinil Divakaran I'm glad you like the video, thanks a lot!

  • @mattclark7941
    @mattclark7941 ปีที่แล้ว

    Hi love your videos, I'm in the middle of a project building a gasification unit to run a generator on woodgas, would you be able to do a video on how to use an Arduino with a car 02 sensor to control a rc servo adjusting the gas to air ratio?

  • @carmenflorea4294
    @carmenflorea4294 6 ปีที่แล้ว

    Hello ! Your video is very helpful. I want to try this project by myself and i want to make it portable. I am new in this field and i need some suggestions. Can i use a battery instead of the source? I also have to upload the code on Arduino, how can i do that? Thank you !

  • @AliehsPJ
    @AliehsPJ ปีที่แล้ว

    Great idea! Thanks for this helpful tutorial.

  • @christopherschadt9895
    @christopherschadt9895 5 ปีที่แล้ว

    Wow! There are a ton of questions/answers for this video. I tried to search throught them with some keywords, however I could not find answers I was looking for about cost and about lower detection limit and accuracy in the low range of measurements. Looking to build something similar but it would have to detect and readout values for CH4 way below the LEL at around the 10ppm range in order to be useful for my project. Sorry if this question is repetitive from those asked/answered before.

  • @francescomotterle8038
    @francescomotterle8038 8 ปีที่แล้ว +2

    Hi, nice video!
    I'm trying to do the same as you, but with the MQ-131, ozone gas sensor.
    I'm trying to understand: how have you found the value of the resistance to put on your board?
    For the MQ-131 sensor i need to preheat the sensor for almost a day, Someone says you have to change the resistance after the preheat to have a good measure.
    But I have seen you can change the value of sensitivity in the sketch, so How do I have to do?
    In any case thank you :)

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว +1

      +Francesco Motterle Thanks a lot! I took my resistor's value from the datasheet. However I checked your MQ-131 datasheet and it says "load resistance: variable" - it's pretty confusing, but you can use a potentiometer and adjust sensitivity.
      Preheating the sensor is advised by the datasheet - yours says: "over 24 hours", so it's a good idea to do that.

  • @saravanans937
    @saravanans937 4 ปีที่แล้ว

    Hi sir,
    This is awesome. Will you please upload a video about blood glucose monitoring using acetone sensor (mq 138)?

  • @crimsontechyt
    @crimsontechyt 4 หลายเดือนก่อน

    Thanks so much, I couldn't find any other info on this :)

  • @guha2487
    @guha2487 3 ปีที่แล้ว

    Thanks for your simple and clear explanation

  • @Nada-lv6xv
    @Nada-lv6xv 9 ปีที่แล้ว +2

    Hello, Thank you for the video. It's helpful !!
    I would like to know if the use of the resistors is necessary or not ? and what are the effects if i don't use them?
    thanks.

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว +1

      Nada Hi, thanks for your comment! The resistor is necessary according to the datasheet. I guess the readings would be completely inaccurate without the resistor.

  • @faizanthapur9845
    @faizanthapur9845 2 ปีที่แล้ว

    What do I do once I click the MQ-5 datasheet download link? When I clicked the link it just took me to a page with download links but I don't know which one is the datasheet for MQ-5

  • @abdel-kerimmoctar9350
    @abdel-kerimmoctar9350 3 ปีที่แล้ว

    Hello would the kl27z card work the same as your arduino card?

  • @rabiulislamabid750
    @rabiulislamabid750 4 ปีที่แล้ว

    Excellent! This is so helpful. Would you please help me more measuring the value in ppm unit rather than 0 to 1023?

  • @ankeetmitra1122
    @ankeetmitra1122 6 ปีที่แล้ว +1

    This was an amazing tutorial. Just wanted to know what is the alternative to heat shrink tube as I can't find any

    • @NavJordaan
      @NavJordaan 3 ปีที่แล้ว

      i'm a little late so i dont think its helpful, but you can just wrap some tape around your exposed wires and it'll be fine

  • @mashamustakim631
    @mashamustakim631 9 ปีที่แล้ว +2

    Its amazing and helpful for the novice guys.

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Masha Mustakim I'm glad you find my video helpful :) Thank you!

  • @edits_zyx
    @edits_zyx 9 ปีที่แล้ว +1

    Hello,
    I really liked the video and i want to ask you few things on this, can we have sensor, alarm speaker and simple power supply which makes compatible and sense the gas. can you pls describe.

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Thank you! Yes, it is possible to have a gas sensor with a power supply or some kind of battery and a speaker, which would alarm you, if it sensed certain gas concentration. The easiest way to make something like this would be to replace the LED with a small speaker.
      I want to build a simple gas leakage detector in one of my next videos and use a speaker, or an LED bar graph or an LCD to show the results. I'm not able to tell you exactly when, because I have a "regular" job, which prevents me from making videos quicker and more frequently. I can see many people are interested in gas sensors, so this video will get higher priority.

  • @bonetogol
    @bonetogol 6 ปีที่แล้ว

    Hello man... I need put the sensor in a tube to detect the the H2S Through the tube area... Do You know if it's possible? I can measure the gas volume pass by the tube?

  • @FoXaSsaSsin97
    @FoXaSsaSsin97 6 ปีที่แล้ว

    sir i use mq2 sensor module that has 4 pins . how do i connect them to the arduino ? do i need to modify the sensor like taking out some resistors and capacitor on the module ?

  • @SwissAmbush
    @SwissAmbush 7 ปีที่แล้ว

    Hey man. Awesome project! If I am trying to make a reliable diy smoke alarm which sensors will I need? The MQ-7 for CO and MQ-2 for everything else? Thanks!

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      Thanks a lot Jim! You could use the MQ-2 alone as a smoke detector. However, I wouldn't use these sensors in my home smoke detectors. They are nice when you want to learn how to use Arduino with them, but their reliability isn't very good.

  • @diegogalafassi3694
    @diegogalafassi3694 4 ปีที่แล้ว

    Hi, do you know if there are CO2 detectors available that would be able to capture a signal of human exhale?

  • @bouyoucefamine8303
    @bouyoucefamine8303 8 ปีที่แล้ว +1

    Hi, thank you very much for this very well explained video. What do you think about using the MQ2 for a consumer product ? Do you think it is sturdy and reliable enough for commercial use ? Thank you

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Amine Ben Hi, after playing with these sensors for a while I wouldn't recommend them for commercial purposes. They are good for learning and experimenting, but that's it. In my opinion they are not reliable enough for a commercial project.

    • @bouyoucefamine8303
      @bouyoucefamine8303 8 ปีที่แล้ว

      Thank you for your answer. Would you recommend any gas/smoke sensor for commercial purposes ?

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Amine Ben Sorry, I don't have any commercial experience.

  • @halakhaldoun
    @halakhaldoun 9 ปีที่แล้ว +1

    When you choose serial monitor to view data in a new windor, are you be able to copy this data or not?
    Or a data logger shield should be used to export data needed?

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Yes, you can select, copy and paste the text from the Serial Monitor window.

  • @ufohunter3688
    @ufohunter3688 6 ปีที่แล้ว +2

    Good video. Subb'd.
    How long does the heater element inside the sensor last?

    • @ElectronFunCom
      @ElectronFunCom  6 ปีที่แล้ว

      Thank you so much! I'm not able to give you even an estimated value, but I wouldn't worry too much for the sensor's lifespan.

    • @ufohunter3688
      @ufohunter3688 6 ปีที่แล้ว

      If its like the rest of the Chinese junk, it would be useless if the heater element burns out.

    • @ElectronFunCom
      @ElectronFunCom  6 ปีที่แล้ว

      Are you going to use these sensors 24x7? This may affect the heater element, but I'm still not sure how much.

    • @ufohunter3688
      @ufohunter3688 6 ปีที่แล้ว

      Yes. I guess I will have to buy one and see. Thanks for the video.

    • @ElectronFunCom
      @ElectronFunCom  6 ปีที่แล้ว

      No problem, good luck with your project.

  • @syamilfuad5098
    @syamilfuad5098 5 ปีที่แล้ว

    may i know for testing purpose, how do i produce/get the other gases? which can be detected using MQ2 sensor

  • @Guyc00l
    @Guyc00l 5 ปีที่แล้ว

    why not connect it to arduino 5v power supply
    and why after 2 - 3 minutes the readings go low? is the sensor only supposed to work for 2-3 min and then shutdown or the other way around to heat up?

  • @nayakakshay5735
    @nayakakshay5735 6 ปีที่แล้ว

    Can we use any supply or is it necessary to have just 5 volt

  • @skydronecordoba2023
    @skydronecordoba2023 5 ปีที่แล้ว

    Can this sensor be mounted on a drone to sense CH4 gas? Is the indication reliable?

  • @channel-dx8yd
    @channel-dx8yd 5 ปีที่แล้ว

    Awesome video, but can u please suggest a sensor which detects differ parameters of gas like carbon dioxide , carbon monoxide, oxygen , sulphur content in the air .I need such a sensor for measuring the air pollution .So please suggest a sensor which measure various components of air separately

  • @SinhueENES
    @SinhueENES 8 ปีที่แล้ว +2

    Hi. We read the datasheet of Mq-135 sensor, which sense for multiple gases in arduino. However we have a problem because our laptop only read one column, as you shown in this video. We do not know what kind of gas we are reading (how we do that?), and furthermore, we want read all gases in several columns. is possible to do this? thank so much in advance.

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว +1

      +Sinhué Haro Corzo You might want to use Sandbox Electronics piece of code to "calibrate" the sensor and get a separate reading for each gas: forum.arduino.cc/index.php?topic=181780.0. I haven't put too much time into it yet, but I know some people get pretty decent results.

  • @dk_noobmaster46
    @dk_noobmaster46 6 ปีที่แล้ว +1

    do you know the sensor to measure the Oxygen (O2) gas?? btw this video really helpful for my experiment project. thank you

    • @ElectronFunCom
      @ElectronFunCom  6 ปีที่แล้ว

      Sorry for replying so late. Unfortunately I couldn't find an O2 sensor. At least from the MQ series.

  • @channel-dx8yd
    @channel-dx8yd 5 ปีที่แล้ว

    Awesome video, but can you please suggest a sensor which detects different parameters of gas like carbon dioxide , carbon monoxide, oxygen , sulphur content in the air .I need such a sensor for measuring the air pollution .

  • @malikmalik33959
    @malikmalik33959 5 ปีที่แล้ว

    I like your project but how much or value does the gas sensor"s limit

  • @mohamadnuh2188
    @mohamadnuh2188 ปีที่แล้ว

    May I know what imperial unit that u use for sensor detect?

  • @ratnaprabhakasde2965
    @ratnaprabhakasde2965 9 ปีที่แล้ว +1

    cool...hey but i hvn't find code on ur site...frm whr i cn get it?

  • @vishnuvardhan4093
    @vishnuvardhan4093 3 ปีที่แล้ว

    Thank you for ur awesome video. But i searched a lot for this video, it could be easy and reachable if you've used the title as 'Gas leakage detection'.❤️

  • @ronyjoseph7868
    @ronyjoseph7868 5 ปีที่แล้ว

    hi, can it possible to print the data to lcd with this gas sensor arrangement instead of gas sensor module

  • @GuzForster
    @GuzForster 8 ปีที่แล้ว

    Thanks for that tutorial! Really helped me out. I have a question... Do you know if I change the resistance, say to instead 20KOhm, to something like 10KOhm, will it detect different kinds of gases? It's not clear on the datasheet but it seems to be the case. Also, your website is down... :(

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Guz Forster Hi, unfortunately it's not that easy. When you change the resistor, it won't make the sensor detect different kinds of gases. In the datasheet there is a chart called sensitivity characteristics. You can see there that different gases overlap and you can't be sure which gas your sensor picks up.
      Sandbox Electronics has a piece of code on their website (sandboxelectronics.com/?p=165), which will "calibrate" your sensor and show 3 types of gases. Just remember their method is based on an approximation to the original sensitivity characteristic curve, so it won't be terribly accurate.

    • @GuzForster
      @GuzForster 8 ปีที่แล้ว +1

      Right, thanks! So even with this sensor, we can't actually tell which gas we are detecting, only that is detecting some sort of gas in the range of the "accepted" gases, right?

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว +1

      +Guz Forster Pretty much yes.

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      Unfortunately yes.

  • @970ismail
    @970ismail 8 ปีที่แล้ว +1

    Hi,
    Liked ur video, it was informative.
    Wanted to knw that semiconductor gas sensor could detect methane in a range of 100ppm to 20000ppm. If yes could you suggest the sensor.

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Ismail Zabii I know MQ-4 can sense Methane, but the range is from 200 to 10000ppm. However the MQ sensors are not very accurate and reliable, so I wouldn't use it for a serious/commercial project.

    • @970ismail
      @970ismail 8 ปีที่แล้ว

      +ElectronFun.com Could u suggest me a sensor which is very accurate and also can measure below 100ppm. thank you

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Ismail Zabii Sorry, I don't know any good sensors that would be able to measure below 100ppm.

  • @MichaelWohlwend
    @MichaelWohlwend 7 ปีที่แล้ว

    very instructive tutorial, thanks

  • @mohibullahbukhari7461
    @mohibullahbukhari7461 6 ปีที่แล้ว

    Great video,can i have just readings without led?

  • @henriqueliska3448
    @henriqueliska3448 3 ปีที่แล้ว

    Hi, can i use this with the MQ131?
    it works in the same way?

  • @syedayman9322
    @syedayman9322 9 ปีที่แล้ว +2

    It is a very good project

  • @subashiniparamanandan4178
    @subashiniparamanandan4178 8 ปีที่แล้ว

    This project is great.what is the advantage of using arduino instead of other micro controller.how to add a buzzor to this circuit?

  • @maxlim15
    @maxlim15 7 ปีที่แล้ว +1

    hi.. may I know which sensor can be use to detect n2. nitrogen.. I mean building a N2 supply inside a isolate small compartment. , would like to add in a sensor to detect leakage. Thank you

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      I'm not aware of a sensor from the MQ series, which could be used to detect nitrogen, sorry.

  • @ikhsanrahman9703
    @ikhsanrahman9703 4 ปีที่แล้ว

    Hello, I wanna ask, how to make stable value that displayed in serial monitor? I always get much fluctuations

  • @McGavel1
    @McGavel1 7 ปีที่แล้ว

    Excellent - thank you very much for sharing info! I'm trying to make this for my indoor garden because it's so much cheaper to make and I've just gotten into Arduino. Good luck - have fun.

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว +1

      I'm glad you like the video. Thank you for watching and commenting! Good luck with your project :)

    • @McGavel1
      @McGavel1 7 ปีที่แล้ว +1

      ElectronFun.com Ty - keep up the good work - peace.

  • @shalmanurhida413
    @shalmanurhida413 3 ปีที่แล้ว

    should we have to calibrate this sensor before using that?? thx

  • @samsonmasebinu5734
    @samsonmasebinu5734 7 ปีที่แล้ว

    Can I convert the readings to percentage and regulate the logging time interval. Also added like three more sensor and find their percentage composition in the biogas.I want to use it to log biogas composition from my digester.

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      You can easily adjust the logging time interval and add more sensors - each one should use a separate Arduino analog pin. The most difficult part would be the conversion of the readings into percentage.

  • @jonathanquinn9512
    @jonathanquinn9512 9 ปีที่แล้ว +1

    Hi, great video, I want to add in a 6v buzzer, what the best way to do so? I have never used this code before, thanks!

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Hi, thanks! Arduino Uno is rated for 5V, so it would be better to use a 5V buzzer. If you deliver voltage to the buzzer it will turn on. If you want to change the tone, you could use Arduino "tone()" (arduino.cc/en/reference/tone).

  • @scamper_van8470
    @scamper_van8470 3 ปีที่แล้ว

    My thumbs up for the video quiet useful since i am missing only arduino and the sensor for my detector for hydrogen.

  • @TurboDirectSA
    @TurboDirectSA 9 ปีที่แล้ว +2

    Nice Vid - great help thank alot!!

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Chris Kambouris Thanks a lot for watching :)

  • @nofear7777777
    @nofear7777777 9 ปีที่แล้ว +1

    Hello,
    I really enjoyed your video and it was really helpful.
    I have a question though to ask you since I am doing a similar project with an MQ-2 gas sensor. While I am executing everything correctly, on the serial monitor I get values more than 800 (ex. 842) and when I apply gas from a lighter to the gas sensor, the values decrease dramatically reaching 40. It seems quite odd to me since I thought that the values where supposed to increase when the gas was detected.
    The same thing happens with an MQ-7 gas sensor applying the same gas.
    Any thoughts what would the problem be, if there is any?
    p.s. Both the gas sensors are on a board by themselves (with resistors, pins etc.)
    Thank you for your answer in advance!

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      I had a similar problem once. As far as I remember, it happens when you hook up the "B wires" through the 20k resistor to the positive rail instead of ground. I can check that when I get back home.

    • @nofear7777777
      @nofear7777777 9 ปีที่แล้ว

      ElectronFun.com The thing is that the sensors that I have bought, they already are on a board by themselves, like this goo.gl/1HoQXg

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Do you have any datasheet for this sensor?

    • @nofear7777777
      @nofear7777777 9 ปีที่แล้ว +1

      ElectronFun.com Well, I had it bought from ebay and the sensor seems exactly the same to this one goo.gl/N0vqqN. You can find a description (datasheet) of the sensor on the link and hopefully it is the same to my sensor.

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      nofear7777777 What pins do you have on your sensor? Is it +5V, DOUT, AOUT and GND or something else? How did you connect it to your Arduino?

  • @ajaykumar-xm6tv
    @ajaykumar-xm6tv 5 ปีที่แล้ว

    Brother
    Where can I get the code for Mq135 gas sensor, so as to use it for measuring CO2 level

  • @gtuf95
    @gtuf95 7 ปีที่แล้ว

    Very nice video. I wanted to ask you, if I want to use the gas sensor with Arduino on a flying drone, do you think this technique can work? Or I should proceed with another way? Thank you for your time...

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      +Georges Tufenkji Thank you for your comment and watching. Your idea is very cool! I believe it should work, however these sensors are not super accurate - bear that in mind.

    • @gtuf95
      @gtuf95 7 ปีที่แล้ว +1

      Okay, I will keep you posted with the implementation of the project :)

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      Great, I would like to know how it turns out.

  • @12bjab
    @12bjab 5 ปีที่แล้ว

    what sensor can be used to detect gases like acetone ,isoprene etc?

  • @TahaCodes
    @TahaCodes 6 ปีที่แล้ว

    Thanks, the tutorial was great!

  • @zouaouisaifeddine5250
    @zouaouisaifeddine5250 2 ปีที่แล้ว

    hello , can i use this code to connect this sensor to TTGO WATCH MODULE GPS GSM ?

  • @zelra891
    @zelra891 9 ปีที่แล้ว +2

    this is an interesting video. I would recommend you to explain more like how the sensor works or why to connect wires like this. I mean, now I know how the sensor works with arduino, but I can't do it if I want to add a sensor to my project.
    take an example, we can get some analog outputs with this diagram, but what's the meaning of this value? how to convert the number to some standard numbers? This will be really helpful because if I want to do an air monitor project with this, I don't know how to define the number. LED lights up when it's 500, but what's the real number that matters in our life? In datasheet I see a relation between sensor resistance with ppm, but maybe a starter will never figure out.
    anyway, this is a great video. I have subscribed and wish you have more excellent videos :)

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Zelra 仙賢戀軒 Hi, thanks for your comment, subscription and advice. I'm trying to make my videos not too long. Maybe I should have explained more details about the sensor.The values are something between 0 and 1023 and they come from Arduino analog to digital converter. If you want your readings in ppm units, you would need to calibrate your sensor against a known gas concentration (maybe this part of explanation should be included in the video).

  • @nathannguyen6905
    @nathannguyen6905 5 ปีที่แล้ว

    What size heat shrink tubing did you use? Thanks

  • @dinosongoku
    @dinosongoku 8 ปีที่แล้ว +1

    keep doing bro

  • @violetamena9729
    @violetamena9729 9 ปีที่แล้ว +1

    Hi, excellent video. Does the ensamble and code work for other Arduino sensors?. I`m interested in CO2. Thanks.

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Violeta Mena Hi, thanks for your comment.You can use MQ-135, the wiring diagram is the same, but to make it work with CO2 you should follow this tutorial: davidegironi.blogspot.it/2014/01/cheap-co2-meter-using-mq135-sensor-with.html#.VRBvweGfxFo There is another sensor, made specifically for CO2 - MG811, but it uses 6V and the wiring diagram is a bit different (see here): pdf1.alldatasheet.com/datasheet-pdf/view/172004/ETC2/MG811.html

    • @violetamena9729
      @violetamena9729 9 ปีที่แล้ว

      ElectronFun.com Thanks!!!

  • @mahalingamrajaratnam6121
    @mahalingamrajaratnam6121 ปีที่แล้ว

    Can you share what is the set up for MQ131 (O3) Ozone sensor with Arduino?

  • @alialtaey6602
    @alialtaey6602 8 ปีที่แล้ว +1

    Hello,
    you did fantastic job! well done. How can you calibrate your sensor? is this code valid for other gas sensor such as MQ 138 ?
    Cheers

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      Ali Altaey Thank you. Yes, the code will work with MQ-138. When it comes to calibration - you should calibrate it against an already calibrated sensor. There is also another method that you can try at home - just in the code, based on sensitivity characteristics, but I wasn't very successful with this, at least yet.

  • @azmaljamal
    @azmaljamal 8 ปีที่แล้ว +1

    may i ask. what type of power source do you use in making this project?.

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Azmal Jamal Sure, I used a cheap adjustable bench power supply, nothing fancy.

  • @RichardRauscher
    @RichardRauscher 7 ปีที่แล้ว +1

    Good video. Thank you for making it.

  • @aizamariesambo4481
    @aizamariesambo4481 8 ปีที่แล้ว +1

    Sir may i ask, for instance i am going to use 3 MQ-2 gas sensor. What will be the connections? and how about the power source?

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Aiza Marie Sambo You would need to connect each sensor to a separate Arduino's analog input. Each sensor should have it's own resistor connected to ground. The rest of the connections would remain untouched. The code should be updated to read from 3 different analog inputs. When it comes to the power supply - for 3 sensors you would need at least 500mA at 5V.

  • @alexpiaro9449
    @alexpiaro9449 6 ปีที่แล้ว +1

    that a really good work,its nice and please can i get a manual or instruction on how i can calibrate both MQ7 and MQ8 on Arduino uno board for detecting CO and H2

    • @ElectronFunCom
      @ElectronFunCom  6 ปีที่แล้ว

      Thanks a lot :)
      Unfortunately the software calibration I showed in the video entitled "How to use gas sensors with Arduino" works only with the MQ-2.

  • @zv3000
    @zv3000 7 ปีที่แล้ว

    Hi i have a quick question, well two really. Can you connect multiple different MQ series sensors in parallel ? to each other ? also is it possible to add an LCD display to display the levels ?

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      Hi, MQ sensors are purely analog and it's not really possible to stack them (use one analog pin to read values from different sensors). You would need one analog pin for every single sensor.
      It is possible to add an LCD to the sensor. I'm working on a new tutorial on using an LCD with Arduino Uno.

    • @zv3000
      @zv3000 7 ปีที่แล้ว +1

      ah alright thats fine thanks makes sense to use a different analog pin

  • @cansatsmcs9555
    @cansatsmcs9555 7 ปีที่แล้ว

    Thanks so much, this is exactly what we need. the only problem is that would either process work for the MQ-4, as our prime mission is to measure methane. Or would it be possible to get rid of all data of all other gases for the MQ-2 and only show the methane data. We are from Moate Community School and entering a project for Cansat. Thanks so much for your help.

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว +1

      Thank you for your comment. These sensors can detect a range of gases, but they are not able to differentiate between them.

  • @blubblub9836
    @blubblub9836 4 ปีที่แล้ว

    Can it detect ethylene gases? And able it to detect even in 2meters far

  • @amenizarrouk987
    @amenizarrouk987 9 ปีที่แล้ว +1

    thank you !! this was really useful to me :)
    i have mq7 gas sensor, can i use it like your mq5 ???

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Ameni Zarrouk Thanks, yes you can use an MQ-7 in exactly the same way. The wiring diagram is identical.

    • @amenizarrouk987
      @amenizarrouk987 9 ปีที่แล้ว +1

      thank you :) it really helped me!! keep the good work :))

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Ameni Zarrouk Thanks :)

  • @govindsah5317
    @govindsah5317 5 ปีที่แล้ว

    If I will add buzzer then what are the changes I have to do in your code sir...

  • @thilo0128
    @thilo0128 9 ปีที่แล้ว +1

    Hello, do you have to calibrate the sensors ?
    I start a little project with a MQ4 but I am not sure if the datas are correct.

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Thilo 012 Hi, it depends. If you want to have your readings in ppm units for example, you would want to calibrate the sensor against a calibrated sensor so you could know the exact gas concentration. Another thing is consistency of readings - if you're getting inconsistent data you probably need to preheat you sensor by leaving it on for 24 hours (see the datasheet).

    • @thilo0128
      @thilo0128 9 ปีที่แล้ว +1

      ElectronFun.com yeah i want ppm readings. but how can i calibrate it ?

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว +1

      Thilo 012 A few days ago I would tell you that you need to calibrate your sensor by comparing it with another already calibrated sensor or adjust it by exposing it to a precise gas concentration and it is true. These methods seem to be the most accurate, but there is another way (I hope) based on sensitivity characteristic curves from the datasheet. I'm going to experiment with this stuff and if I succeed, I may prepare a video about it.

  • @MudassirKhan-ko8po
    @MudassirKhan-ko8po 4 ปีที่แล้ว

    Can I use male female wires instead of solder pls reply sir?

  • @VijayKumar-ki3jf
    @VijayKumar-ki3jf 5 ปีที่แล้ว

    Instead of using A0 pin for output I wanted to use D0 pin so that I can take the output on the Digital pins of Arduino. Can you please guide how to use the D0 pin

  • @chie1527
    @chie1527 9 ปีที่แล้ว +1

    good eve sir... can this project last for continuous use??? lets say a week or more without turning the power off?? will the sensor overheat or burn?? thanks alot sir

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว +1

      Hi, the sensor should be able to work constantly without problems. You can even find in the datasheet that the sensor should be powered constantly for over 24 hours before first use (it's called preheat time). If you don't exceed the maximum voltage 5.1-5.2V the sensor will not overheat.

  • @mrwindsor67
    @mrwindsor67 5 ปีที่แล้ว

    Why did you choose those resistor values specifically?

  • @aqilabbasi4702
    @aqilabbasi4702 6 ปีที่แล้ว

    hey i have mq-2 module...is there any need of giving connections to A ,B and H pins?or directly to Vcc pin?also is there any need of connecting Rl? bcz module have built in potentiometer?

    • @ElectronFunCom
      @ElectronFunCom  6 ปีที่แล้ว

      I'm not sure if you are talking about the same module I have. On mine there are A, B pins and the heater element, nothing else.

    • @aqilabbasi4702
      @aqilabbasi4702 6 ปีที่แล้ว

      I m talking about Mq-2 gas sensor module...u have only sensor..here,s the details. wiki.sainsmart.com/index.php/SainSmart_MQ2_Gas_Sensor_Module

    • @ElectronFunCom
      @ElectronFunCom  6 ปีที่แล้ว +1

      I have not used these. Try to find the datasheet.

  • @DhirubhaisNayak
    @DhirubhaisNayak 6 ปีที่แล้ว

    How did u connect those 6 wires to mq2 please tell me

  • @edwinchukwudi2939
    @edwinchukwudi2939 4 ปีที่แล้ว

    can i really use MQ-5 LPG Gas Sensor to measure Gas pressure

  • @robindavidson9611
    @robindavidson9611 9 ปีที่แล้ว +1

    Hi there, Your videos are really great and I need to make one of your gas sensor alarm using Arduino. Can you PLEASE tell me where I can find the download link for the Arduino software for this project. I cannot see it anywhere.

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Robin Davidson Thanks a lot! You can download the code from the project page on my website, here: electronfun.com/project_2.php
      The link is also in the description of the video.

  • @abrehamwolde787
    @abrehamwolde787 5 ปีที่แล้ว

    does this program display numerical values on LCD???

  • @dr.mithilfaldesai3561
    @dr.mithilfaldesai3561 2 ปีที่แล้ว

    What is the output unit A0? current (mA) or resistance(mohms)?

  • @marcomagracia9840
    @marcomagracia9840 7 ปีที่แล้ว

    Hello sir. I am planning to use MQ-2 for our project but it would be used in op-amp comparator circuit. is it possible to use this sensor in this manner? or it would only work with coded program circuits?
    And are the A pins for supply and the B pins for output? The center pins are for heating element and ground
    Thank you!

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว +1

      MQ-2 can be used in many different ways, you don't need the code if you don't want to use a microcontroller.
      The 2 central pins are for the heating element. Both pairs of pins A and B can be swapped - so the B pair can become the A pair and vice versa. It doesn't matter which pair is A and which is B for you. There is also no polarity for the heating element and you can power it even by 5V AC.

    • @marcomagracia9840
      @marcomagracia9840 7 ปีที่แล้ว

      Thank you for your response sir. But i am still confused.
      Can you please help me with my circuit for our thesis. Can I email you?
      Anyway our project is about ethylene extracting from the crater (device) which has mangoes as subject. The goal is to turn on the fan (exhaust) if it senses that the gas concentration is greater than our set reference value (VALUE IS IN PPM), in order to remove the ethylene gas inside the chamber. My problem is I do not understand how to convert the analog output of MQ2 (still not sure if its analog voltage or what) into its corresponding GAS PPM level and vice versa. By the way im using PIC16F877 not Arduino.
      Please help me sir. Please please.
      Thank you very much!

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว +1

      Hi, I make videos to inspire people. I want you guys to come up with project ideas, solve problems and make your projects work on your own. I'm not able to help with every project I'm asked about, sorry.
      I have a regular job and struggle against time every single day, because making videos takes so much time and effort. I hope you'll understand my point of view. Sorry I'm not able to help with your project.
      I wish you good luck and believe you come up with the best solution for your needs.

  • @johnjoseph2064
    @johnjoseph2064 6 ปีที่แล้ว +1

    thanks for the video man

  • @Socceregy
    @Socceregy 9 ปีที่แล้ว +1

    Very cool. Thanks for sharing!

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Thanks for watching and your nice comment.

  • @alibarznji2000
    @alibarznji2000 4 ปีที่แล้ว

    i subbed thanks
    i have one question though
    can you measure the gas flow with arduino?

    • @samschannel531
      @samschannel531 4 ปีที่แล้ว +1

      This thing is meant to measure atmospheric concentration of the gas, not flow in a channel.

    • @alibarznji2000
      @alibarznji2000 4 ปีที่แล้ว +1

      @@samschannel531 what about the flow in a channel

  • @AA-cn9vq
    @AA-cn9vq 8 ปีที่แล้ว

    Hey great project.
    I am doing something similar but I am confused are the sensor value same as the concentration value of the gas, I want to measure the consentration of LPG in a room.

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว +1

      +alnada alkubaisi Thanks :)
      Unfortunately it's not that easy. The readings are just analog values taken from the sensitive element and converted by Arduino to digital values between 0 and 1023.
      To get values in some well known units like ppm, you need to calibrate the sensor. Normally you would need special equipment to do it, but if you want to use an MQ-2 sensor, there is a piece of code made by Sandbox Electronics, which simplifies the calibration process, but the readings will be less accurate. You can read more about it, here: sandboxelectronics.com/?p=165.
      By the way - I'm starting my new video about the MQ-2 calibration with the Sandbox Electronics piece of code.

    • @AA-cn9vq
      @AA-cn9vq 8 ปีที่แล้ว +1

      +ElectronFun.com Hi, thanks for the replay it was very helpful.

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +alnada alkubaisi Thanks :)

  • @shantanu10496
    @shantanu10496 8 ปีที่แล้ว

    superb tutorial. very easy to understand. thank u so much !

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Shantanu Baji Thanks a lot for your kind words :)

  • @dasarianand99
    @dasarianand99 7 ปีที่แล้ว

    hello sir, Is it possible to take both the CO and smoke values at a time ? and how to show the demo for the CO?

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      I have a video about calibrating an MQ-2. You can get CO, LPG and smoke values at the same time. See my last video.