ADC Value

23 Aug 2010

Dear forum,

I try to read 3.3V regulated power source by the AnalogIn (p19). I use example code (in handbook) which is reading ADC to a unsigned short variable in 1024 times. I want to read an ultrasonic sensor, so I need more accurate reading rather than the normalized floating point (0.0 - 1.0). Consider that the analog source is constant in this case is 3.3V (regulated), but the value is like this:

1007, 0xFFFF, 65535

1008, 0xF0FF, 61695

1009, 0xF2DF, 62175

1010, 0xF4AF, 62639

1011, 0xFFFF, 65535

1012, 0xFFFF, 65535

1013, 0xFFFF, 65535

1014, 0xF23F, 62015

1015, 0xF44F, 62543

1016, 0xFFFF, 65535

Could anyone explain why? Then, how many byte is this mbed ADC resolution? It is just form 0.0 to 1.0?

I also try another voltage value and it results something similar.


Thank you


23 Aug 2010

And... how to reduce the noise?

23 Aug 2010

Which model range finder are you using?  I just finished programming a max botix mb1210, maybe the class is useful to you?


What resolution do you need?  From my experience, the only way to reduce noise is increase voltage on the device (if that increases the wave intensity), but that is dependent on the device and may require you to scale the output voltage back down to the mbed's pins.

For accuracy, I wouldn't recommend Analog.  Is Serial or PWM available?

I hope that helps


23 Aug 2010

The ADCs on the LPC1768 is 12 bit (10 bits on the LPC2368). The unsigned short read method of the AnalogIn class normalises this to 16 bits.

23 Aug 2010

Thanks Thomas and Jon for your info, it really helps. My Senscom mini-A ultrasonic sensor has PWM output and yes, using PWM is the better way in this case.