ESP8266 Air quality sensor

Everything about esp8266 and more.

Moderator: leecollings

User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

joostnl wrote: Sunday 17 December 2017 21:38 Thanks for al your hard work! Can you supply a photo from your hardware set up? What kind of power supply and case are you using?
I still have to work on the encasing and want to make something myself, so currently have all still out in the open except for the MHZ19b, for which I've made a cardboard little box with holes in the side to left the airflow in but still protect it against light influence.
So not too much to show for yet, but will make some when I have the finish product. ;)
The Power supply is this one: https://nl.aliexpress.com/item/1-stks-h ... 55300.html

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

jvdz wrote: Sunday 17 December 2017 22:07 @nixalsschrott,
Is the MHZ19 working now for you as you post seems inclusive for me or is the Bold part added later and I should stop reading there? :D

The Bmp180 & DHT22 are connected as described in this webpage: https://diyprojects.io/esp-easydht22bmp ... -barometer
....
Dear Jos,

yes, MHZ19B is running and also delivering values. Seems OK now. Also BMP180 is running, collecting values, but since there is no corresponding virtual sensor in Domoticz I cannot visualize the values there. Only have temp, temp & huminity and temp & huminity & barometer. Even if selecting the last one, the values don‘t show in dashboard.
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

I am using a dummy "Temp + Baro" device to receive the information from the BMP180.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

Dear Jos,

Everything up and running now. All sensors collecting values and deliver values to Domoticz virtual switches accordingly.
From my point of view a very cheap way to get a sensor for co2 air condition inclusive temp, huminity and baro. Great.
Therefore thanks a lot for support and description.

Kind regards and a happy XMAS.
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

You're welcome und Fröhliche Weihnachten to you too!

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

By the way - does the sensor need calibration e.g. outdoors with the abc function on?
Is it possible simply going out and activate abc for a short time. Indoors deactivate abc again or deactivate already outside?
How to do it best?
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

I have ran it with ABC disabled and now run it with ABC enabled for weeks as the air refreshes during the night to a "standard" level.
So, when I understand it correctly, with ABC enabled, the calibration is done regularly and there is no need to do this outside.
Main purpose for my usage is not to do exact science with the value but really to activate the central ventilation system and set it to LOW/MEDIUM/HIGH depending on the PPM level.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

Dear all,

regarding the calibration from my testing it is also possible to switch on the ABC normal for e.g. 24 to 48 hours, best case nobody is at home during that time. If the ventilation was very good before or inbetween, then the lowest values will be adjusted to 395 ppm. Afterwards it is possible to switch off ABC normal again. The calibration will not Switch back. Therefore you do not need to calibrate outside or with a special gas. It seems to be pretty reliable. We are using automatic ventilation system with heat recovery, where air inside a room is refreshed 2-3 times within 24 hours.

My graph is now looking like this:
AF3D89A6-7C94-43AC-BC34-8A1B63F4AFA2.png
AF3D89A6-7C94-43AC-BC34-8A1B63F4AFA2.png (81.66 KiB) Viewed 3889 times
Kind regards
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
ThomasTelos
Posts: 11
Joined: Tuesday 02 January 2018 21:56
Target OS: Windows
Domoticz version:
Contact:

Re: ESP8266 Air quality sensor

Post by ThomasTelos »

Hello Nixalschrott,
Ein Schönes Neujahr ;-)
I have the same error messages as you with my MHZ19.
I ordered a new one with no result.
I just followed all the steps in the instructions.
Also I changed the GPIO's in GPIO15 and GPIO13.
Using latest version ESP_Easy_v2.0.0-dev13_test_ESP8266_4096
Still no result ;-(
Can you, or an other one who read this mail please help me?

Regards, Thomas
Attachments
mhz19error.JPG
mhz19error.JPG (59.87 KiB) Viewed 3831 times
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

Have you also double checked the wiring?

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
ThomasTelos
Posts: 11
Joined: Tuesday 02 January 2018 21:56
Target OS: Windows
Domoticz version:
Contact:

Re: ESP8266 Air quality sensor

Post by ThomasTelos »

Hello Jos,
Yes, that is why I used 2 different breadbords and 2 different mhz19.
Both test set ups gave the same error msge
My ESP are ESP32F on a flashable little board (from BG)
ThomasTelos
Posts: 11
Joined: Tuesday 02 January 2018 21:56
Target OS: Windows
Domoticz version:
Contact:

Re: ESP8266 Air quality sensor

Post by ThomasTelos »

Correction! Sorry
The tests are done with the ESP12F
(I am still waiting for the esp32 from China)
Thomas
ThomasTelos
Posts: 11
Joined: Tuesday 02 January 2018 21:56
Target OS: Windows
Domoticz version:
Contact:

Re: ESP8266 Air quality sensor

Post by ThomasTelos »

mhz19 Led is flashing
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

The error you get means that it doesn't receive any data back from the MHZ19 after it has send the command for the current status.
So it should be either something with the GPIO settings ( Maybe wrong way around?) or the wiring unless you unit is broken.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

Hi,

as you can see in my post before it seems that you are not using the correct and modified software version from jos.
Try flashing the correct version in MHZ19b branch.

https://github.com/jvanderzande/ESPEasy/tree/MHZ19b
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

@nixalsschrott,
I think it should still show the correct values in the ESPEasy log for the MHZ19b. I made the separate version at the time since the b version wasn't supported (lack of s value) and also made some modifications to directly support the Domoticz integration without the need for an Rule.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
ThomasTelos
Posts: 11
Joined: Tuesday 02 January 2018 21:56
Target OS: Windows
Domoticz version:
Contact:

Re: ESP8266 Air quality sensor

Post by ThomasTelos »

Mhz19 working now! I flashed a new ESP12 with only the Mhz19 connected.
(flash was latest Mega version)
Stupid beginners fault, I changed Tx and Rx didn’t see that all that time!
But….. I learned a lot about Domoticz and ESP with Letscontrolit flashing.
I have some other interesting projects to find out ;-) and some more interesting things to figure out and study.
I keep you informed when I find something “special” ánd have questions ;-)
One more question: the value U in the CO2 device is always zero? What is this U?
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

Good you got it working.
Don't really know but notices that the U value only changes when you have the ABC enabled.
The code contains:

Code: Select all

#define PLUGIN_VALUENAME3_049 "U"   // Undocumented, minimum measurement per time period?
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Mads
Posts: 40
Joined: Thursday 18 January 2018 20:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ESP8266 Air quality sensor

Post by Mads »

Hey Jos.

Can you help me. Just got my mh-z19 sensor, and set it up with my esp226.
flashed the esp with espeasy 2.0 mega test from GitHub.

In the log I can see the sensor point out data, but I don't get the info in my Domoticz.

Log
2285034 : EVENT: co2#PPM=1320.00
2285053 : ACT : SendToHTTP 192.168.1.188,8080,/json.htm?param=udevice&type=command&idx=12&nvalue1320.00
2285170 : EVENT: co2#Temperature=28.00
2285260 : EVENT: co2#U=0.00
2286923 : WD : Uptime 38 ConnectFailures 0 FreeMem 20120
2295034 : MHZ19: PPM value: 1317 Temp/S/U values: 28/0/0.00
2295034 : EVENT: co2#PPM=1317.00
2295052 : ACT : SendToHTTP 192.168.1.188,8080,/json.htm?param=udevice&type=command&idx=12&nvalue1317.00
2295172 : EVENT: co2#Temperature=28.00
2295262 : EVENT: co2#U=0.00

domoticz hardware:
idx
12 Co2 Stuen Ja Dummy (Does nothing, use for virtual switches only) Opret virtuelle sensorer Deaktiveret

tryied to put in the rules, but that didn't help.
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

Your rule is missing an equal sign after nvalue!
/json.htm?param=udevice&type=command&idx=12&nvalue=1320.00

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests