Arduino 4

编程入门 行业动态 更新时间:2024-10-24 08:30:03
Arduino 4-20ma精度(Arduino 4-20ma Accuracy)

我使用2线电流回路将压力变送器Dwyer MS-121(范围从-100 Pa到+ 100Pa)连接到Arduino。 对于分流电阻,我使用220欧姆。 所以要从电压到压力进行计算,这就是我所做的:阅读是我从分流电阻读取的

(((((float)reading * 0.0049) - 0.88) / 3.52) * 200) - 100)

0.0049用于知道实际电压,然后从4-20mA(4mA * 220Ohm)的最低范围中获得0.88,从4-20ma(20mA和220Ohm)的最高范围中获得3.52,并且减去0.88以得到0到3.52(所以我可以通过百分比来计算)。 那么200因为我的压力变送器的范围(-100到+ 100Pa)。 最后一个是减去100,所以我可以得到一个很好的-100Pa到+ 100Pa的范围。

现在,我的压力变送器也有显示。 我从显示屏得到的值是-19.4Pa,我从Arduino得到的值是-21.1Pa。 它相差1,7Pa或0.85%。 我很好奇为什么arduino的价值不准确,是我的计算还是我的电路?

I am connecting a pressure transmitter Dwyer MS-121(Have a Range of -100 Pa to +100Pa) to Arduino using 2 Wires Current Loop. For the shunt resistor, I am using 220Ohm. So to calculate from voltage to pressure, this is what I do: reading is what I read from the shunt resistor

(((((float)reading * 0.0049) - 0.88) / 3.52) * 200) - 100)

0.0049 is used to know the real voltage, then 0.88 from the bottom range of 4-20mA(4mA * 220Ohm), 3.52 from the top range of 4-20ma(20mA & 220Ohm) and substracted by 0.88 to get a range from 0 to 3.52(So I can calculate it by percentage). Then 200 because the range of my pressure transmitter ( -100 to +100Pa). And the last is substracting it by 100 so I can get a nice range of -100Pa to +100Pa.

Now, My pressure transmitter has display too. The value I got from display is -19.4Pa and I got the value from Arduino is -21.1Pa. It has a difference by 1,7Pa or 0,85%. I am curious why the value from arduino is inaccurate, is it my calculation, or my circuit?

最满意答案

您的220欧姆电阻可能仅指定为精确到5%。 所有的模拟读数都是相对于Arduino的5V电源而言的,它本身可能只有5%的准确度。 所以你的8.8%结果(不知道你是如何得到0.85%)在预期的范围内,只考虑这两个可能的误差来源。

您至少正在计算一个计算误差:0.0049仅仅是一个近似值,实际电压转换系数为5/1024。 那里3.5%的折扣。

Your 220 ohm resistor is probably only specified as accurate to 5%. And all of your analog readings are relative to the Arduino's 5V power supply, which itself is probably only accurate to 5%. So your 8.8% result (not sure how you got 0.85%) is within the expected range, just considering these two possible sources of error.

You are making at least one calculation error: that 0.0049 is just an approximation, the actual voltage conversion factor is 5/1024. That's 3.5% off right there.

更多推荐

本文发布于:2023-08-06 04:32:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1444786.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Arduino

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!