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

MQ-3 sensor and CH4 gas reading 'ovf' failure #75

Open
AndroidCrypto opened this issue Jul 29, 2024 · 1 comment
Open

MQ-3 sensor and CH4 gas reading 'ovf' failure #75

AndroidCrypto opened this issue Jul 29, 2024 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@AndroidCrypto
Copy link

Describe the bug
I'm trying to read the CH4 gas concentration with a MQ-3 sensor using these values for 'setA' and 'setB':

MQ3.setA(2*10^31);
MQ3.setB(19.01);
float ch4 = MQ3.readSensor();

Unfortunately, the library gives an 'ovf' as output. All other gas readings are working.

Additional context
I tested the library on with Arduino Uno R4 Wi-Fi microcontroller and 5V for VCC. The sensor is connected to A0 on the Arduino.

@miguel5612
Copy link
Owner

miguel5612 commented Sep 5, 2024

Thank you for reporting this issue. It seems that the overflow might be caused by the extremely large value used for setA (2*10^31), which is likely exceeding the limits of the variable type. To resolve this, we suggest adjusting the variable types or using alternative mathematical operations that handle large numbers more efficiently.

If you're able to make these changes and test them, it would be fantastic if you could contribute a merge request with the modifications. This would be a great enhancement to the library, and we appreciate your help in improving it!

@miguel5612 miguel5612 added help wanted Extra attention is needed good first issue Good for newcomers labels Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants