Need help with sensor scaling

I was wondering how you figure out the scaling for Maxbotix sensors.I’ve read the tutorials and they say for the one I’m using it’s Vcc/512 = the scale. Now for the XL1240 it’s Vcc/1024 = the scale. Problem I’m having is in the rover documentation it says for the XL1240 the scaling parameter is 2.04. How did they get this? I thought it was 4.9 according to the math, am I missing something?I’m adding these sensors and my distances are off so I want to know how they got 2.04 for the 1240 so I can apply that to my sensor, thanx

The best way to do this is put an object at a highly accurate distance from the sonar (say 30cm) and adjust the scaling until you get the correct measurement. Then move the object further away to say 1m and then 3m and ensure the measurement is still correct.

The Maxbotix rangefinders according to their data sheets output Vcc/1024 volts per centimetre, or 0.488 v/m when supplied with 5v (which the ADC port supplies), which translates into 2.04meters / volt. The range is 7.6m according to the datasheet, but analog output is limited to 7m. I haven’t tested the analog sensing, but if it can only read up to 3.3v, then that means 6.75m is the furthest it can really measure.

Thanks, Grant.