Author Topic: arduino measuring 4-20ma what kinda precision  (Read 13083 times)

0 Members and 1 Guest are viewing this topic.

Offline simondidTopic starter

  • Contributor
  • Posts: 20
  • Country: dk
arduino measuring 4-20ma what kinda precision
« on: January 06, 2016, 04:13:50 pm »
Hey

So I’m working on interfacing a bürkert level transmitter 8177 https://www.burkert.com/en/type/8177 with a Arduino and raspberry I found that people are using a asc712 5a version Hal effect sensor to do this job.

Question 1 : How much precision will I get out of this (assuming the sensor was is 100% accurate ) running it a 24 volt??



Question 2: using this board http://www.ebay.com/itm/381374424345?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT can i really just connect the 2 wires coming from the sensor Direct


Question 3: will I be better off trying to implement the HART Protocol considering time and precision gain?


thanks



« Last Edit: January 06, 2016, 04:43:24 pm by simondid »
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1275
  • Country: gb
    • bitdynamics
Re: arduino measuring 4-20ma what kinda precision
« Reply #1 on: January 06, 2016, 06:15:40 pm »
4 to 20mA into a 5A sensor??  The RESOLUTION will be terrible, irrespective of how much precision you manage to achieve!!


You can calculate the resolution easily with basic maths (hint, work out the V/amp of the sensor, and then the V/count of your adc) and of course, the max precision of the system can only ever be half your resolution.
 

Offline simondidTopic starter

  • Contributor
  • Posts: 20
  • Country: dk
Re: arduino measuring 4-20ma what kinda precision
« Reply #2 on: January 06, 2016, 07:06:46 pm »
Is there any way to get a good resolution?
 

Offline bxh

  • Contributor
  • Posts: 32
  • Country: gb
Re: arduino measuring 4-20ma what kinda precision
« Reply #3 on: January 06, 2016, 07:17:48 pm »
Never heard of the sensor, but quick Google brings up Sparkfun's listing which describes an opamp gain stage.
 

Offline Alexei.Polkhanov

  • Frequent Contributor
  • **
  • Posts: 684
  • Country: ca
Re: arduino measuring 4-20ma what kinda precision
« Reply #4 on: January 06, 2016, 07:27:46 pm »
This sensor is designed for standard 4-20 ma current loop so you can/should use some of available receivers like TI RCV420 (part name speaks for itself :))
link: http://www.ti.com/product/rcv420 - it will translate your 4-20 current signal into 0-5V voltage.

Check out other ICs in this list as well: http://www.ti.com/lsds/ti/amplifiers-linear/4-20mA-conditioning-products.page. 4-20 is something like 100y old de-facto standard for industrial automation so there are literally tonns of info and components available.
 

Offline garre

  • Contributor
  • Posts: 11
  • Country: us
Re: arduino measuring 4-20ma what kinda precision
« Reply #5 on: January 06, 2016, 09:10:20 pm »
It seems to me that you are going at this the hard way.  All you need to do is place a precision 250 ohm resistor in the output of the 4-20 ma transmitter.  Then use a voltage sense to get a sensor range of 1 to 5 volts.  Or if you need a lower output voltage range use a smaller resistor. Simple ohms law.  Check the transmitter circuit to be sure that you can ground the negative side of the sensors transmitter 4-20 ma signal. This is usually OK to do.  If not you will need a differential amplifier as an input or isolated power supplies with different grounds.

I have worked in the instrumentation world for many years and this is a standard solution to the problem.

 

Offline Alexei.Polkhanov

  • Frequent Contributor
  • **
  • Posts: 684
  • Country: ca
Re: arduino measuring 4-20ma what kinda precision
« Reply #6 on: January 06, 2016, 09:31:09 pm »
It seems to me that you are going at this the hard way.  All you need to do is place a precision 250 ohm resistor in the output of the 4-20 ma transmitter.  Then use a voltage sense to get a sensor range of 1 to 5 volts.  Or if you need a lower output voltage range use a smaller resistor. Simple ohms law.  Check the transmitter circuit to be sure that you can ground the negative side of the sensors transmitter 4-20 ma signal. This is usually OK to do.  If not you will need a differential amplifier as an input or isolated power supplies with different grounds.

I have worked in the instrumentation world for many years and this is a standard solution to the problem.

I think you forgetting a voltage reference?

BTW single 4-20 receivers like RCV420 already have precision resistor, diff amp and voltage reference inside with 0.1% resulting accuracy - all for $8.4 on DigiKey in one-off quantities. I am not sure if can you bit that with "roll your own" kind of solution. Just saying. :-//
 

Offline simondidTopic starter

  • Contributor
  • Posts: 20
  • Country: dk
Re: arduino measuring 4-20ma what kinda precision
« Reply #7 on: January 07, 2016, 02:34:42 pm »
"Alexei.Polkhanov"
tanks for the greate answere  ;Dany chance youre aware off any cheapere chips sinse im living in denmark orders from digikey is a 30$ shipping cost and ebay for some wired reason is also kinda expensive...

any chance you cut provide a schematic for using this chip with a arduino ore adc ? im kinda new to all this circuit building   :-/O :-DMM

"garre"
i have consideret that soloution and found that getting a precission resistor and referance voltage was kinda hard ... and the ic solution sound greate
 

Offline Seekonk

  • Super Contributor
  • ***
  • Posts: 1938
  • Country: us
Re: arduino measuring 4-20ma what kinda precision
« Reply #8 on: January 07, 2016, 02:59:20 pm »
I should remind you that Arduino has a nice debug screen in TOOLS that data can be sent to.  There is an issue though if you use that for calibration.  Plugging your laptop USB in will likely change your calibration while connected because the A/D of the chip will use whatever 5V is higher for the reference.  I use a USB cable with the 5V line cut and back to back diodes installed so the micro always runs off it's own regulator.  I've not had an issue with the clones I've purchased and I prefer to use the stripped down mini for $3.  The ones with gold are worth the small extra price. 
 

Offline cs.dk

  • Supporter
  • ****
  • Posts: 642
  • Country: dk
Re: arduino measuring 4-20ma what kinda precision
« Reply #9 on: January 07, 2016, 03:19:39 pm »
Quote
any chance youre aware off any cheapere chips sinse im living in denmark orders from digikey is a 30$ shipping cost and ebay for some wired reason is also kinda expensive...

http://dk.rs-online.com/web/p/transimpedansforstaerkere/6606626/
http://www.tme.eu/en/details/rcv420jp/ui-uf-uu-converters/texas-instruments/#

Shipping from TME is not that high, and they ship pretty fast. You usual have your stuff the next day.
 

Offline simondidTopic starter

  • Contributor
  • Posts: 20
  • Country: dk
Re: arduino measuring 4-20ma what kinda precision
« Reply #10 on: January 07, 2016, 03:44:34 pm »
any one able to draw a schematic  using the RCV 420 chip with arduino i not confident enu in this...  :o

"Seekonk" i was not aware off this ill check it out :P
"cs.dk" thanks alot mate didnt know rs-online sold ic and that stuff
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7369
  • Country: nl
  • Current job: ATEX product design
Re: arduino measuring 4-20ma what kinda precision
« Reply #11 on: January 07, 2016, 03:52:16 pm »
any one able to draw a schematic  using the RCV 420 chip with arduino i not confident enu in this...  :o

"Seekonk" i was not aware off this ill check it out :P
"cs.dk" thanks alot mate didnt know rs-online sold ic and that stuff
Read the friendly datasheet. Figure 1, 15...
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14172
  • Country: de
Re: arduino measuring 4-20ma what kinda precision
« Reply #12 on: January 07, 2016, 04:03:57 pm »
Given that the ultrasonic sensor is internaly likely measuring times and not voltage, I would consider looking at the HARD protocol. Chances are the output is better than the analog one, and no additional errors from transmission.

The µC shlould be fast enough - it just needs quite some software.

As the resolution of the AVR internal ADC is only 10 bit, there is no real need for a really high qualitiy reciever chip. I would consider a precission resistor and an extra ADC like MCP3421 - should be cheaper, smaller and higher resolution.
 

Offline simondidTopic starter

  • Contributor
  • Posts: 20
  • Country: dk
Re: arduino measuring 4-20ma what kinda precision
« Reply #13 on: January 07, 2016, 07:01:24 pm »
"NANDBlog"
just to confirm this is the figur youre talking about right


images upload


"Kleinstein"
you're properly right but i been looking around the web and found near zero free information on the hart protocol and found that acces to dukomentation is price at 900 dollars https://www.eevblog.com/forum/projects/industrial-sensor-interfaces-(like-hart)/msg701202/#msg701202 witch kinda rules it out
 

Offline XFDDesign

  • Frequent Contributor
  • **
  • Posts: 442
  • Country: us
Re: arduino measuring 4-20ma what kinda precision
« Reply #14 on: January 07, 2016, 07:08:28 pm »
Simondid,

Without mentioning any parts, can you provide a simple summary statement of the problem which you're trying to solve?

Too often, people approach a problem, not really knowing what it is they're trying to do, and come up with very convoluted ways to solve something. If you can take a step back and state the problem you're trying to solve, you may find the solution to be much more simple than your current approach.

For example, can you define your inputs, your outputs, and your system constraints?
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7369
  • Country: nl
  • Current job: ATEX product design
Re: arduino measuring 4-20ma what kinda precision
« Reply #15 on: January 08, 2016, 12:13:32 pm »
No, I dont think that is the way to connect it.
Quote
The input signal should be connected to either+In or –In, depending on its polarity, and returned to ground through the center tap, CT
You typically only connect to the "little circles" something external.
 

Offline simondidTopic starter

  • Contributor
  • Posts: 20
  • Country: dk
Re: arduino measuring 4-20ma what kinda precision
« Reply #16 on: January 08, 2016, 02:53:37 pm »
"NANDBlog"

upload a picture

so if the input polarity is posetiv it goes to in+ and the othere to Ct ?

"XFDDesign"

im traying to interface an raspberry ore arduino with a 4-20ma sensor output
im looking for a decent precission sinse i goth othere sensors with the same output i wan't to use
the solution also have to be with in a decent price range...
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: arduino measuring 4-20ma what kinda precision
« Reply #17 on: January 08, 2016, 04:37:36 pm »
Let's just assume that you are converting a 4-20mA loop current into 0-Vref in a sensible way and feed that voltage into the AVR's internal ADC.

To answer your question about what resolution you can get, assuming you're not using a separate external ADC connected to the microcontroller, it's a 10-bit ADC, so the resolution that you can achieve will be 16mA/1024 or 15.63 uA.

If you have a simple approach like a resistor where 0-20mA corresponds to 0-Vref then the resolution will be slightly worse at 19.53 uA.
 

Offline AlxDroidDev

  • Frequent Contributor
  • **
  • Posts: 471
  • Country: br
    • Arduino Web Brasil
Re: arduino measuring 4-20ma what kinda precision
« Reply #18 on: January 08, 2016, 05:24:30 pm »
I am surprised nobody has suggested the INA219 so far.

the Texas' INA219 is an I2C device and does the measurement using an user-defined shunt resistor, based on the current being measured.

I've tried both ACS712-5 and INA219. For small currents, the ACS712-5 is completely useless. It's very noisy. It's noise is higher than the output voltage for very small currents, so it is very hard to tell, for such small measurements, what is noise and what is measurement. I even wrote about it on the Arduino forums.

The INA219, OTOH, is a very stable and precise device. I've had it measuring currents from 1-100mA, using a 0R5 resistor, and after adjusting its calibration it gave consistent results that were always identical to the one on my fluke 17B+. Interfacing it with the Arduino is quite easy and AdaFruit has a library for it.
"The nice thing about standards is that you have so many to choose from." (Andrew S. Tanenbaum)
 

Offline XFDDesign

  • Frequent Contributor
  • **
  • Posts: 442
  • Country: us
Re: arduino measuring 4-20ma what kinda precision
« Reply #19 on: January 08, 2016, 05:34:01 pm »
im traying to interface an raspberry ore arduino with a 4-20ma sensor output
im looking for a decent precission sinse i goth othere sensors with the same output i wan't to use
the solution also have to be with in a decent price range...

Maybe this is something which comes from the hours put into engineering school.

Let me elaborate.
"I'm trying to interface a raspPi or an arduino to a 4-20mA sensor output."
So take the sensor output and plug it into any pin on the rPi or Arduino.

That won't work? It's a very literal 'interface.' It's describing the actions you're trying to do, but it isn't stating the idea or purpose of what you're intending on doing.

You mention 'decent precision,' but this is not a qualified statement. For example, in my industry many of our "precision" products have target specs of less than 1uV for things like input offset voltage.

Instead of working backwards (micro to sensor), consider working forwards:

You have some 4-20mA device. What kind of resolution can it provide? What kind of power supply requirements does it have? Suppose you used a 150 ohm sense resistor between +12v and your sensor. At 20mA, the sensor sees 9V. Will it still operate in this range?
Now suppose it does. You get all kinds of answers in this thread. You get solutions which resolve down to 1uA, for a dynamic range of 86dB. Then it turns out your sensor is only capable of an 8-bit conversion internally and discreetly steps 62.5uV for a dynamic range of 48dB. Your solution is grossly over-engineered, because you didn't design your front-end around your sensor.

Now, suppose the sensor was a purely continuous time, continuously variable output, and that the device operates from 12 to 24V. In this case, you could simply power an LM741 on the +24V supply, use a sense resistor and a following transistor an some negative feedback, and resolve current to voltage by way of regulating the output voltage. The current consumption develops an error voltage across the sense resistor, and then you simply feed that error across another LM741 setup as a difference amplifier. This would be a very cheap, functional solution (<$1), but would have all sorts of DC errors that you would have to calibrate out, and would not have high precision (diff amp resistors not highly matched, poor CMRR, gain errors, etc). Is this sufficient performance? We don't know, because we don't have the details of the sensor. If that is not precise enough, a different approach still, would be required.

I was unable to find a datasheet on the 8177, so there isn't much I can do without it. But without knowing what the sensor can do, and what its constraints are the design won't be a good one.

The mastery of engineering, comes down to the ability to describe the problem and understand the solution required. :)

 

Offline simondidTopic starter

  • Contributor
  • Posts: 20
  • Country: dk
Re: arduino measuring 4-20ma what kinda precision
« Reply #20 on: January 08, 2016, 07:34:25 pm »
"AlxDroidDev"
hey tanke for the sugestion just a few quick questions

so according to https://www.adafruit.com/products/904 adafruit website
Quote
A precision amplifier measures the voltage across the 0.1 ohm, 1% sense resistor. Since the amplifier maximum input difference is ±320mV this means it can measure up to ±3.2 Amps. With the internal 12 bit ADC, the resolution at ±3.2A range is 0.8mA. With the internal gain set at the minimum of div8, the max current is ±400mA and the resolution is 0.1mA.
so i can get a 0.1ma resoluction with this setup ?
 if thats the case i will get a resolution at 16ma/0.1ma  = 160
760 / 160 = 4.76cm pr data point
is this right?

what you mean when you say “ using a 0R5 resistor”  where inn the circuit?



"XFDDesign"
So I’m think you want me to put some numbers on what I’m looking for ?

so in terms off precision assuming the sensor was 100% accurate something like 1data point / pr 1 cm  in other word 8meter - 0.4m(sensor dead zone) = 7.6 m = 760 data points

Since i'm no engineer just pure hobby the circuit design and calculation need to be simple and straight forward

In terms of price less than 20$ from ebay
Quote
I was unable to find a datasheet on the 8177, so there isn't much I can do without it. But without knowing what the sensor can do, and what its constraints are the design won't be a good one.

I can't give you any more information then what’s on this link https://www.burkert.com/en/type/8177 and these images since it the only stuff i have access to atm
capture screen


images upload


also in general i'm confused if i need more then 2 wires to use this sensor for power and signal
 
upload image online
 

Offline theatrus

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: us
Re: arduino measuring 4-20ma what kinda precision
« Reply #21 on: January 08, 2016, 08:08:36 pm »
Since this is not a loop powered sensors from the looks of it, you can use a very simple sense resistor (100-250ohm) and op-amp to feed an AVR A/D channel (not strictly required if you use an external voltage reference).  For me, this would be a "decent" accuracy level, but what qualifies as decent would of course be up to you. Back when I was doing hardware design professionally, this arrangement with a small capacitor across the input was shipped in a lot of products - usually it exceeded the resolution and accuracy of the sensor in use.

Software by day, hardware by night; blueAcro.com
 

Offline Alexei.Polkhanov

  • Frequent Contributor
  • **
  • Posts: 684
  • Country: ca
Re: arduino measuring 4-20ma what kinda precision
« Reply #22 on: January 08, 2016, 08:45:17 pm »
"NANDBlog"

upload a picture

so if the input polarity is posetiv it goes to in+ and the othere to Ct ?

"XFDDesign"

im traying to interface an raspberry ore arduino with a 4-20ma sensor output
im looking for a decent precission sinse i goth othere sensors with the same output i wan't to use
the solution also have to be with in a decent price range...

Connections look right to me.

I never used Arduino or Atmel MCUs. I lokked at datasheet and it appears that it has 12 bit (10 bit normal) ADC. What I don't see is ANALOG reference input for ADC like ADUc845/ADUc848 MCUs from Analog Devices have for example. ADUc845 require 2.5V external reference. What you have to make sure is that you make use of entire dynamic range of your ADC without clipping. So for example in case of ADUC845, some models have 24bit ADC with external reference set to 2.5V - meaning that you would expect input 0V to be represented as 0x000 and 2.5V to be 0xFFF - in that case 0-5V will be twice the range of ADC so it has to be halved through resistive divider for example. Now if you have ADC that takes reference input then ideally you would want to use reference output from your receiver as external reference for ADC. Now it terms of Arduino I am not sure if its abnalog input that spans 0-5V?

So if you take 0-5V output (from whatever receiver circuit you choose) then you scale it to match the ADC input range and leave some room for component errors. Accuracy of scaling resistors in this case is not important as long as you use same voltage reference. When you done you calibrate WHOLE system. If your voltage reference, resistor devider's resistors tempco and other component's drift with temperature/humidity/power supply voltage are low your calibration will remain accurate for years. 

BTW on your photos - you have I2C interface on your sensor - is it for calibration only? You can probably hook up sensor to your Arduino using I2C and it should work up to 100m. if not use I2C extender IC - I would add a beefiest one I can find anyway. So you probably don't need to use 4-20 loop at all for this specific sensor.
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: arduino measuring 4-20ma what kinda precision
« Reply #23 on: January 08, 2016, 09:22:52 pm »
I am surprised nobody has suggested the INA219 so far.

I am more surprised nobody has suggesting learning basics first, as the OP seems not to have much clue about what he is doing (as 99.9% of arduino users).

But back to the topic of interfacing the arduino to the current loop:  Arduino is not worthy of any INA or RCV for this application.

I'd suggest using a simple shunt and an noninverting amplifier with OPamp (preferably a R2R type one, to be able to cover the full 5V range of the ADC using the same 5V supply for it). This will be tough task for the OP itself I guess, so let's not get it complicated.

Of course, one can build more sophisticated circuit with opamp, which would even solve the 4mA/20% shift, using the whole range of the ADC, but let the OP start with something, he can probably make work. Somehow.
 

Offline simondidTopic starter

  • Contributor
  • Posts: 20
  • Country: dk
Re: arduino measuring 4-20ma what kinda precision
« Reply #24 on: January 09, 2016, 10:46:14 am »
bay the way i allready ordered a 16 bit adc http://www.ebay.com/itm/400985244934?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT sinse this also seems to be a bottel neck

also i found an item on ebay with says it can do the job what are youre thoughts http://www.ebay.com/itm/Current-to-Voltage-Transmitter-Signal-Module-4MA-20MA-to-0-5V-Linear-Conversion-/252214939748?hash=item3ab92e9064:g:ua0AAOSwBLlVAUVk

"Alexei.Polkhanov"

Quote
BTW on your photos - you have I2C interface on your sensor - is it for calibration only? You can probably hook up sensor to your Arduino using I2C and it should work up to 100m. if not use I2C extender IC - I would add a beefiest one I can find anyway. So you probably don't need to use 4-20 loop at all for this specific sensor.


i think the i2c is for the display with can be added to this sensor... in case the data from the sensor was on the i2c pins i have 0 acces to any information on it's communication protole and how they communicate


"Yansi"
Quote
I am more surprised nobody has suggesting learning basics first, as the OP seems not to have much clue about what he is doing (as 99.9% of arduino users).
true i'm more off a programmer then a electronics engineer and have near 0 experiance in designing electrical circuits there for im look for a complete circuit drawing ore a an ic that can due the job like the rcv420 ore the Texas' INA219 witch both seems to be able to do the job but rcv is kind of expensive and the ina219 is lacking a bit off precision
« Last Edit: January 09, 2016, 11:18:07 am by simondid »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf