Connecting M5Stack to an MQ-2 smoke/gas sensor
-
I am trying to port my ESP8266 project to M5Stack but for the life of me I could not figure out how to connect the wires between M5Stack and the analog MQ-2 gas sensor.
This is my wiring for ESP8266 that perfectly works:
MQ-2 Sensor -> ESP8266 A0 -> A0 D0 -> D0 VCC -> VIN (5.5V) GRD -> GRDThis is what I have tried in M5Stack but did not work. The sensor's D0 LED and power LED do not even lit on.
MQ-2 Sensor -> M5Stack A0 -> Pin 36 (I also have tried 35) D0 -> Pin 21 (I also have tried 16) VCC -> 5V GRD -> GHow do I wire the analog MQ-2 sensor To M5Stack? Is it doable? Any guidance please?
-
@suntzu Hi Suntu,
Try sourcing the 5V from the positive terminal on the Grove connector.
-
@JimiT I will try that when I get back home from the office. And I will make sure to keep you updated.
Thank you so much, Jimi.
-
@jimit 在 Connecting M5Stack to an MQ-2 smoke/gas sensor ä¸è¯´ï¼š
@suntzu Hi Suntu,
Try sourcing the 5V from the positive terminal on the Grove connector.
It worked like a charm! Thank you again. It's time to rewrite my sketches for M5Stack.
-
@suntzu Glad to hear it worked !!!!
And you used pins 36 and 21 ?
Now I will have to order some of these MQ-2 sensors !! Thank you for the tip.
If you are open to posting a link to your code or a screenshot when done, that would be interesting to see.
-
@JimiT Yes, I used Pin 36 and 21.
Absolutely, I will post the finish product and pictures in the Projects section.
-
I am been able to read the ADC on pin 35. This corresponds to ADC1_CH7 BUT I cannot get ADC on pin 36 to work. I think this is ADC1-CH0. Anybody has any sample code ? Thanks.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login