Hi, I'm using ESP32 to real-time measure AC waveform (for CT & AC voltage measuring). ESP is good with around 1700 samples per 100ms (with 12-bit accuracy). But ESP32 ADC isn't linear, so I'm having difficulty sometimes in TRMS measurements. Can anyone suggest any ADC module/IC with high sampling rate (17ksps+) & at least 12-bit accuracy (I'd be happier with 16-bit)? I'd be grateful.
...is not linear... Strange. Such a device would not be useful. Have You checked the measured signal using an oscilloscope?
What does the datasheet tell? Any application note giving tips, hints etc?
Not exactly checked the datasheet. But it's an open secret (I know & experiencing from a long time). ESP32 ADC is 'almost' linear and a very little non-linearity roams around. Since, I'm dealing with milli-voltage readings, that little non-linearity sometimes create a trouble otherwise sampling rate is amazing.
Reading millivolts You really need to have good control of the environment.
What is the specified accurazy of the internal reference? Hardly good enough.
you can always strap on a dedicated HD adc and read it i2c, paralel, serial...
a simple google search got me here Precision A/D Converters | Analog Devices
If you want it you will probably have to datasheet the interface tho, hard work...
or maybe some kind of a low noise linear amplifier to boost the voltage...
or both
and you can probably calibrate for non linearity with a function in code, you d have to compare it with a high precision instrument with as many measurements possible, and then find the function of deviation to calculate true values
anyway good luck, difficult
@Railroader yes, but I can bear error in tens of millivolts but non-linearity is in hundreds. There may be problem with internal reference too (or may be not, I have not checked).
@Semtex9 I wanted the quick solution (the module for which base work is done in Arduino or easy to use) & working with a rare or unused chip/module or calibration of non-linearity would be a long time work, which can't be done quickly. That's the reason, I asked if anyone is familiar of such module. Most of the modules I came across with were either having low sampling rate per second or low accuracy or way too much expensive or very rare to work.
Be interesting to see some more project details, how you deal with negative going voltages, voltage ref,
parts , wiring etc . That ADC result looks suspiciously strange
An electricity meter with a pulse output is a cheap easy safe and accurate method of measuring power.
@Semtex9 Can't use amplifier because that'd reduce the max range of measuring and I want that as much as available.
@runaway_pancake Exactly bro. Yes, that's how ESP ADC works.
@hammy Bipolar AC wave is converted to DC waveform by full wave precision rectifier. That works amazingly excellent. Here's that : https://www.ti.com/lit/ug/tidu030/tidu030.pdf?ts=1665012464045
What kind of AC current span (minimum and maximum) are you trying to get? CTs are not very linear near the bottom of their range. What does your CTs datasheet say?
That approach is never used in the industry. Double the performance, quadruple the costs and You get better stuff. Come down to a specification of the real needs.
The ADC in an ordinary Arduino Uno does quite a bit better than the ESP32, and is fine for household AC RMS voltage, current and power measurements.
Take a look at CT Sensors - Interfacing with an Arduino — OpenEnergyMonitor 0.0.1 documentation
An amplifier before the A/D would help. It would get you out of the millivolt range. If your millivolts are from a current shunt you will need an instrumentation amplifier.
I've not looked too far into this part buy maybe it will work for you.
@runaway_pancake I'm already using something like this (but not exactly your thing). That increased accuracy but it still is a problem.
@JCA34F I'm using ZMCT118F & ZMPT101B. Yes, CTs aren't good near bottom of their range. But I'm concerned above that range. Target is to measure 0-100A with accuracy up-to 0.1A.
@Railroader My tolerable range is 0-3.3V (most of ADCs have this). But if I amplify the wave, the accuracy would become better but range would be reduced. So, that basically is a trade-off. That's the reason I was not going that way. And while, I know that ESP32 ADC has a problem why wasting time on that rather than not finding some external accurate ADC.
@jremington Yes, it's linear. But UNO 16MHz is slower against ESP32 240MHz (also slower ADC sampling), single core, low memory & many more limiting factors. ESP32 is much better & I'm working on that already. Can not just switch to UNO just because of accuracy.
@JohnRob Maybe you're saying is good enough but that whole thing is non-relatable to my problem as ADC (to read those millivolts) isn't capable of reading accurately. My signal is good enough, I don't need to filter it out (Checked with oscilloscope). Problem is with ADC.
Please note that accuracy and resolution are not the same, nor are they even proportional. Accuracy depends on the quality of the reference voltage and ADC linearity but, resolution depends on the number of bits per volt.
file:///E:/Downloads/ACS758-Datasheet.pdf
stronger ones cant measure at low currents tho...
But they are arduino compatible
if you want full 0-100A reading then it might be good to have multiple ranges and switch ranges upon nearing min/max, a bit teadious
maybe an amplifier that gets cut off/bypassed when nearing maximum, or multiple voltage dividers after it, and you switch range in code too, you would need a variable for knowing the range and constraints for when to switch, also at least 1 digital pin to execute, and maybe multiple ad conversion values for the math, should transition almost seamless, and you wouldn't deal with extremely low voltages, kind of like auto-range on a multimeter but much faster
if its hard to get somewhere make it come to you xD
@herbschwarz Yes, you are saying true. I was mistaken. But as resolution decreases, uncertainty of exact point increases and hence I can carefully say inaccuracy dwindles.
@Semtex9 Already tried ACS712. Not very good. High cost & becomes complicated.
I had already tried/considered all those options. And most suitable solution is to find an accurate, high resolution external ADC. That would solve the problem most quickly.
Its a huge range, why do you need it so acurate anyway?
Simply because, I can. I would like as much accurate as I can. But target is 0.1A resolution anyway. And if I get the requested ADC, I'll be easily able to do that.
Righty then, I am not aware of one, and I needed one myself to measure welding current up to 140A.
I did look for the most precise possible, like you, but couldn't find anything beside ACS, readily compatible for the range, settled for it cos it was easy, and I needn't better, couple of measures and average, welding 1A+- is nothing...
you CAN do almost anything, question is should you, and how much time are you willing to spend on it. Is it for monitoring a process, or are you building an instrument.
If it is critical, then datasheet ADC implementation, or amp might be only option, and you can even be a hero for others
parallel ones don't seem very difficult to decode, still pretty tedious, didn't ever need to try...
Maybe someone is willing to share but don't count on it if you couldn't already find it on github or google...