Question from a SW Engineer again.
I've got a device which is mains powered and outputs a 4-20mA current depending on the flow rate in a pipe. I'd like to measure that flow rate with a microcontroller.
On the face of it it's easy. My microcontroller is 3v3 so max current should produce max voltage of 3v3. So R = 3v3/20mA = 165 Ohm. If I pass the current through 165R and measure the voltage across the resistor it's all good.
My problem is I'm unsure if I can actually do that. The uC will measure a voltage relative to it's ground connection so I have to connect the uC Gnd to the negative side of the 165 ohm Resistor. Is that safe?
I was then looking at current mirror circuits but they all share a Gnd plane between the two sides of the mirror so it's no better then the simple 165R.
Is there a "correct" way to isolate this sensor or is it a case of just connecting the ground. My uC will be powered by a Mains - 12v DC power converter so maybe ground will be the same on both sides?
Answer
Yes, just connect the negative end of the resistor to the microcontroller analog ground. This is one advantage of a current signal. Since the microcontroller supply and the flow meter supply are isolated from each other, you get to pick one point on each where you can connect them together.
While your calculation of 165 Ω is correct, I would use just a little less to be able to sense some overrange. 150 Ω might be a good value.
No comments:
Post a Comment