r/arduino 4d ago

Hardware Help Can I use an MQ137 without the module?

Hello, I'm new to all eletronics and I'm having trouble doing things on my own without following a tutorial and copying what they do when it comes to connect things. I wanted to buy an MQ137 (sensor for ammonia), but where I'm at it's quite difficult and expensive to get. I found one available at an e-store but it comes without that module I see in all pictures. Can I still use that or is it too advanced? I found in a page that it has 6 pins, one goes to Vcc and the other to GND, that I get, and the others I see that I need to connect to an analog pin, but there are some resistors involved and I don't understand how to calculate it.

I'd appreciate any help or if you have a link that does it. Thank you!

5 Upvotes

16 comments sorted by

4

u/magus_minor 4d ago edited 4d ago

The datasheet you linked shows a test circuit in fig 2. That shows you can connect 4 of the pins together in pairs, one pair connecting to 5v and the other pair are used as an output. So you only need 4 connections to the rest of your circuit. This page

https://components101.com/sensors/mq137-gas-sensor

shows connections to the bare device in the "How to use MQ-137 sensor to measure PPM" paragraph.

The MQ137 sensor has an Arduino library at

https://github.com/FacundoPumilla/MQ137

which might be useful. There are various online tutorials that use the "bare" sensor.

2

u/twaw09 3d ago

Hello, thank you so much for all the links! I have a few questions, if A-A and B-B can be connected together, then why doesn't it just have one A and one B? Also, I see in the diagram that it uses a 10 kΩ resistor, but I saw in another sheet that it used a 4.7k one, does it depend on the sensor? Or could I just use any resistor I want and just recalculate everything? I know it's probably a silly question but I'm trying to understand.

1

u/magus_minor 3d ago

if A-A and B-B can be connected together, then why doesn't it just have one A and one B?

I don't know, but why does it matter? If it works with them connected just do that.

could I just use any resistor I want and just recalculate everything?

You could use any resistor within reason. You have to experiment.

1

u/twaw09 3d ago

It matters to me because I don’t want to just copy what a tutorial says. I’m trying to understand. I don’t want to just get something done and just get a measurement, I want to begin to understand all these basic concepts and I was expecting you to tell me something like “it matters because that way you will have less current in the sensor” so I would think I understood at least that about current. But still thank you for your previous comment, I found the links very helpful

3

u/gm310509 400K , 500K , 600K , 640K , 750K 4d ago

It is difficult to comment on the technical aspects of what you are asking about without the specific details of the parts you are referring to. Can you supply links to the parts you are referring to?

As for is it too complex, again this is difficult to say on your behalf. We don't know your skill levels, but clearly people have used all types of sensors, so in general, no it probably isn't too complex for a person with mid level knowledge.

As for following tutorials, everybody learns by example, so following tutorials is normal. The big question is do you take the time to try to understand what is going on then try to build upon that learning with the next one?

3

u/twaw09 4d ago

Hello, thanks for replying. I'm sorry, I thought it was like a generic or common name for the component. Here is a sheet I found: https://www.winsen-sensor.com/d/files/semiconductor/mq137.pdf the project for now is just that: use the sensor to measure ammonia in ppm and log it. All the tutorials I found use a sensor which comes in a module with just 4 pins (for example here https://m.media-amazon.com/images/I/61QhBrFuKNL._AC_UF1000,1000_QL80_.jpg ), but the only available option I have for purchasing is the bare sensor with 6 pins, but I wouldn't know how to connect it.

1

u/gm310509 400K , 500K , 600K , 640K , 750K 3d ago

I thought it was like a generic or common name for the component.

Yes that is potentially true. But as you went on to explain, what you have is different to the information you have. And that is the main point. If you provide a link to "one that is like it", it could still be different to what you have.

You say that you have a module that has 4 pins. There are 24 different ways to connect up 4 pins. If we do not know the exact pinout then you might get advice that incorrectly connects the power and damages something. Similarly if we do not know the function/purpose of the other two pins then it is also difficult to give you advice. For exanple it might use a USART. In which case you need to connect it to another USART on the Arduino. On the other hand it might be I2C, in which case it needs to be connected to an I2C port (which is a different set of pins). Maybe they are a "data is available Interrupt" pin with an analog output.

My point is that there are lots of options. Also, computer stuff is extremely pedantic. So accurate details are important when asking for help.

On the device you have, do the pins have any markings or labeles printed near them on the PCB?

2

u/twaw09 2d ago

I think you’re blowing this out. If you had actually read my post, you’d find out I don’t have a sensor, and the one I plan to buy does not have a module. Anyway, the other commenters kindly explained to me what I was asking and provided some useful information so I think I’m all set now.

1

u/gm310509 400K , 500K , 600K , 640K , 750K 2d ago

Sorry, I totally missed the "not purchased yet" aspect in your followup reply but I do see it there now.

1

u/twaw09 1d ago

It's all right! It happens

3

u/al2o3cr 4d ago

Check out the schematic on this page, it's for the MQ135 but that sensor has identical expectations to the MQ137:

https://www.waveshare.com/wiki/MQ-135_Gas_Sensor

All that's strictly required is the top-left section with the sensor and the resistors. MQ_R2's value of 4.7k matches the recommendation of the datasheet you linked.

The other parts (LEDs, a "digital out" from an adjustable comparator, a 5V regulator) are optional. The regulator is important since the sensor works as a voltage divider - any power-supply fluctuation will look like signal.

2

u/twaw09 3d ago

Hello, thanks a lot for your answer! Let me see if I understand it correctly: I need to connect the H's and only one of A+one of B? Or both A's and B's to the same cable? (In other words, does it have two redundant pins? Or do I need to connect them as well so that the current on them is smaller or something like that?). I also think I understand the point of the 4.7 resistor, but why is there one on H (the one called MQ_R1)? Doesn't the heater need all 5V?

Regarding the "regulator" (I googled and what I got is that it's meant to regulate the 5V that come from the source so they're always stable), do you mean I also must purchase that? If I use an ESP32, isn't the 5V from Vcc stable?

One last question: when you talk about "digital out" and "comparator", I understand that it would only give me an on or off value based on some threshold I set, so I wouldn't really be able to measure the actual values. Is that correct?

Sorry if it's too many questions, I'm trying to understand all I can

2

u/async2 4d ago

It's less than 10usd though. If you don't need many it's not crazily expensive.

2

u/twaw09 3d ago

The most affordable one I could find in my country is 20 usd. I don't have easy access to amazon and all those stores

2

u/async2 3d ago

Aliexpress is not shipping to you?

1

u/twaw09 3d ago

Yes but I didn’t find the prices there any cheaper than local options, and it says it would arrive on 12th July. I’m not really in a hurry but it’s not something I prefer and I already purchased from a local store online. But thank you for suggesting it