10bit ADC for ESP32 breakout board

I am currently designing a breakout board for the ESP32-S3 microcontroller and I would like to add an external ADC with a 10 bit (maybe even 11 or 12 bit) resolution as a replacement for the internal ADC of the esp32 (considering their poor quality). I have found some ICs that look promising (ADC108S022 as well as ADS1158IRTCR) for the 2nd option, i could simply throw away bits 0, 1 and 2 since at a voltage of 5V every bit would be only a couple uV. I am however wondering, how I could connect such an IC on a PCB. I have only found schematics consisting of breakout boards and not a direct connection of the ADC with a microcontroller. Could anyone help me find the right IC and maybe help me understand how these ICs should be connected to the esp32?

just tinker. find what voltages work best and what connections work best, try to force it to work by putting in C++ code to make it compatable. that's the best advice I can give right now.

The quality of precise analog readings is highly affected by the analog wireing, the source of the signal, the electrical environment in general. It's no problem to spend money on a good ADC and get poor readings.

Go for one ADC and post its link to the datasheet and we can discuss things.

First decide what you really want to do. The two you mentioned are very different in speed and resolution. Both use an SPI interface. To connect to the esp32 pick an SPI channel and a pin for CS. Wire the ADC to the selected esp32 pins with traces on the PC board.

My main idea is to implement an ADC that can handle general signals. I don't need it to be extremely accurate (like the 16bit one) but I also do not want it to stay at 8 bit. Imo a 10bit ADC would be amazing

Alright. Here is the link to the ADS1158: https://www.ti.com/lit/ds/symlink/ads1158.pdf?ts=1737923941661&ref_url=https%253A%252F%252Fwww.mouser.at%252F

Since it communicates through SPI, I believe I can adapt my code to pretty much throw away the last 2 bits in case the noise is too strong. However, I am thinking of implementing high-pass filter at the analog pins, removing high frequencies (from 7kHz upwards) so I get a better quality to the ADC. From what i have learned until now about high-pass filters they theoretically won't affect the signal anywhere under the 7kHz mark.

Then no use for the higher number of bits. Nothing gained.

They allow high frequencies to pass and blocks low frequencies, DC.

It looks like You've got it wrong, upside down.

What makes 7 kHz magical? It depends on how the filter is designed, the values of the components.

Sorry, I mixed them up. As for the 7kHz, I googled what the usual noise frequency is and i got that a cable gets noise of about 7kHz. And I would then calculate the values for C and R with the formula for ω and make it in such a way that i do not get too much delay from the capacitor.

And for the bits. I would still use all 16 for people that actually want that high accuracy (considering i add filters to the inputs and dampen part of the noise) but also give them the option to change the resolution to 14 or 10 bits as they desire.

What is Your demand in the respect of sampling frequency?
Averaging is a simple filtering method. Sum up 10, 100 samples and divide by 10, 100.
What is the signal You intend to measure?

I've had good luck with ADS1015 for general applications:
https://www.adafruit.com/product/1083

Do you understand the difference between a ratiometric and fixed reference?

The ADC would be a general purpose Analog input port where the user could measure any kind of signals between 0V and 5V. Averaging would be a solution which would theoretically make the low-pass filter obsolete.

Correct me if I'm wrong but the ADC needs to be placed as close as possible to the pins, right?

Hi, @d4v1d7882
Welcome to the forum.

Hint; Please spread your text out to make it easily readable.
Each time you write "I" at the start of a sentence, start a new line.

The easier it is to read, the more members will read.

The good thing about your post, concise and full of appropriate data.

Thanks... Tom.... :smiley: :+1: :coffee: :australia:

Hello, thank you for the link. I have seen a similar IC online, but from what I have seen it needs a pretty low clock frequency which the esp32 does not have.

A lot of the documentation for external ADCs is a bit vague from what I have seen.

I have considered the possibility that I would have to add an external oscillator for the ADC.

The ADS1015 has an internal clock generator, does not depend on the MCU's clock, communication with MCU is via serial (I2C).

http://adafruit.com/datasheets/ads1015.pdf

DC I guess.

That's a good beginning but watch out for the cables between the ADC and the object being measured. They are potential antennas for noice. Twisted pair cables or shielded cables are good ways to keep noice away.

Be careful that the filter network does not compromise the input impedance of your module.

Tom.... :smiley: :+1: :coffee: :australia:

To answer Railroaders question as well, I always use short cables when reading analog signals. This PCB is meant as a project board, where you can use it for multiple projects.

As for the low-pass filters: I was thinking of choosing a small capacity (100n or so) and calculate my resistance which will probably be pretty high so I would also get a high input impedance

Can you give an example application for this esp32 board with external ADC which you are designing? It is true that the esp32 ADC has some non linearity at the extremities of its range (model dependent) and can suffer from noise etc. However, it can still be used for many applications. Where jitter was a problem with calling AnalogRead() at a high frequency I got good results by using the ADC in free running mode and using an exponential low pass filter (a couple of lines of code) to smooth the results. Non linearity at the ends of the range may be mitigated by the design of the voltage divider resistor network.

Mostly it would be as an ADC with better resolution for exact measurements without the need for additional components to smooth out the signals. My main goal is to make a board with multiple capabilities (it will also include bi-directional voltage level converters on 8 pins) so you can control and measure anything you want with high accuracy

What do you mean?
A level converter is usually a digital device to interface say 3V3 logic to 5V logic.
If you are talking about scaling circuit like 0 to 3V3 converting to 0 to 5V, then the regular bi-directional converters will not work.

What circuit did you have in mind, I like the idea of some pre-scalers.

Tom.... :smiley: :+1: :coffee: :australia: