High(er) resolution current sensor

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
Carbo
Posts: 371
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

High(er) resolution current sensor

Post by Carbo » Fri Apr 26, 2019 9:06 am

The Lantian-100A-ACDC-Linear-Current-Sensor-Hall-Current-Sensor-Module is cheap (about 6$) and precise. It's size can be reduced to Arduino pro mini size. Still there is the disadvantage with it's 2.5V offset. The voltage output is 2.5 to 4.5V. The 10bit Arduino resolution gives only about 0.2A current resolution.

Using a ADS1115 (about 2$) can improve resolution to 0.02A. A voltage divider gives VCC/2 (usually 2.5V) and ADS1115 differential input can then be used with 2048mV resolution to measure voltage between divider and sensor output (it's a copy of mstrens analog airspeed procedure).

Still there is one issue. FrSky does only use precision 1 for current in telemetry. But a workaround is possible. Multiply measurement in oXs and divide it again in OpenTX telemetry with the ratio parameter and set precision 2 for current. My multiplier is 10.2 and ratio is 2.5. 10 and 2.55 would be more intuitive, but ratio does only accept one decimal place.

After calibration resolution was indeed 0.02A with 100A range, good enough to measure servo and motor current with this sensor.
ADS1115 connections:
voltage divider --> ADS1115 A0
sensor out --> ADS1115 A1
VCC--> ADS1115 A2 (not necessary, just out of curiosity and free inputs ;))
16b_1.jpg
16b_2.jpg
16b_3.jpg
Lantian100A_16bit.zip
(341.89 KiB) Downloaded 50 times


User avatar
Ozzy
Posts: 91
Joined: Sun Jul 08, 2012 7:57 am
Country: -

Re: High(er) resolution current sensor

Post by Ozzy » Sat May 11, 2019 4:51 am

You could use a unidirectional version, and lower current range to match your load (unless you need 200A, but then it doesn't make sense to have 20mA resolution). Both would increase resolution without adding parts or code change.
https://www.allegromicro.com/en/Product ... r-ICs.aspx

Carbo
Posts: 371
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: High(er) resolution current sensor

Post by Carbo » Sat May 11, 2019 8:41 am

Yes, of course, this is the standard approach. The workaround with ADS1115 is cheaper and more precise. It does not need any code change in openXsensor. Mstrens prepared this solution already in his code, i only wanted to show a complete, slimsize build and configuration.


Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”