Wemos D1 mini with MQ135

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ohadbenita
New user
Posts: 5
Joined: 29 Dec 2017, 20:15

Wemos D1 mini with MQ135

#1 Post by ohadbenita » 29 Dec 2017, 20:25

Hi there, I'm new to ESPEasy and so I've tried to use MQ135 to detect CO2 levels around the house
I've connected the sensor to the 3v3 output from the D1 mini, although I see that the spec define 5v as the recommended voltage
I managed to get a reading but it's not so stable so I have a few questions :

1. How do I get the rzero value of the sensor ? is there some kind of way in ESPEasy to upload sketches and run them without re-flashing ?
2. If I would be able to get the rzero, where do I put it in the Analog Plugin input configuration ?
3. Should I connect the sensor's input to the Wemos' 5V output pin ? Is there a risk the sensor would give an output of above 3.3v back to the board ? why is it dangerous to have such voltage back to the Wemos ?

Thanks in adavnce !

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Wemos D1 mini with MQ135

#2 Post by TD-er » 29 Dec 2017, 20:54

The analog input of the ESP8266 only allows between 0 and 1 V, so if you want to measure higher voltages, you should use 2 resistors to make the measuring part fit in that range.
For example 1kOhm + 4k7 Ohm in series with the voltage to be measured, with the 1K over the analog input. (voltage range is then 5.7 V)

ohadbenita
New user
Posts: 5
Joined: 29 Dec 2017, 20:15

Re: Wemos D1 mini with MQ135

#3 Post by ohadbenita » 30 Dec 2017, 08:00

Thanks for your reply :)

I was wondering about your comment, given that you suggested in your example to use 4.7K & 1K Ohm resistors :
This would be for a source which voltage range is 5.7V ? do you have any knowledge of the MQ-135 Analog output voltage range ?

Thanks

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Wemos D1 mini with MQ135

#4 Post by TD-er » 30 Dec 2017, 17:39

No, have no idea of that sensor. But when you feed it with 5V, it is likely the sensor will not output more than that.
You still have to do a correction in software, so it doesn't have to match exactly as long as you know the factor of the voltage divider you create and you make sure the voltage on the analog input does not exceed 1V.
So using very standard E12 range resistors creates a very simple voltage divider.
With 1k2 and 4k7 you get a range close to, but a little less of 0..5V So when you supply it via some kind of USB plug, it may get up to 5.1V, which will result in possible higher input than 1V.
So then 1k and 4k7 it is :)

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Wemos D1 mini with MQ135

#5 Post by papperone » 30 Dec 2017, 20:28

D1 mini has already a voltage divider on ADC pin (100k + 240k)
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

ohadbenita
New user
Posts: 5
Joined: 29 Dec 2017, 20:15

Re: Wemos D1 mini with MQ135

#6 Post by ohadbenita » 30 Dec 2017, 20:46

Thanks for that,

Would be glad if anyone else familiar with the sensor could help with getting the rzero and where should I put it in the ESPEasy formula

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Wemos D1 mini with MQ135

#7 Post by papperone » 31 Dec 2017, 06:55

As far as I can see from a quick google search this sensor is not straghtforward usage.
I think would be better to have a proper plugins for all MQ-xx variances to have correct calibration and readings
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

ohadbenita
New user
Posts: 5
Joined: 29 Dec 2017, 20:15

Re: Wemos D1 mini with MQ135

#8 Post by ohadbenita » 31 Dec 2017, 12:02

I saw there is an unofficial for the MQ135 but I'm not sure how to add it in order to test it
https://diyprojects.io/esp-easy-develop ... kjDrN-WY2w

ohadbenita
New user
Posts: 5
Joined: 29 Dec 2017, 20:15

Re: Wemos D1 mini with MQ135

#9 Post by ohadbenita » 31 Dec 2017, 23:34

I tried to play a bit with this library but the readings I got from it made no sense...
I'll use it as a general "air quality" sensor...

One more question I'd like to know the answer to - say I'd like to connect a DHT22 temp\humidity sensor on the same D1 mini
The MQ135 connects to A0, 3v3 and GND
Is there a way to connect the DHT22 to the same board ?

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests