Just wanted to make a choice whether to use external or internal adc of arduino. At present sampling rate of arduino is enough for my project. The next decision is resolution and drift performance. Could anybody explain how much is the unadjusted error (in percentage) of arduino. Can we improve it by calibration. if yes, I could avoid external adc. btw 10 bit also seems to be ok for me.
The typical error is 1-2 bits, and can not be improved by calibration, but can be improved by oversampling. Oversampling also allows you to increase resolution by 1-2 bits.
The ADC of the Arduino is normally ratiometric, as in referenced to Vcc. You can switch to an internal fixed reference of about 1.1V instead. Most external ADCs have their own built-in fixed reference. Both have different use cases.
An external ADC is also useful if you don't have enough pins. Typically not very useful to increase sampling rate much, as the Arduino can't process that much data. You'd need a faster processor and more memory as well (e.g. Due, Teensy, ESP8266, ESP32, RPi).
Please suggest, sampling rate is about 1KSPS. Input is sine wave (50Hz). Now what to choose? Due with 12bit ADC (internal) or external? If external what would be the best to easily interface with arduino
If 10 bit is enough for you, stick with the internal ADC.
If that's not enough, use an external one such as the ADS1115, which can do 860 sps at 16 bit, or the ADS1015 which can do 3,300 sps at 12 bit.
Actual resolution of course also depends on how much of the range your input signal really uses.
The next decision is resolution and drift performance. Could anybody explain how much is the unadjusted error (in percentage) of arduino.
The 10-bit ADC reads 0-1023. Your resolution is 1 out of 1023.
So for example - Let's say you're reading the 240VAC line voltage (safely through a transformer, and rectified). If we "calibrate" 250VAC to read 1023, we can use the ratio to find that we have resolution (or steps) of 0.24 Volts. (Don't forget that 240VAC is about 340V peak or about 680V peak-to-peak.)
And with a sample rate of 1kHz you are taking 20 samples per cycle (10 samples per half-cycle).
I'm not sure about drift. With any ADC you can always be on the "hairy edge" between two counts (or anywhere between two counts) so it's normal "jump" between two counts.
Any good example for oversampling filtering and decimation using arduino. I need extra 2 bits.
You need 12 bits resolution, I assume you mean you want that for the full range of normal values. The problem is that if you manage to get your normal signal to the full scale, there's no room for any higher values ever. And if you want to account for higher values you have to scale your normal signal to about 70% of the full scale, so you lose almost one full bit there and then. Effectively you're down to 9 bits. And in case you have a signal that's weaker than nominal, the effective resolution of that signal is even less of course.
This would mean you have to do at the very least least 8x oversampling to get those three extra bits you want, and it's highly debatable whether that's enough oversampling, and whether that last bit is even still significant. An Arduino can do almost 10ksps, and as you average every 8 readings you're down to about 1200 sps. Pushing the limits there as well.
So... to get your readings, and have some range for higher values than normal, you need an external ADC. The ADS1115 doesn't have the sampling rate; the ADS1015 doesn't have the resolution (that are signed values so unless you use differential inputs it's effectively 11 bits). So those are out, and you'll have to do some searching by yourself. Try digikey. You're looking for 16 bit resolution, 1-2k sps or better.
I just borrowed ad7606 breakout board from by friend. Bought through ali express. Could interface and get the data. But there seems to be some problems. I selected range for the adc to be +/-10V. But the data readback is wrong. For example, 6V input data readback is same for 1V and 7V is same as 2V. Strange. Any clues? ( -5V to +5V is fine)
What is the power supply voltage?
I don’t think you can measure voltages that are outside of that range, in fact for most chips supplying a voltage >Vcc or <Vss may damage them.