Formula to calculate IR distance measurement from Eddie robot ADC response.
Hi,
I am sending "ADC" cmmand to eddie control board using Parallax Serial Terminal and trying to determine IR distance measurements from the obtained12-bit hex values. Forexample, I receive "0BF" on channel (2) which is equivalent to 191 in decimal. What is the correct formula to determine distance measurement from this reading.
I have used the following formula but it doesnt give the correct results:
volts = sensorReading * (5/4095);
Distance_in_cm = 60.495 * pow(volts, -1.2)
This formula gives a value of 344.90 however the actual distance is around 19-20 cm.
Any suggestions?
Thanks
I am sending "ADC" cmmand to eddie control board using Parallax Serial Terminal and trying to determine IR distance measurements from the obtained12-bit hex values. Forexample, I receive "0BF" on channel (2) which is equivalent to 191 in decimal. What is the correct formula to determine distance measurement from this reading.
I have used the following formula but it doesnt give the correct results:
volts = sensorReading * (5/4095);
Distance_in_cm = 60.495 * pow(volts, -1.2)
This formula gives a value of 344.90 however the actual distance is around 19-20 cm.
Any suggestions?
Thanks
Comments
Its Sharp 2Y0A21YK0F IR sensor. Actually I am using the following formula:
ADC range = 0 to FFF (which corresponds to 0.00v to 5.00v)
volts = sensorReading * (5/4095); //sensorReading is the decimal equivalent of 12-bit hex value returned by ADC
Finally,
Distance_in_cm = 60.495 * pow(volts, -1.2); // pow is a math power function to take the power of "volts"
I am using Parallax serial terminal to send "ADC" command to eddie control board. Anyone from parallax support would give a few suggestions please.
Thanks.