-
Notifications
You must be signed in to change notification settings - Fork 12
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
I can not use in ESP8266 #6
Comments
Hello. I will look at this issue but not sooner than the next weekend. |
No, everything looks okay. |
I try to nodeMCU on UART ESP8266 version 2.3, But It does not work. So I can test only UNO on PWM... |
Error code 5 equals MHZ19_RESULT_ERR_TIMEOUT. The sensor didn't respond for more than 500 milliseconds. |
I've no idea how I can help you. The MHZ19 library works without any issues on Arduino Nano (the same ATmega328P that in Uno), just tested it again https://i.imgur.com/zL59nmG.jpg it also works on Mega, esp8266 and esp32 (tested a few weeks ago). Maybe you have some issues with the sensor itself. P.S. |
I am really thank you about your helps. There are my finally test lists: I tried many tests, then UNO - PWM was works good. maybe, my test was something wrong in yesterday. Thank you so much for your replies. |
I've used four sensors simultaneously on Arduino Mega (three via hardware serial + one via software serial) to compare results. You could try esp32 it has one additional hardware serial and supports software one too (AFAIK). I'm glad you managed to solve your task. |
I have this issue. I want to use the library on a Wemos D1 Mini using ports D1 and D2 for software serial. I get Error 3. Any tips on this? |
@jwktje this issue was more about the PWM library. If you think that the MHZ19 library has some bug - please open a new issue. |
Hello, I tested your PWM code with UNO to MHZ19B. It works very well.
So I want use your library with nodeMCU ESP8266 12E. But It does not work.
my code:
#include <MHZ19PWM.h>
MHZ19PWM mhz(5, MHZ_DELAYED_MODE);
void setup()
{
Serial.begin(115200);
Serial.println(F("Starting..."));
mhz.useLimit(5000);
}
void showValue()
{
unsigned long start = millis();
float co2 = mhz.getCO2();
unsigned long duration = millis() - start;
Serial.print(F("CO2: "));
Serial.println(co2);
Serial.print(F("Duration: "));
Serial.println(duration);
Serial.println();
}
void loop()
{
showValue();
delay(5000);
}
my direction:
nodeMCU ---- sensor
Vin ---- Vin
GND ---- GND
D1(GPIO5) ---- PWM
my serial monitor:
![serial monitor](https://user-images.githubusercontent.com/25508903/58821407-f582e980-866f-11e9-8e8e-3ed00204f652.png)
help me please....
The text was updated successfully, but these errors were encountered: