High(er) resolution current sensor

Development & General Chat for the superb openxvario project.

Moderator: rainer

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

High(er) resolution current sensor

Post by Carbo »

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 361 times

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

Re: High(er) resolution current sensor

Post by Ozzy »

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: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: High(er) resolution current sensor

Post by Carbo »

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.
johnmodeller
Posts: 3
Joined: Tue Oct 27, 2020 1:47 am
Country: -

Re: High(er) resolution current sensor

Post by johnmodeller »

G'day Carbo

I have just discovered you post on a higher current sensor. I have not kept across ARDUNIO developments so please excuse a dumb question.
I think I have worked out two of the boards in the final photo, The current sensor and the AD converter. Correct me if I am wrong. Is the third board the ARDUINO board?
It looks like it takes the binary data and makes the data available to an RX. Hopefully a Taranis RX and TX.
What Arduino Processor is being used?
IS the code available? I would prefer not to learn C++ at this time.
This gadget looks just what I am looking for my Electric Vintage Glider. To know the current draw and logging would be a big advantage for trimming.
Thank you in advance.

Take care in the c-19 times. John Quigley (Australia)
Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: High(er) resolution current sensor

Post by Carbo »

Hi John
Yes, third board is an Arduino pro mini 328 16MHz. It is also possible to use an Arduino Nano which has USB onboard with only a little weight and size penalty. Nano is preferable for beginners if size is negligible.
If you are only looking for a 100A sensor without the need of 0.02A resolution it is even easier, no additional ADS1115 in this case.
The code for the high resolution sensor is attached in the first post, only download and extract and hit openXsensor.ino to start Arduino IDE (which has to be installed of course). It is the standard openXsensor package with matching settings in the config files. If you are not familiar with Arduino PM me and I can guide you to a working sensor, no matter if high resolution or standard.
Carbo

johnmodeller
Posts: 3
Joined: Tue Oct 27, 2020 1:47 am
Country: -

Re: High(er) resolution current sensor

Post by johnmodeller »

G'day Carbo
Thanks you for your king offer. I am waiting for some parts and will contact you as I learn more.

Please take care we need folks like you in these C-19 times. John Quigley Aussie Land.
johnmodeller
Posts: 3
Joined: Tue Oct 27, 2020 1:47 am
Country: -

Re: High(er) resolution current sensor

Post by johnmodeller »

G'day Carbo

I meant Kind offer.

Bad typing jq
ronron84
Posts: 48
Joined: Sat Apr 18, 2020 7:13 pm
Country: -

Re: High(er) resolution current sensor

Post by ronron84 »

Hi carbo,

Just for information after using few 100a and 50a acs 758 without ads1115 we found out that the slope is linear (good), but the zero is not 2.5v it can change from a sensor to another and the resolution is less than what we can read in the datasheet (bad) it also varies from a sensor to another (we had 0.16ma on a 100a and 0.26 on a 50a for example) and also varies from the output regulation voltage from the arduino. I think a bench test would be a good tool to get a good accuracy too for each sensor. on my bird with only zero adjustment i have 3-4 percents of difference at the end of the flight between oxs value and cells reader.

Post Reply

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