Electronic – Analog sensor reading and calibration

resistancesensorvoltage

I have what I think is simple question regarding the use and data calibration of variable analog sensors (such as a force-sensing resistor). As more pressure is applied to this sensor, its resistance changes. This value can be collected by an Arduino device using the analogRead() function, which outputs a value from 0-1024, with 1024 being no pressure and 0 being the most pressure. I am assuming that analogRead is measuring the voltage, but I could be wrong.

My question is this: If I provide current to these devices from a battery, as the battery's voltage drops with use, will it affect the value read by an Arduino or other device? The value doesn't appear to change linearly as more pressure is applied, so would multiplying the read value by the battery voltage to get a constant work if the value does change with the battery voltage?

Thanks for your help!

Best Answer

You are correct: analogRead() returns a value indicating the proportional voltage of the input to the Analog Reference Voltage, which is either the supply voltage, 5V or 3.3V, or another value depending on the Arduino you're using and your settings.

IF you are powering the Arduino with the same battery as your sensor, as your battery's voltage drops below the Arduino's regulated voltage, if it's still high enough to power the Arduino, the analogRead() function will continue to return a proportional voltage between 0V and your battery voltage. So there's no need to multiply the result by a constant as this is "automatic".

However, if you're powering the sensor from a battery and your Arduino from another source, you would need to know the battery voltage and adjust your analogRead() value proportionally.

Use a multimeter to ensure the voltage being fed into the Arduino is indeed changing as expected.

Also, please show a diagram of your circuit if possible.