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

Problems using this code on ESP32 #14

Open
andrealmeida98 opened this issue Mar 9, 2021 · 3 comments
Open

Problems using this code on ESP32 #14

andrealmeida98 opened this issue Mar 9, 2021 · 3 comments

Comments

@andrealmeida98
Copy link

Hi , I tried using this code on ESP32 but the values from the getPPM() function were just not the same like on the UNO.

I know for a fact that the GPIO on esp32 is 4096, but changing the value on the getPPM() function, did not work. Any ideas? Thank you.

@denishessberger
Copy link

I'm having a similar issue, but on ESP8266 - my (uncorrected) PPM readings seem rather unrealistic (about 2ppm in room air, 15ppm if I blow smoke into the MQ135).

I went through the burn-in procedure of the sensor already.

@maddsua
Copy link

maddsua commented Feb 14, 2023

I'm not 100% sure, but It might be due to a floating point accuracy difference on AVR (Uno) and ARM (ESP32).

MQ-135 is analog sensor so you should consider trying to convert the data yourself, without the library. I mean, it's just some math, no bit ops or complex communications.

@NuclearPhoenixx
Copy link

What ADC resolution are you running at? The code only works for 10-bit ADC atm. See this line:

return ((1023./(float)val) * 5. - 1.)*RLOAD;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants