Reading 4-20ma signal on arduino

Thread Starter

sumitmn

Joined Feb 20, 2020
1
Hi,

I want to read a 4-20 mA analog signal from a 24V flowmeter. I've read the simplest way is to convert it into 1-5V signal using a 250 ohm resistor. The thing is I want my reading to be precise so my question is; is there any resolution loss when converting it to 1-5V?

I've also looked up on current to voltage converting boards similar to this one: https://www.sparkfun.com/products/14544

but I don't think they can detect 4mA signal.

I am a beginner in this so need some guidance here.
 

sagor

Joined Mar 10, 2019
252
Accuracy of the voltage from the current loop will depend on the accuracy of the resistor, and accuracy of the A/D conversion.
We used to use 25 ohm, 10ppm resistors many years ago, giving accurate voltages for the current loops. Even 0.1% resistors will give fairly accurate results.
Your errors will add up from the following: current loop device error, resistor error, and A/D conversion error. Errors are cumulative. Errors may be a percentage of "full scale" values, so keep that in mind.
So, look at all the errors from each device, and add them together. Your "accuracy" may not be as good as you think it is....
 

Reloadron

Joined Jan 15, 2015
5,646
Accuracy of the voltage from the current loop will depend on the accuracy of the resistor, and accuracy of the A/D conversion.
We used to use 25 ohm, 10ppm resistors many years ago, giving accurate voltages for the current loops. Even 0.1% resistors will give fairly accurate results.
Your errors will add up from the following: current loop device error, resistor error, and A/D conversion error. Errors are cumulative. Errors may be a percentage of "full scale" values, so keep that in mind.
So, look at all the errors from each device, and add them together. Your "accuracy" may not be as good as you think it is....
With all of that in mind consider the following. What is your range of flow? Your Arduino uses a 10 bit ADC (Analog Digital Converter) so what you have is 0 to 5 volts analog in becomes 0 to 1023 bits or you have 1024 quantization levels so the best case resolution becomes 5 / 1024 = 4.88 mV. Using a good 1% precision resistor with your 4 - 20 mA loop a 250 Ohm resistor will give you 1 to 5 volts so you have a span of 4 volts for whatever your flow span is.

There are a few things which can improve this. The first is to average multiple samples on your Arduino. Just for example average 10 or 100 samples.

Another popular method is to use a 51 Ohm resistor in your 4 - 20 loop rather than 250 Ohms. This gives you .204 volts to 1.02 volts. You can change the Arduino Uno internal ADC reference in your setup portion of the code. You can change the reference for the ADC to 1.1 volts. So now 0 to 1.1 volts becomes 0 to 1023 bits. You write your code accordingly. Then use maybe a 10 sample averaging, sometimes called smoothing. Here is an example.

There are other options to improve uncertainty. Knowing your flow range and how accurate you need or want would help.

Ron
 
Top