using distance sensor

BTCAD

Active Member
HI,
     I use a mb7052 distance sensor. http://maxbotix.com/documents/XL-MaxSonar-WR_Datasheet.pdf
 
I know i need to use 3v to 5.5v to operate the sensor. I use the analog pin  then plug it to my wc32,  but i don't have an acurate reading.  I think I may use different voltage to make it accurate.
Is there an other way to do this or i need to adjust each sensor voltage?
 
 
thank you again all for your help.
 
i use a 100uf cap between gnd and vcc sensor pin. The voltage is 5.19vdc. I try to measure 213,36 mm witch mean 84 inch but the board read 198 mm. This is a close reading but not sharp enough. the sensor is about 10 inch from the board. <<<<
 
BTCAD said:
i use a 100uf cap between gnd and vcc sensor pin. The voltage is 5.19vdc. I try to measure 213,36 mm witch mean 84 inch but the board read 198 mm. This is a close reading but not sharp enough. the sensor is about 10 inch from the board. <<<<
 
ok, we have several things at issue here that need clarified.
 
1. Was the 198mm stable, or bouncing around?
2. What is the total span of the sensor?
3. Are you aware of the difference between ACCURACY and PRECISION ?
 
If your sensor has a range of (say) 1m (1000mm) then a 10-bit ADC, neglecting noise etc, has a precision of about 1mm.
If the sensor has a range of 10m (10,000mm) then the same ADC cannot resolve anything better than even 10mm.
If there is any DC offset error, that will be significant.
 
If the sensor output is say, 3.3V (instead of ratiometric), then 10m range is 10,000mm but your span is now only 3.3/5 which would give you a minimum theoretical resolution of 15mm. Adding even 1 digit fluctuation on the ADC (which is a decent ask just by itself) means anything closer than 30mm is going to be very difficult to achieve.
 
If you add a 0.1uF capacitor to the AIP input pin, that can flatten out some of the jitter. It will also eliminate short pulses, if that is not a problem for you.
 
rossw said:
 
ok, we have several things at issue here that need clarified.
 
1. Was the 198mm stable, or bouncing around?
2. What is the total span of the sensor?
3. Are you aware of the difference between ACCURACY and PRECISION ?
 
If your sensor has a range of (say) 1m (1000mm) then a 10-bit ADC, neglecting noise etc, has a precision of about 1mm.
If the sensor has a range of 10m (10,000mm) then the same ADC cannot resolve anything better than even 10mm.
If there is any DC offset error, that will be significant.
 
If the sensor output is say, 3.3V (instead of ratiometric), then 10m range is 10,000mm but your span is now only 3.3/5 which would give you a minimum theoretical resolution of 15mm. Adding even 1 digit fluctuation on the ADC (which is a decent ask just by itself) means anything closer than 30mm is going to be very difficult to achieve.
1. Yes its stable.
2. 213mm its from my work table to the roof.
3. ?

If the input voltage of the sensor is about 5.67v its more accurate. And if i look to the other sensor measuring the same range, i need to adjust my input voltage to 5.94v.
 
CAI_Support said:
If you add a 0.1uF capacitor to the AIP input pin, that can flatten out some of the jitter. It will also eliminate short pulses, if that is not a problem for you.

I tried 100uf, but no better results.

Do you think a 0.1uF cap will give better results?
 
If you have a 4.99k resistor then capacitor, it will help. One WC32,  adding a 4.99k resistor in series will change your input full scale reading from 5V to to 6.6V.
 
Ok 5k in series at v input?

Is the resistor placed between the cap and the gnd?



Edit: Ok to the wc32 not the sensor. I will try it.
 
nothing better. The only way to make it more ''sharp'' is to increase the voltage.  Now I have a perfect reading with a 5.5v at the input. I will try the same configuration with different sensor. i'll let you know.
 
BTCAD said:
1. Yes its stable.
2. 213mm its from my work table to the roof.
3. ?

If the input voltage of the sensor is about 5.67v its more accurate. And if i look to the other sensor measuring the same range, i need to adjust my input voltage to 5.94v.
 
2. You mis-interpreted my meaning. The sensor *SPAN* will be a range, for example 0-10m, or 50mm-5000mm, etc.
 
If your sensor has a SPAN of lets say, 5m, and you're only working in the 0-0.2m range, and assuming it's linear, 5m and 5V output = 1V/m
213mm = 213mV. You are not going to get the resolution you need.
 
If you're using a WC32 board with the IO board, I would use a small RC filter on the input (where the impedance is high), and adjust the amplifier gain to give you 5V out at your maximum usable distance, as this will give you the highest precision (resolution).
 
So sorry rossw,

Mb7092 have a span of 7 meters.
Mb7092 have a resolution of 1cm (0,393701 inch).
I use my custom board with wc32.
 
I'm doing software based smoothing, taking the last 5 readings, but this is ressource depleting on a WC and has rounding errors
And you need pausing between taking the measurements, since the fluctuation concern all the subsequent 5 readings.
I wonder if there is some background on that weired behavior of the WC, regarding ADC measuring quality.
 
Efried,
 
If the input is not smooth out by RC, based on software will not be able to totally filter out. Inside WC, it is already doing 3 measurements and average out for each ADC reading.
Both WC32 and latest WC8 using switcher IC to regulate power, that is much better in filtering out noise from power line. If your ADC input requires high accuracy, you may consider getting newer WC8 board.  Otherwise, you could consider upgrading your power supply to a higher quality one when using 2.2.2 board.
 
CAI_Support said:
Efried,
 
If the input is not smooth out by RC, based on software will not be able to totally filter out. Inside WC, it is already doing 3 measurements and average out for each ADC reading.
Both WC32 and latest WC8 using switcher IC to regulate power, that is much better in filtering out noise from power line. If your ADC input requires high accuracy, you may consider getting newer WC8 board.  Otherwise, you could consider upgrading your power supply to a higher quality one when using 2.2.2 board.
ok, thats good News, you do sampling, 
the newest  board is v03.02.18d5, I'm not able to update.
 
Efried,
 
The new hardware board is hw rev 2.3.8. 
For hw rev 2.2.2 board, we do recommend to update to latest FW rev 3.02.29.  That improved a lot of functionality, as well as reliability.  If your board has FW rev 3.02.18x, it has bootloader and can be updated.
 
Back
Top