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.