Comments (2)
Hello,
Your observation is correct in the sense that there are 1024 possible values the ADC can take, ranging from 0 to 1023 (inclusive). However, the formula you mentioned:
v = ADC * A0_max_voltage / 1023
Is correct and is widely used when converting ADC readings to voltages. The reason why it's divided by 1023 instead of 1024 is because you're looking for a range that goes from 0 to A0_max_voltage. So, when the ADC reads 1023 (its maximum value), you want that to translate into the maximum voltage. If you divided by 1024, an ADC reading of 1023 would be slightly less than the maximum voltage, which wouldn't be correct.
As for your question about whether a different value can be set on the ADC, it will depend on the board and development platform you're using. Some microcontrollers allow you to configure the ADC resolution, which would change the range of values it can take. In the case of the ESP8266, the ADC resolution is fixed and cannot be changed. The ESP8266's ADC has a 10-bit resolution, which means it outputs 1024 (2^10) different values.
Can you provide me with an example of ADC whose minimum value is not zero to consider the change to 1024 in the library?
from mqsensorslib.
you are right!
from mqsensorslib.
Related Issues (20)
- how to use MQ2 to detect smoke. as the A and B value not given. HOT 1
- MQSensorsLib ADS1115 HOT 1
- MQ-7 sensor connecting with nodeMcu V3 HOT 2
- Integrate ADS1X15 inputs for sensor reading HOT 1
- PPM of MQ135 at clean air HOT 2
- Why 10k resistor is needed HOT 1
- retries and retry_interval definitions may conflict with user's sketch definitions
- ESP-32 S2 Mini Compatibility HOT 2
- ADC pin cannot be set when creating a MQUnifiedsensor object using the short constructor
- Conflicted MQsensor library with ThinkSpeak library. HOT 1
- Include coeficient tables to library HOT 1
- Sensor won't finish the Calibration process if done in clean air.
- _type is too small for some sensor names HOT 1
- Probably Incorrect Readings HOT 3
- Parameters to model temperature and humidity dependence HOT 1
- PPM Value HOT 1
- How to obtain RL HOT 1
- Is RL correct for the 3.3V examples? HOT 1
- possible error in the calculation formula for _RS_Calc = ((_VOLT_RESOLUTION*_RL)/_sensor_volt)-_RL; HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mqsensorslib.