Does anyone have a set of voltage lookup tables for these sensors or equations to calculate the distance? I cannot find anything good on Google and since the output is not linear, I really would like to save some time and not have to build them myself.
http://www.acroname.com/robotics/info/articles/irlinear/irlinear.html
Alan KM6VV
Nathaniel,
Attached are 3 XML files with lookup data for 3 different GP2D120 sensors I used.
They were calibrated to 1cm increments.
Each reading has 2 attributes: index = the distance in cm, sd= standard deviation for the error in the reading.
Each value is the actual ADC value for the reading not the voltage, I think I used a 10bit ADC with 5 Volt reference so it should be easy to re-scale the values.
Each value was obtained from an average of about 50 readings at that distance, that’s where the SD comes from so you can judge the accuracy of each point.
You probably just want to smooth this data and use that.
Each file has calibration data for a different actual sensor so averaging across the three files may also give a better general lookup table.
If you plot the values they come out just like in the data sheet.
Ralph