[Answered] What are the ADC input ranges?
[Answered] What are the ADC input ranges?
I was reading through the DataSheet and Techref but was unable to find any descriptions of the electrical characteristics of the analog to digital inputs. Does anyone know what the maximum input voltage is that can be applied on input?
Last edited by kolban on Thu Jan 26, 2017 5:04 pm, edited 1 time in total.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: What are the ADC input ranges?
Hi Kolban
I did poke around with the ADC on the ESP32 and fund that 3V3 gave full house on the ADC output value. But the result was very noisy - also reported by others - and in the given setup not ok for my application (<10 mV resolution needed)
By the way thanks for the work you have put into your books - Grate resource. If you want I will be happy to help to on any thing audio if you want to cover that area as well.
Regards Jørgen
I did poke around with the ADC on the ESP32 and fund that 3V3 gave full house on the ADC output value. But the result was very noisy - also reported by others - and in the given setup not ok for my application (<10 mV resolution needed)
By the way thanks for the work you have put into your books - Grate resource. If you want I will be happy to help to on any thing audio if you want to cover that area as well.
Regards Jørgen
Analog Digital IC designer / DevOps @ Merus Audio, Copenhagen, Denmark.
We do novel and best in class Audio amplifiers for consumer products.
Programmed assembler for C-64 back in 1980's, learned some electronics - hacking since then
We do novel and best in class Audio amplifiers for consumer products.
Programmed assembler for C-64 back in 1980's, learned some electronics - hacking since then
Re: What are the ADC input ranges?
Yeah the ADC of the ESP32 is a bit disappointing, compared to the rest. The result is not only noisy, but also not very linear. You can't measure values down to zero Volts, the ADC shows zero with an input of ~0.1V. Same problem at upper end, but that is not so important.
Here is what I have measured today:
Here is what I have measured today:
- Attachments
-
- ADClinearity.png (14.55 KiB) Viewed 83053 times
Re: [Answered] What are the ADC input ranges?
What is the actual implication of the results. To my "eye" the line is "pretty" straight ... what kinds of applications do we have in mind where the deviations from optimal would cause unwanted effects?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: [Answered] What are the ADC input ranges?
You can hardly expect good results from embeded ADC on any microcontroller. Some software techniques must always be used to improve the results.
There are many documents about that, here are some links:
http://www.st.com/content/ccc/resource/ ... 004444.pdfhttp://www.st.com/content/ccc/resource/ ... 050879.pdf
http://www.atmel.com/images/doc8003.pdf
http://www.embedded.com/design/mcus-pro ... resolution
http://www.eurasip.org/Proceedings/Ext/ ... _III_5.pdf
Some of these techniques will eventually be used in esp-idf, or you can implement them yourself.
There are many documents about that, here are some links:
http://www.st.com/content/ccc/resource/ ... 004444.pdfhttp://www.st.com/content/ccc/resource/ ... 050879.pdf
http://www.atmel.com/images/doc8003.pdf
http://www.embedded.com/design/mcus-pro ... resolution
http://www.eurasip.org/Proceedings/Ext/ ... _III_5.pdf
Some of these techniques will eventually be used in esp-idf, or you can implement them yourself.
Re: [Answered] What are the ADC input ranges?
Sure, oversampling and filtering helps to reduce the noise and increase the resolution, but not helps for the non-linearity.
The datasheets for other microcontrollers normally say: non-linearity: + - 1 LSB, that is 1/4096 of the full range.
SAR ADCs (successive approximation) have this high linearity by design, and according to the datasheet the ESP32 works also with a SAR-ADC. So the problem must be the analog amplifier/attenuator, that does not work rail to rail.
I will try some filtering technics and other gains of the amplifier, perhaps I find some better modes.
The DACs are quite linear BTW, but also not rail-to-rail.
@kolban
Applications like industrial or automotive sensor measuring need much more precision. Also analog interface standards like 0-10V or 4-20mA current loops. These may not be the main application area for the ESP but peripherals like CAN show, that the chip is also intended for such things.
The current ADC performance is okay for Joysticks or Controller-potis for example. Not sure about Audio input.
The datasheets for other microcontrollers normally say: non-linearity: + - 1 LSB, that is 1/4096 of the full range.
SAR ADCs (successive approximation) have this high linearity by design, and according to the datasheet the ESP32 works also with a SAR-ADC. So the problem must be the analog amplifier/attenuator, that does not work rail to rail.
I will try some filtering technics and other gains of the amplifier, perhaps I find some better modes.
The DACs are quite linear BTW, but also not rail-to-rail.
@kolban
Applications like industrial or automotive sensor measuring need much more precision. Also analog interface standards like 0-10V or 4-20mA current loops. These may not be the main application area for the ESP but peripherals like CAN show, that the chip is also intended for such things.
The current ADC performance is okay for Joysticks or Controller-potis for example. Not sure about Audio input.
-
- Posts: 9715
- Joined: Thu Nov 26, 2015 4:08 am
Re: [Answered] What are the ADC input ranges?
Fyi, the way we are going to fix this is by adding calibration curves to the ESP32. The idea is to have a lookup table or function that maps each ADC value to the value it should be. That should help with the linearity, at the cost of maybe a bit or two of precision. Not much we can do in software about the ADC/DAC not being rail-to-rail, unfortunately. The calibration curves will arrive somewhere after CNY; we'll need to test a bunch of different ESP32s in different temperatures with different supply voltages to be confident about the precision.
Re: [Answered] What are the ADC input ranges?
With 10 Bit resolution and averaging over 8 Samples, it looks now much better. The heavy linearity error is just in the -11dB range of the ADC. All ranges have the problem that they don't go down to zero, so input voltage under 0.04/0.08/0.1 Volt can't be measured without some analog offset generation at the input (2 resistors for example).
I think linearization of the -11dB curve can be done with some polynome for the range beginning from 2.5V, instead of a big RAM table.
I think linearization of the -11dB curve can be done with some polynome for the range beginning from 2.5V, instead of a big RAM table.
- Attachments
-
- ADC_10Bit.png (24.24 KiB) Viewed 83001 times
-
- Posts: 9715
- Joined: Thu Nov 26, 2015 4:08 am
Re: [Answered] What are the ADC input ranges?
Aye, sure, obviously we'll make any correction algorithm we come up with as small as possible. Big-ass table if needed, simple math if possible. We also want to see if there are any effects with changing supply voltage, temperature, or specific chip, so the end result may get somewhat more complicated.
-
- Posts: 10
- Joined: Mon Mar 06, 2017 5:34 pm
Re: [Answered] What are the ADC input ranges?
Could you post the numeric values of the graph, please?mnemonix wrote:With 10 Bit resolution and averaging over 8 Samples, it looks now much better. The heavy linearity error is just in the -11dB range of the ADC. All ranges have the problem that they don't go down to zero, so input voltage under 0.04/0.08/0.1 Volt can't be measured without some analog offset generation at the input (2 resistors for example).
I think linearization of the -11dB curve can be done with some polynome for the range beginning from 2.5V, instead of a big RAM table.
It would be very helpful to increase error correction..
Hardwire.io / The IoT Platform
Who is online
Users browsing this forum: No registered users and 51 guests