Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 8 months ago.
Min voltage, sensing with AnalogIn (NXP LPC1768)
What is the minimum voltage that can be sensed at the AnalogIn pin? Please point it out in the manual or other doc (I did not find it).
2 Answers
9 years, 8 months ago.
This is all theory based so your results may vary, but the LPC1768 has a 12-bit ADC and operates at 3.3V. So that means that the voltage range it can detect is between 0-3.3V. 12 bits gives 2^12 = 4096 discrete values the ADC can map the input voltages to, so 3.3 / 4096 = 0.000806 V = 0.806 mV per step.
So in theory, the smallest non-zero voltage you could detect is 0.806 mV. Next smallest steps would just be multiples of this, 1.612mV, 2.417mV etc.
In practice, it most likely won't be quite this reliable. It's very dependent on the noise of your system and environment. If you're interested in the specifics of the LPC1768's ADC, checkout section 13 of this document (page 66): http://www.nxp.com/documents/data_sheet/LPC1769_68_67_66_65_64_63.pdf
Thanks Brian. Does mbed have any solution for achieving a higher resolution ADC?
posted by 04 Mar 2015What kind of resolution do you need? It looks like the K64F has a 16-bit ADC, but I haven't tried it myself. I believe the mbed library supports up to 16bits.
I also found this post about a user getting the KL25Z ADC to work with 16-bits: https://developer.mbed.org/questions/5788/ADC-of-the-KL25Z/
If your application needs an even higher resolution ADC, I would consider using an external ADC and communicate with it over SPI or another serial protocol.
posted by 04 Mar 2015Resolution is the wrong thing to look at when you want to know the accuracy of an ADC. The LPC1768 may give 0.8mV resolution but that doesn't mean they will be anywhere close to that in terms of accuracy. In the datasheet Brian supplied, on the page he mentioned it clearly states the ADC error is up to 4 LSB which at 3.3V means +/- 3.2mV
That is assuming you have clean analog input voltage references. The mbed boards don't.
On most mbeds the CPU power ends up being about 3.1V rather than 3.3V due to a series diode, this diode means the voltage will depend a little on current draw and have some unit to unit variation.
And then since the ADC supplies aren't isolated from the digital supplies any current transients caused by the CPU load (or IO loads) changing will introduce noise on the ADC 0V and 3.1V references which will in turn introduce noise in the ADC output.
In other words I wouldn't trust to be more than +/- 5mV accurate at best. And that's after calibrating where the max voltage actually is because it won't be 3.3.
posted by 05 Mar 20159 years, 8 months ago.
0V, which will of course return 0. This is the first information in the first table on the ADC characteristics in the datasheet.
Maybe I didn't state my question properly. How sensitive is the AnalogIn pin's voltage detection? Can it detect in the mV range or lower?
posted by 04 Mar 2015Assuming 3.3V is your reference voltage:
For a 12 bit A:D 0.80566mV per count
For a 16 bit AD: 0.05035mV per count
Note that the LPC1768 mbed module is noisy (only one ground pin for everything). You would have to average many samples to get an accurate reading. I do not have experience in reading voltage levels on other mbed devices.
posted by 04 Mar 2015