I am having some trouble with my sonar sensor. I use a MaxSonar LV EZ3 sonar sensor connected to an APM1. I understand that EZ3 is not officially supported, but it should still work. Unfortunately it is giving me the wrong altitude readings. If I point it at the ground (from 3ft), it reports the maximum distance value (6.45m or 645cm). If I put my finger over the sensor, it goes down to the min value (15cm). As I move my finger away, it quickly returns to the max value. It shows similar behavior when I use a big book instead of my finger.
The analog output of the sonar sensor is connected to the pitot pins on the IMU shield, as per instructions (http://code.google.com/p/arducopter/wiki/AC2_Sonar)
It was not giving proper values, so I started digging into the code. What I determined was that the APM code was using a 3.3v reference voltage on the ADC. But, using a multimeter, the sonar sensor is receiving 4.8V. Why is this part incorrect? How do I fix it?
1) on APM1, should I be using an analog source or adc? How can I tell which is being used?
2) Why is the sonar sensor receiving 4.8V instead of 5.0V? Could this cause it to function improperly?
3) Why am I getting incorrect readings?
Thank you for your time,