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

possible error in the calculation formula for _RS_Calc = ((_VOLT_RESOLUTION*_RL)/_sensor_volt)-_RL; #74

Open
berryPiTech opened this issue Mar 13, 2024 · 0 comments

Comments

@berryPiTech
Copy link

I think there is an error in the library source code (https://github.com/miguel5612/MQSensorsLib/blob/master/src/MQUnifiedsensor.cpp):

The variable _VOLT_RESOLUTION in the equation below should be 5V, not _VOLT_RESOLUTION, which is 3.3volts in case of esp32.
_RS_Calc = ((_VOLT_RESOLUTION*_RL)/_sensor_volt)-_RL; //Get value of RS in a gas

The above equation (line 148) is supposed to be the implementation of this equation in this link (https://www.jaycon.com/understanding-a-gas-sensor/).

RS = [(VC x RL) / VRL] – RL

The variables are in figure 6 of the link above.

Specifically Vcc=5V is the vcc to drive the heater of the sensor. It can't be 3.3volts, which is too low to drive the heater.

The correct formula should be:
_RS_Calc = ((_VCC*_RL)/_sensor_volt)-_RL;

where VCC = 5volts.

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

1 participant