Something equivalent to ESP32 but with better integrated ADC? - Page 1
Forum section: electronics / general

author: andrejr
author_rank: Contributor
timestamp: July 21, 2025, 10:22:31 pm
content: I love working w/ ESP32s, but I hate the ADC. I want to build a MIDI controller with a bunch of pots (actually sliders), which I'll just multiplex, and I need 1 or 2 channels of decent ADC on them, not much more than that. I'd like to get something 32bit and faster than AVR, so some sort of ARM or RISC-V or something.What's cheap (ESP32 price or cheaper) and with a good ADC? Realistically, the output is 7bit, but I think having 10-12bit precision likely brings a bit more confidence in the ADC's performance. I'll just throw away the extra bits in the end.

author: thm_w
author_rank: Super Contributor
timestamp: July 21, 2025, 11:46:43 pm
content: External ADC.https://www.aliexpress.us/item/2251832125341942.html

author: Buriedcode
author_rank: Super Contributor
timestamp: July 21, 2025, 11:52:37 pm
content: I'm not sure you'll need 10/12 bit for sliders/pots. The linearity of slide pots isn't great, and I don't think anyone can notice a 0.1% resolution of a 80mm travel slider (assuming a perfect slide pot - that doesn't exist - thats less than a 0.1mm step).But.. external ADC's are a cheap, and some have built-in MUX's so that could replace an external multiplexer to save some IO, whilst also giving you more confidence in the ADCs results. Note, that doesn't necessarily mean the external ADC is better - read the datasheet - but in general, they tend to have better INL/DNL and ENOB.I would argue, for say, 6-8 analogue inputs, an external ADC with a MUX is preferred purely for saving IO, using I2C or SPI.

author: ledtester
author_rank: Super Contributor
timestamp: July 22, 2025, 12:09:55 am
content: Maybe use oversampling?https://www.reddit.com/r/esp32/comments/xv7au1/esp32_adc_is_not_that_bad_after_all/Another option is to measure the RC time constant with timers. From some basic googling it seems the ESP32 has some form of "input capture" capability (ability to measure the width of a digital pulse), eg. see:https://electronics.stackexchange.com/questions/519615/input-capture-with-mcpwm-on-esp32

author: themadhippy
author_rank: Super Contributor
timestamp: July 22, 2025, 12:19:23 am
content: Quotecheap and 4 x 12 bit adc'shttps://hobbycomponents.com/development-boards/1164-lg8f328p-qft32-mini-evb-development-board

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 22, 2025, 12:54:17 am
content: "Good" 12-bit or more ADCs usually come in (much) more expensive MCUs.First, as some have suggested, you need to figure out if the limitation in your case is really the ADC. Potentiometers, especially the "cheap" ones, have relatively poor actual resolution and have natural noise due in part to mechanical construct/vibration and partly to coupled noise (considering that you are likely to be using "high"-impedance pots to limit the current draw, especially if you need to have a lot of them for a controller. One thing to consider is buffering the pots voltages, especially if you have longish traces from them to the ADC inputs. You can also add a capacitor in parallel with the wipers.If you have nonetheless determined that the limiting factor was really the ADC, you can consider oversampling/averaging as already suggested. Some MCUs do have that feature embedded in their ADC peripherals, use it if available, it'll save CPU time. Otherwise you can do it with the CPU.Or use an external ADC - as also suggested - very decent ones can be had for not much if only a low sample frequency is needed, which is the case here. They'll be much better than what you can have inside a MCU. But if the above is the main culprit, then they won't help at all and will even make all the "analog" noise all the more apparent. If you need more inputs than what's commonly found with these ADCs, add an external analog MUX. That won't break the bank either.

author: azone
author_rank: Newbie
timestamp: July 22, 2025, 06:43:53 am
content: You should look into an external DAC. The performance of the integrated ADC in NXP i.MX and STM32 aren't any better than the Xtensa. However, for your application you might not be able to sniff anything higher than 10bits resolution. You might be surprised to know that for scanning pots almost all 'pro' synths, sequencers, controllers etc.. are actually only using 8bit in some cases 10bits. You can oversample and try to get the sample rate up and do some smoothing and averaging but the inherent noise of pots will preclude you from achieving an effectively higher resolution. The values will be jumping all over the darn place and by the time get control of it w/ all the tricks what you end up with is effectively 8bit to at best 10bit performance.You may very well find that your ESP32 is a perfect match for your pots. You can usually setup the hardware (ADC hardware interrupt, XBAR, DMA config etc..) to do all the sampling & averaging in a continuous loop w/ minimal overhead from the CPU.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 22, 2025, 10:01:39 am
content: Quote from: andrejr on July 21, 2025, 10:22:31 pmIt is not easy to get high end MIPS and good ADC working on the same die, so you may be better to remote the ADC part, allowing you to place a low noise regulator at the pots, and send a digital signal to the MCU, that could even the isolated.Parts like lcsc GP9101-F1K-L2H1-SW, are sub 50c, and have linear voltage ratio to PWM - in this case 1kHz with 2%-99% range limits, it claims p-p jitter of 0.1%Or there are low-cost weigh-scale ADCs like HX711, that can give ratio outputs at modest sample rates - 80 sps may be ok for pots ?

author: JoeyG
author_rank: Regular Contributor
timestamp: July 22, 2025, 10:08:03 am
content: https://ww1.microchip.com/downloads/aemDocuments/documents/WSG/ProductDocuments/DataSheets/PIC32MZ-W1-and-WFI32E01-Family-Data-Sheet-DS70005425.pdfwfi32 with 12bits data sheet extract29 Github projectshttps://github.com/search?q=org%3AMicrochipTech+WFi32&type=repositories

author: xvr
author_rank: Frequent Contributor
timestamp: July 22, 2025, 10:28:06 am
content: The new ESP32 (ESP32-S2/3, ESP32-C*) have a much better ADC. Maybe it will suit you?

author: JPortici
author_rank: Super Contributor
timestamp: July 22, 2025, 10:42:00 am
content: Well, i'm developing something with the ESP32-H2 and the ADC accuracy is.. fine.You need to set up a calibration handle and then run the calibration routines against the acquired data, which will return the voltage in millivolts at the ADC inputs (so up to 1.1V)I'm not really sure about the performance hit, as the application does not require fast anything, but it seems to be resolving to less than 1% error, which is good enough for my applicationOtherwise yeah, external ADC. Unfortunately ESP has one of the shittiest hardware combined with one of the better frameworks out thereMicrochip will probably have the best analog peripherals, but the framework is really hard to stomach (Hey, manufacturer X.. is it really that hard to provide a lib file with a function you need to periodically call for the module to run, functions to call on the appropriate interrupt and functions to register callbacks? So we can throw away all the shit flavour of the year framework... Then put the thing in any RTOS thread if you really need to but god damn the sea of shit that is wireless MCU development..)

author: andrejr
author_rank: Contributor
timestamp: August 07, 2025, 08:46:30 am
content: Quote from: xvr on July 22, 2025, 10:28:06 amI have an ESP32-S3, and I still have pronounced non-linearity near 0V and Vref. It's really bad when an Atmega328p behaves better. I thought maybe I'm misremembering it, I dug up an old Arduino clone and indeed it doesn't have that issue. I'm still under the impression that I'm doing something wrong w/ the ESP32-S3, I can't believe it's that bad.I got an STM32F103C8T6 (on a little dev board so I can try it on a breadboard), I'll report back if these are any good.

author: Siwastaja
author_rank: Super Contributor
timestamp: August 07, 2025, 08:51:59 am
content: As others have noted, ESP32 ADC can't be worse in noise/linearity/drift than the usual potentiometers. Just filter out the noise in software and calibrate the values at extreme ends, if necessary - which you would want to do anyway even with a better ADC.

author: uer166
author_rank: Super Contributor
timestamp: August 08, 2025, 07:15:03 pm
content: Quote from: Siwastaja on August 07, 2025, 08:51:59 amEh, it's pretty terrible due to clamping at 0V and VCC, I've had major issues because of this using it with a string potentiometer where the extremes would not be measurable. Maybe not a big issue for a crappy volume controller, but a string pot is still a pot. Can't calibrate out the ends when the ends drop off the face of the ADC..My advice is to use an external ADC or switch to a MCU with acceptable analog design, never had issues with STM32 ADCs.edit: since these are MIDI linear pots, OP can also just bias the measurements so you stay within linear range only instead of using full range.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 09, 2025, 02:39:33 am
content: Quote from: uer166 on August 08, 2025, 07:15:03 pmHow much does that end-effect vary from part to part? Looks designed-in

author: uer166
author_rank: Super Contributor
timestamp: August 09, 2025, 06:31:31 am
content: Quote from: PCB.Wiz on August 09, 2025, 02:39:33 amNo idea, in my case I needed to actually measure down to zero. I don't remember datasheet specifying it at all so knowing where that "knee" is wasn't easy.

author: Siwastaja
author_rank: Super Contributor
timestamp: August 09, 2025, 07:29:01 am
content: Quote from: uer166 on August 08, 2025, 07:15:03 pmOh, so it really is total crap; thanks for posting data.I was just cynical because I have heard this "MCU X ADC is unusable crap" hundreds of times with nearly every MCU, and in my own tests they always perform at least an order of magnitude better than the "internet wisdom" says.Reduced range at both ends can be easily dealt with by inserting extra resistors at the potentiometer ends, though. But if the online claims of changing other peripheral configurations totally change the ADC behavior, then probably easiest is to not use this defective ADC, and get an external ADC instead as many have suggested.

author: mikerj
author_rank: Super Contributor
timestamp: August 09, 2025, 10:38:08 am
content: Quote from: Siwastaja on August 09, 2025, 07:29:01 amYes it is genuinely crap, albeit good enough for enough applications that people persist with it.

author: nctnico
author_rank: Super Contributor
timestamp: August 09, 2025, 01:43:55 pm
content: The only problem with the ESP32-S3 ADC is that it works from 100mV to 1.7V (out of 0V to 1.8V range) as documented by Espressif. So if you design your circuit around that and apply some filtering on the ADC values (a simple moving average filter does just fine), the ADCs are perfectly useable. One of the products I designed around the ESP32 measures current and I get better than 0.5% offset of full range for the entire current measurement circuit.For reading potmeters the solution is simple: create 100mV and 1.7V helper voltages (for example by using two opamps if the current is not that high) to power the sliders. Measure these voltages AND the sliders (through a mux if needed) and the biggest source of error will be the sliders themselves. By measuring the helper voltages, you cancel all the offset errors.

author: hans
author_rank: Super Contributor
timestamp: August 09, 2025, 03:32:39 pm
content: Quote from: PCB.Wiz on August 09, 2025, 02:39:33 amClose to 10% variation:https://docs.espressif.com/projects/esp-idf/en/v4.4/esp32/api-reference/peripherals/adc.html#adc-calibrationQuoteThe attenuator also offers ranges of 950, 1250, 1750, 2450mV. It doesn't go down to zero volt, bottoms out at 100-150mV.So when they say its bad, its really horrendously bad. I'd rather have an oldschool 10-50ksps 8 or 10-bit ADC than deal with this.Meanwhile.. the other day I was doing some ADC work on a RP2350. It may only have a handful of 12-bit ADC channels, I was quite pleased with them. Reading ground through a 10K resistor saw an offset of only 12-16 LSB. Not too bad!

author: ozkarah
author_rank: Regular Contributor
timestamp: September 28, 2025, 12:38:45 pm
content: I did some tests with ESP32D, ESP32 WROVER and ESP32-S3 in the past.My main findings are :1- ADC on the S3 series are much better in terms of linearity.2- Dead zone (no reading for 0 to xxx mV) is much smaller on the S3.3- Attenuation configuration is very important for noise level and linearity.4- Oversampling greatly contributes for reducing the noise but benefit on the linearity5- If linearity is important, it might make sense to configure the setup to use the linear portion of the ESP32-S3.Here are the details:ESP32 WROOM 32D ADCattenuation=11dB, samples=1linearity:accuracy with linearity correction:linearity: badaccuracy: badnoise: baddeadzones: 0 to ~130mV, 3150mv to 3300 mVESP32 WROVER 32D ADCattenuation=11dB, samples=1linearity:linearity: badaccuracy: badnoise: baddeadzones: 0 to ~130mV, 3150mv to 3300 mVverdict: same with ESP32DESP32 WROVER 32D ADCattenuation=11dB, samples=5linearity: badaccuracy: badnoise: moderatedeadzones: 0 to ~130mV, 3150mv to 3300 mVverdict: oversampling (n=5) is useful on the noise levelESP32 S3 ADCattenuation=11dB, samples=5linearity:acccuracy with linearity correction:linearity: betteraccuracy: betternoise: moderatedeadzones: 0 to ~40mV, 3075mv to 3300 mVverdict: S3 ha a much better linearity and smaller dead zones. oversampling also works on S3.ESP32 S3 ADCattenuation=6dB, samples=10linearity:acccuracy with linearity correction:linearity: betteraccuracy: betternoise: gooddeadzones: 0 to ~25mV, 1765mv to ...verdict: S3 has a much better linearity and smaller dead zones. oversampling (n=10) works better.ESP32 S3 ADCattenuation=2.5dB, samples=10linearity:acccuracy with linearity correction:linearity: goodaccuracy: goodnoise: gooddeadzones: 0 to ~15mV, 1250mv to ...verdict: attenuation is very very effective on the linearity, with 2.5 dB attenuation linearity is acceptable, noise is less.Notes:1- Test setup: A decent power supply is used to create signal in 1mV steps and at each step ADC count value and real voltage of the signal is measured and logged.2- For linearity correction, I used a very simple method: I took the beginning and end values for the linear region, calculated the volts per ADC count for this region and used this average instead of using range/max_adc_count.3- With ESP32-S3 and 0dB attenuation I had just slightly better results, so no need to put them to here.4- I think last setup shared above is sufficient for most of the application requirements.5- If you need more linearity and accuracy requirement it is also possible to make the input signal stay between %25 to %75 region of the total range (by adding a DC offset and using some voltage divider network) and using the oversampling increase the effective bit loss.

author: Chalcogenide
author_rank: Regular Contributor
timestamp: September 28, 2025, 01:14:47 pm
content: STM32G series is very cheap from China - definitely comparable to ESP32s - and their ADCs have about 10 bits of ENOB native, plus hardware oversampling so you should be able to reasonably get 12 bits.