Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MHZ-19 #561

Closed
jiraff opened this issue Jun 29, 2017 · 4 comments
Closed

MHZ-19 #561

jiraff opened this issue Jun 29, 2017 · 4 comments
Labels
stale Action - Issue left behind - Used by the BOT to call for attention

Comments

@jiraff
Copy link

jiraff commented Jun 29, 2017

Hello. Can I add my СО2 sensor to the Tasmota? Connection on the TX TX or PVM. Here's how I connected to gpio14 on PWM:

#define pwmPin 14
#define LedPin 13

Int prevVal = LOW;
Long th, tl, h, l, ppm;

Void setup () {
   Serial.begin (9600);
   PinMode (pwmPin, INPUT);
   PinMode (LedPin, OUTPUT);
}

Void loop () {
   Long tt = millis ();
   Int myVal = digitalRead (pwmPin);

   // If you find a change
   If (myVal == HIGH) {
     DigitalWrite (LedPin, HIGH);
     If (myVal! = PrevVal) {
       H = tt;
       Tl = h - l;
       PrevVal = myVal;
     }
   } Else {
     DigitalWrite (LedPin, LOW);
     If (myVal! = PrevVal) {
       L = tt;
       Th = l - h;
       PrevVal = myVal;
       Ppm = 5000 * (th - 2) / (th + tl - 4);
       Serial.println ("PPM =" + String (ppm));
     }
   }
}

Thank you.

@TD-er
Copy link

TD-er commented Jun 30, 2017

The problem with looking to the PWM-pin is that you do not take into account the "S" value computed by the sensor. This bit-shifted value proves to be an indicator for the stability of the measurement of the CO2 value.
The S-value is outputted via the serial line, along with the value.

And another thing, you use a scale of 5000, while most of these sensors are in the range of 400-2000 ppm.

@jiraff
Copy link
Author

jiraff commented Jul 5, 2017

I'm wondering what and where to put in the code Sonoff-Tasmota that would see the readings of mhz-19 in mqtt ...

arendst added a commit that referenced this issue Dec 4, 2017
Add (experimental) support for sensor MH-Z19(B) to be enabled with
define USE_MHZ19 in user_config.h (#561, #1248)
arendst added a commit that referenced this issue Dec 5, 2017
Add experimental support for sensor MH-Z19(B) using SoftwareSerial to be
enabled with define USE_MHZ19 in user_config.h (#561, #1248)
arendst added a commit that referenced this issue Dec 6, 2017
5.10.0a
 * Add (experimental) support for sensor SHT3x
 * Add support
for sensor MH-Z19(B) using serial interface to be enabled with define
USE_MHZ19 in user_config.h (#561, #1248)
 * Add (experimental) support
for sensor MH-Z19(B) using SoftwareSerial to be enabled with define
USE_MHZ19 in user_config.h (#561, #1248)
 * Add support for iTead SI7021
temperature and humidity sensor by consolidating DHT22 into AM2301 and
using former DHT22 as SI7021 (#735)
 * Fix BME280 calculation (#1051)
 *
Add support for BME680 using adafruit libraries (#1212)
 * Change
ADS1115 default voltage range from +/-2V to +/-6V (#1289)
 * Add
multipress support and more user configurable options to Sonoff Dual R2
(#1291)
 * Fix Sonoff Bridge missed learned key if learned data contains
0x55 (End of Transmission) flag (#1095, #1294)
 * Add support for
TSL2561 using adafruit library (#661, #1311)
 * Add alternative support
for SHT3x (#1314)
arendst added a commit that referenced this issue Dec 8, 2017
5.10.0a
 * Add (experimental) support for sensor SHT3x
 * Add support
for sensor MH-Z19(B) using serial interface to be enabled with define
USE_MHZ19_HARD_SERIAL in user_config.h (#561, #1248)
 * Add
(experimental) support for sensor MH-Z19(B) using SoftwareSerial to be
enabled with define USE_MHZ19_SOFT_SERIAL_OBSOLETE in user_config.h
(#561, #1248)
 * Add (experimental) support for sensor MH-Z19(B) using
stripped SoftwareSerial to be enabled with define USE_MHZ19_SOFT_SERIAL
in user_config.h (#561, #1248)
 * Add support for iTead SI7021
temperature and humidity sensor by consolidating DHT22 into AM2301 and
using former DHT22 as SI7021 (#735)
 * Fix BME280 calculation (#1051)
 *
Add support for BME680 using adafruit libraries (#1212)
 * Change
ADS1115 default voltage range from +/-2V to +/-6V (#1289)
 * Add
multipress support and more user configurable options to Sonoff Dual R2
(#1291)
 * Fix Sonoff Bridge missed learned key if learned data contains
0x55 (End of Transmission) flag (#1095, #1294)
 * Add support for
TSL2561 using adafruit library (#661, #1311)
 * Add alternative support
for SHT3x (#1314)
arendst added a commit that referenced this issue Dec 19, 2017
* Add support for sensor MH-Z19(B) to be enabled with define USE_MHZ19
in user_config.h (#561, #1248)
arendst added a commit that referenced this issue Jan 7, 2018
5.11.0 20180107
 * Minor webpage HTML optimizations (#1358)
 * Updated
German translation (#1438)
 * Change Sonoff Pow Energy MQTT data message
and consolidate Status 8 into Status 10
 * Change ADS1115 default
voltage range from +/-2V to +/-6V (#1289)
 * Change text to Active for 3
minutes (#1364)
 * Change Wemo SetBinaryState to distinguish from
GetBinaryState (#1357)
 * Change output of HTTP command to valid JSON
and Array only (#1363)
 * Removed all MQTT, JSON and Command language
defines from locale files and set fixed to English (#1473)
 * Renamed
commands Color2,3,4 to Color3,4,5
 * Fix BME280 calculation (#1051)
 *
Fix Sonoff Bridge missed learned key if learned data contains 0x55 (End
of Transmission) flag (#1095, #1294)
 * Fix PWM initialization in
Dimmer/Color mode (#1321)
 * Fix Wemo Emulation (#1357)
 * Fix display
of build date and time in non-english locale (#1465)
 * Fix Wemo and Hue
emulation by adding M-Search response delay (#1486)
 * Add libraries
Adafruit_BME680-1.0.5, Adafruit_Sensor-1.0.2.02, TasmotaSerial-1.0.0 and
TSL2561-Arduino-Library
 * Add command Color2 to set color while keeping
same dimmer value
 * Add device function pointers
 * Add support for
SenseAir S8 CO2 sensor
 * Add color led signal to Carbon Dioxide (CO2)
sensors using defines CO2_LOW and CO2_HIGH in user_config.h
 * Add
support for Domoticz Air Quality sensor to be used by MH-Z19(B) and
SenseAir sensors
 * Add support for PZEM004T energy sensor
 * Add
support for iTead SI7021 temperature and humidity sensor by
consolidating DHT22 into AM2301 and using former DHT22 as SI7021 (#735)

* Add support for BME680 using adafruit libraries (#1212)
 * Add support
for MH-Z19(B) CO2 sensor (#561, #1248)
 * Add multipress support and
more user configurable GPIO to Sonoff Dual R2 (#1291)
 * Add support for
TSL2561 using adafruit library (#661, #1311)
 * Add support for SHT3x
(#1314)
 * Add support for Arilux LC06 (#1414)
 * Add Italian language
file (#1449)
 * Add 2nd Gen Alexa support to Wemo emulation discovery
(#1357, #1450)
 * Add define for additional number of WS2812 schemes
(#1463)
joecotton pushed a commit to joecotton/Sonoff-Tasmota that referenced this issue Jan 8, 2018
5.11.0 20180107
 * Minor webpage HTML optimizations (arendst#1358)
 * Updated
German translation (arendst#1438)
 * Change Sonoff Pow Energy MQTT data message
and consolidate Status 8 into Status 10
 * Change ADS1115 default
voltage range from +/-2V to +/-6V (arendst#1289)
 * Change text to Active for 3
minutes (arendst#1364)
 * Change Wemo SetBinaryState to distinguish from
GetBinaryState (arendst#1357)
 * Change output of HTTP command to valid JSON
and Array only (arendst#1363)
 * Removed all MQTT, JSON and Command language
defines from locale files and set fixed to English (arendst#1473)
 * Renamed
commands Color2,3,4 to Color3,4,5
 * Fix BME280 calculation (arendst#1051)
 *
Fix Sonoff Bridge missed learned key if learned data contains 0x55 (End
of Transmission) flag (arendst#1095, arendst#1294)
 * Fix PWM initialization in
Dimmer/Color mode (arendst#1321)
 * Fix Wemo Emulation (arendst#1357)
 * Fix display
of build date and time in non-english locale (arendst#1465)
 * Fix Wemo and Hue
emulation by adding M-Search response delay (arendst#1486)
 * Add libraries
Adafruit_BME680-1.0.5, Adafruit_Sensor-1.0.2.02, TasmotaSerial-1.0.0 and
TSL2561-Arduino-Library
 * Add command Color2 to set color while keeping
same dimmer value
 * Add device function pointers
 * Add support for
SenseAir S8 CO2 sensor
 * Add color led signal to Carbon Dioxide (CO2)
sensors using defines CO2_LOW and CO2_HIGH in user_config.h
 * Add
support for Domoticz Air Quality sensor to be used by MH-Z19(B) and
SenseAir sensors
 * Add support for PZEM004T energy sensor
 * Add
support for iTead SI7021 temperature and humidity sensor by
consolidating DHT22 into AM2301 and using former DHT22 as SI7021 (arendst#735)

* Add support for BME680 using adafruit libraries (arendst#1212)
 * Add support
for MH-Z19(B) CO2 sensor (arendst#561, arendst#1248)
 * Add multipress support and
more user configurable GPIO to Sonoff Dual R2 (arendst#1291)
 * Add support for
TSL2561 using adafruit library (arendst#661, arendst#1311)
 * Add support for SHT3x
(arendst#1314)
 * Add support for Arilux LC06 (arendst#1414)
 * Add Italian language
file (arendst#1449)
 * Add 2nd Gen Alexa support to Wemo emulation discovery
(arendst#1357, arendst#1450)
 * Add define for additional number of WS2812 schemes
(arendst#1463)
@stale
Copy link

stale bot commented Apr 23, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Action - Issue left behind - Used by the BOT to call for attention label Apr 23, 2018
@stale
Copy link

stale bot commented May 7, 2018

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.

@stale stale bot closed this as completed May 7, 2018
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
Add (experimental) support for sensor MH-Z19(B) to be enabled with
define USE_MHZ19 in user_config.h (arendst#561, arendst#1248)
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
Add experimental support for sensor MH-Z19(B) using SoftwareSerial to be
enabled with define USE_MHZ19 in user_config.h (arendst#561, arendst#1248)
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
5.10.0a
 * Add (experimental) support for sensor SHT3x
 * Add support
for sensor MH-Z19(B) using serial interface to be enabled with define
USE_MHZ19 in user_config.h (arendst#561, arendst#1248)
 * Add (experimental) support
for sensor MH-Z19(B) using SoftwareSerial to be enabled with define
USE_MHZ19 in user_config.h (arendst#561, arendst#1248)
 * Add support for iTead SI7021
temperature and humidity sensor by consolidating DHT22 into AM2301 and
using former DHT22 as SI7021 (arendst#735)
 * Fix BME280 calculation (arendst#1051)
 *
Add support for BME680 using adafruit libraries (arendst#1212)
 * Change
ADS1115 default voltage range from +/-2V to +/-6V (arendst#1289)
 * Add
multipress support and more user configurable options to Sonoff Dual R2
(arendst#1291)
 * Fix Sonoff Bridge missed learned key if learned data contains
0x55 (End of Transmission) flag (arendst#1095, arendst#1294)
 * Add support for
TSL2561 using adafruit library (arendst#661, arendst#1311)
 * Add alternative support
for SHT3x (arendst#1314)
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
5.10.0a
 * Add (experimental) support for sensor SHT3x
 * Add support
for sensor MH-Z19(B) using serial interface to be enabled with define
USE_MHZ19_HARD_SERIAL in user_config.h (arendst#561, arendst#1248)
 * Add
(experimental) support for sensor MH-Z19(B) using SoftwareSerial to be
enabled with define USE_MHZ19_SOFT_SERIAL_OBSOLETE in user_config.h
(arendst#561, arendst#1248)
 * Add (experimental) support for sensor MH-Z19(B) using
stripped SoftwareSerial to be enabled with define USE_MHZ19_SOFT_SERIAL
in user_config.h (arendst#561, arendst#1248)
 * Add support for iTead SI7021
temperature and humidity sensor by consolidating DHT22 into AM2301 and
using former DHT22 as SI7021 (arendst#735)
 * Fix BME280 calculation (arendst#1051)
 *
Add support for BME680 using adafruit libraries (arendst#1212)
 * Change
ADS1115 default voltage range from +/-2V to +/-6V (arendst#1289)
 * Add
multipress support and more user configurable options to Sonoff Dual R2
(arendst#1291)
 * Fix Sonoff Bridge missed learned key if learned data contains
0x55 (End of Transmission) flag (arendst#1095, arendst#1294)
 * Add support for
TSL2561 using adafruit library (arendst#661, arendst#1311)
 * Add alternative support
for SHT3x (arendst#1314)
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
* Add support for sensor MH-Z19(B) to be enabled with define USE_MHZ19
in user_config.h (arendst#561, arendst#1248)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Action - Issue left behind - Used by the BOT to call for attention
Projects
None yet
Development

No branches or pull requests

2 participants