1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Arduino and Ammonia Sensor MQ137 with sensor module

Discussion in 'Arduino' started by doodleskram, Nov 29, 2012.

  1. doodleskram

    doodleskram New Member

    Joined:
    Nov 29, 2012
    Messages:
    9
    Likes:
    0
    Hui anyone who try to used this sensor (ammonia sensor) and arduino? please help me because i have a project ammonia sensor for poultry and i have no experience in using this kind of sensor

    please help me...
     
  2. doodleskram

    doodleskram New Member

    Joined:
    Nov 29, 2012
    Messages:
    9
    Likes:
    0
    hi sorry but i cant understand your message. I think it is somewhat a different language.. Can you please translate it to english? if it is ok?
     
  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,161
    Likes:
    909
    Location:
    Rochdale UK
    ONLINE
    Spammer!! Gone now...

    What do you need to know
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. doodleskram

    doodleskram New Member

    Joined:
    Nov 29, 2012
    Messages:
    9
    Likes:
    0

    hello sir, i have a project and it is measurement of ammonia gas sensor for poultry industry. I bought an ammonia sensor MQ-137 ammonia sensor with sensor module from goodluckbuy.com.
    i interface this to arduino but the problem is i dont know how to calibrate this sensor. i have measured voltage that came from the serial monitor.
    what is written in the datasheet are the sensitivity of the sensor Rs/Ro vs ppm. how can i used this value to calibrate my sensor so that my measurement for ammonia will be accurate.
     
  6. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,161
    Likes:
    909
    Location:
    Rochdale UK
    ONLINE
    What voltage changes are you getting? If you test the voltage out in air only... This will be your zero... Then work out using the equation in the data sheet the MAX voltage.. Use a software map to Display your readings
     
  7. doodleskram

    doodleskram New Member

    Joined:
    Nov 29, 2012
    Messages:
    9
    Likes:
    0
    Sir in arduino i used this code

    float x = analogread(sensor) * 5/1023;

    then I wait a couple of minutes to stabilized the readings in the air and in serial monitor what ive got is 0.14
     
  8. doodleskram

    doodleskram New Member

    Joined:
    Nov 29, 2012
    Messages:
    9
    Likes:
    0
    in the datasheet sir there is no max voltage indicated only the sensitivity Rs/Ro is given. would you like to see the datasheet?
     
  9. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,161
    Likes:
    909
    Location:
    Rochdale UK
    ONLINE
    I've read it!!! Not the best datasheet I've seen.... I was looking at the YELLOW ppm graph... RS/RO = about 7 when ppm's are 10 then RS/R0 = about 0.6 when ppm's are 100

    *NOTE* its logarithmic... But you'll still be able to work it out...
     
  10. doodleskram

    doodleskram New Member

    Joined:
    Nov 29, 2012
    Messages:
    9
    Likes:
    0
    sir can you give an idea on how i will used this data in relationship with my output voltage? does the value of Rs/ro has a relationship with the output voltage?
     
  11. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,161
    Likes:
    909
    Location:
    Rochdale UK
    ONLINE
    Of course it has.... That's how these sensors work.... The resistance changes with the environment... you need to give the ADC the same two resistances / voltages so you can scale it.

    This is what you've got
    View attachment 68995

    The resistance through the sensor will alter the voltage.... What have you got for RL?
     
  12. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,801
    Likes:
    134
    Location:
    morristown,tn
    The resistance is like 2K to 15 at 50ppm per change.
     
  13. doodleskram

    doodleskram New Member

    Joined:
    Nov 29, 2012
    Messages:
    9
    Likes:
    0
    incorporated in the sensor module is the LM393 and a trimmer resistor with the value of 10kohms. I operate the sensor as of now the output voltage from the arduino is 0.06
     
  14. doodleskram

    doodleskram New Member

    Joined:
    Nov 29, 2012
    Messages:
    9
    Likes:
    0
    hello sir, Base on the figure that you posted, i try to use the graph Rs/R0 vs ppm I computed the output voltage for 10 ppm. please tell me if I am wrong with these calculation:
    Based on the graph the ratio of Rs/R0 = 1.5 for 10 ppm ( Nh3 data) and i manipulated the formula to find the Rs, which is Rs = 1.5(Ro). From the datasheet I used the lower value of R0 (from 900k - 4.9 Mohm). I used 900k as the resistance of sensor in clean air. THen I got 1.36 Mohm value of Rs coming for Rs = 1.5Ro.

    Then i used voltage divider formula to find the output voltage. for the voltage divider the formula is
    Vout = Vc( Rl/Rs + Rl)

    Vout = 5V( 10kohm / 1.35 Mohm + 10kohm)
    Vout = 0.0367647 V

    Does my analysis is correct?

    Does it mean that for 10 ppm i need to get this voltage level?
     
  15. doodleskram

    doodleskram New Member

    Joined:
    Nov 29, 2012
    Messages:
    9
    Likes:
    0
    hello sir ian any update regarding this? please help me....


    thanks
     
  16. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,801
    Likes:
    134
    Location:
    morristown,tn
    Last edited: Dec 3, 2012
  17. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,161
    Likes:
    909
    Location:
    Rochdale UK
    ONLINE
    Also.. Remember to check the datasheet... As there is a heater involved, you'll need quite a considerable delay ( In micro terms ) in order to read the correct value.

    Burt's Schematic should help you..
     
  18. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,801
    Likes:
    134
    Location:
    morristown,tn
    yep 24 hours the fist time LOL

    The first link is the data sheet it's a screen shot but I couldn't post as a image for some reason.

    It has the math for how the graft was plotted
     
    Last edited: Dec 4, 2012

Share This Page