Current Sensor and Calibration

by Oscar
Published: Last Updated on

Current sensor is often used in multirotors to monitor real-time current draw and capacity consumption during flight in OSD or Telemetry. In this article we will discuss the benefits of current sensor and how to calibrate it to get more accurate readings.

Benefits of Current Sensor

Knowing your “amp draw” and how much “mah” has been used are very useful.

  • LiPo battery consumption (aka “mah consumed”) tells you directly when your battery is depleted. In my opinion, it’s a much better battery indicator than voltage (VBAT) which sags with throttle
  • A good indicator if your battery is getting old and should be retired – if voltage is reaching 3.5V from 4.2V, but your mah used is only 80% of the original capacity, then you know the pack is getting old
  • You can easily compare the current draw of different motor and propeller combinations in real flights

Types of current sensor

  • Built-in Current Sensor in PDB and flight controller
  • External current sensor that connects between your battery and PDB

For mini quad builds, I don’t recommend external current sensor, which are heavy and large in size. They are probably more suitable for larger builds like a 450. FC ro PDB with integrated current sensor and OSD are becoming popular for tight builds like mini quads.

Virtual Current Sensor

Virtual current sensor is a feature in Cleanflight and Betaflight. It doesn’t require any of the current sensor hardware, but the current consumption is purely estimated by throttle level. It can be a handy tool to have in your quad if you wish to have current sensor capability but not have the hardware.

Tutorial: http://intofpv.com/t-virtual-current-sensor-with-cleanflight-betaflight

Wrong Current Readings? Calibrate it!

Current sensors are useful, however sometimes these current sensors are not calibrated in the factory. Even 2 identical current sensors could give you slightly different results, therefore it’s important that you know how to calibrate them

If the data of current sensor is not correct, then there is no point of having a current sensor at all. So you should calibrate it.

Current sensors use a simple equation to allow users to adjust/calibrate the output:

 y = ax + b

a is the scale, and b is the offset.

Different FC might need different offset and scale values, and this is what makes current sensor calibration necessary. Luckily, in most cases, you don’t need to change the offset and you can just leave it at default which is zero. All that you need to change normally is the scale parameter.

How to Calibrate Current Sensor

There are 2 common ways to calibrate current sensors.

Trial and Error

This is my “go-to” way of current sensor calibration. It’s much safer, and doesn’t require any additional equipment. However it can take a little longer to get it done.

Basically, you just need to fly a battery, write down what “mAh consumed” is in your OSD. Then charge the battery and see how much capacity is put back. Using this formula you can calculate the new current sensor scale:

new_scale = old_scale x (OSD_mAh_consumed / mAh_charged)

You might need to repeat this process some more times to get an accurate result.

Note that the current scale in Betaflight works backwards, i.e. to make the current sensor read lower, you need to increase scale. For example, if the OSD is reading 10% too high, we need to INCREASE the scale by 10%, this will make the OSD to read 10% lower… I know, it’s confusing :)

Let me give you an example in Betaflight:

  • You fly a battery with your quad, and at the end of the flight, Betaflight OSD shows 1100mAh drawn
  • When you fully re-charge the battery the charger shows 1000mAh was put back into the battery
  • Now you get to calculate the new scale value: New scale = Old scale x (1100/1000)
  • If the old scale was 400, the new scale would be 400*1.1 = 440
  • Now repeat until you are happy with it

Bench Test and Power Meter

This way can be quicker to work out the scale and offset values for your current sensor. You need to strap your quad on the bench, attach a power meter to the quad so you can measure the actual voltage and current draw while running the motors.

However this way can be dangerous, therefore do this at your own risk. You can make it safer by putting the opposite props on so they don’t spin up but down.

You will need a power meter (watt meter) to begin with: https://oscarliang.com/turnigy-7in1-mega-watt-meter/ or this http://bit.ly/2pcP4Eg

I found it more reliable to use the motor tab in Betaflight to spin up the motors. You can use your radio transmitter to arm your quad and throttle up, but when PID controller is active, motors speed tend to change constantly which can affect the accuracy of your current readings. Motor tab gives you a more stable reading.

Compare the data from the power meter to the data from the OSD.

First you are going to notice there is small current draw when the motors are idle, that’s normal because your FC, RX, ESC etc are drawing current. If the difference between power meter and OSD is within 0.1A, you can safely ignore it. If it’s larger than 0.1A, you can adjust the offset to make it as close to the power meter as possible. Normally, offset at 0 works for most current sensors I have come across with.

Now spin up the motors and you are going to notice a high current draw. Aim for a whole amp value on your power meter, such as 30A.

If you get a higher or lower value on the OSD, you should adjust the scale. Change it by a small amount at first to see how much it affect the result.

For example if you get 35A on your OSD, increase the scale by +50, and now you get 27A in the OSD, and you know if by raising scale, you could decrease the reading. And we can work out the proportion between the current and scale: (27-35)/50 = -0.16A, for every scale increment.

In this example, we are still 3A lower than the expected value, so we know we need to lower the scale in this example a little bit more by 3/-0.16 = -18.75.

And that’s it!

Leave a Comment

By using this form, you agree with the storage and handling of your data by this website. Note that all comments are held for moderation before appearing.

30 comments

Rudi Ramaekers 22nd July 2021 - 11:33 am

Resource: https://github.com/betaflight/betaflight/blob/master/docs/Battery.md

amperage_meter_scale = old_amperage_meter_scale * (mAh_recharged / cleanflight_reported_mAh_drawn)

For example, assuming:

An amount recharged of 1500 mAh
A Cleanflight reported current drawn of 2000 mAh
An existing amperage_meter_scale value of 400 (the default)
Then the updated amperage_meter_scale is:

amperage_meter_scale = old_amperage_meter_scale * (mAh_recharged / cleanflight_reported_mAh_drawn)
= 400 * (1500 / 2000)
= 300

Reply
Thomas 15th September 2020 - 4:40 pm

I have tested whit an Tyro79 Virtual Current Sensor:
Scale: 400 / used 444 / recharged 334 = new scale 334
control test:
Scale:301 / used 304 / recharged 307 = new scale 304

Our formula is wrong! I used this: old_amperage_meter_scale * (mAh_recharged / cleanflight_reported_mAh_drawn)

(Tyro whit Betaflight 4.2)

Reply
Thomas 15th September 2020 - 2:28 pm

I think this on our page is wrong: new_scale = old_scale x (OSD_mAh_consumed / mAh_charged)
shouldn’t that mean old_scale * (mAh_charged / OSD_mAh_consumed) (Github)
or am I wrong?

Reply
Albert Gilding 13th February 2020 - 4:19 pm

So heres a interesting one for you. I have three quads that I have calibrated the current sensor on with this method, however my 4th one wants to be special. When I plug the battery in disarmed it says Im running 70a. I tried messing with the offset but it didnt seem to change anything. I have the scale set to 13,000 and it still says that its running 2a before arming. Is this a sign of a sensor gone wrong?

Reply
Luke Perry 14th March 2019 - 6:36 pm

I just soldered up my current sensor on f4 ominibus, all fine but i accidently soldered the + on the left of the current sensor not just to the pad it was supposed to go on to, but it soldered directly to the side of the current sensor, im guessing this will still be ok? or have a made a grande mistake?

Reply
Maori 8th March 2019 - 10:26 pm

My mAh going up and up as soon o plug ThE battery, no matter if it calibrated or not. Im using aikon f4 FC and current sensor from matek pdb. If iuse multishot mAh reads are correct . With dshot not. Any idea?

Reply
danny 23rd February 2019 - 3:53 pm

very helpful!

Reply
Jann 30th January 2019 - 6:33 pm

Hi,

doing the second method “Bench Test and Power Meter” without any Props on the motors, won´t deliver reliable results? I need to have props on in any case?

Thanks.

Jann

Reply
Adam 15th December 2018 - 10:46 am

My used mah is over 1000 when my battery used is only 350. How do I actually adjust it so it reads accurately in my osd?

Reply
Oscar 20th December 2018 - 2:37 pm

Calibrate it?
New scale = Old scale x (1000/350)

Then repoeat the process until you are happy with the result.

Reply
Adam 11th January 2019 - 11:52 am

Sorry, what scale or value am I changing in betaflight?

Reply
michel PAPON 6th December 2018 - 4:22 pm

Hi Oscar,

I would like to use the current sensor of my PDB instead of the one of my F4PRO-V2, but where to link the output wire ?

Reply
Oscar 8th December 2018 - 3:45 pm

it’s usually not possible to override the built-in current sensor in the flight controller because it’s “hard-wired” to the MCU. Unless your FC has allows external current sensor (has a dedicated pin)

Reply
Tomasz Chmielewski 22nd November 2018 - 3:06 pm

Hey, hope you can help me out. I have a hobbywing xrotor 45a esc which has a current sensor, and a OMNIBUS F4 Nano v6 with LC filter which supports Telemetry. Can I connect the wire from the esc current sensor to the flight controller telemetry and still get current sensing. Thanks

Reply
al 3rd December 2018 - 6:31 am

please answer this,.. I got the hobbywing xrotor g2 stack with xrotor micro 45a esc and I cant get esc sensor to work even though its in the breakout cable that plugs from esc to fc..

Reply
John 2nd November 2018 - 7:58 pm

Hi – what is considered to be to high of an amp draw? Trying to get a good motor prop combo…

Reply
100tu 17th August 2018 - 7:01 pm

Hi Oscar,

Mi OSD is reading current and the mAh is increasing when putting the batterie with no throttle. The increase seems to be the same with no relation with flying or not… You linear method doesn’t resolve this problem. Any idea? Thanks

Reply
Oscar 20th August 2018 - 6:17 pm

Please join our forum for further troubleshoot:
IntoFPV.com

Reply
Esy 28th May 2018 - 12:13 am

Man you cover all topics in quad universe!:D love it <3

Reply
Abutalib 22nd May 2018 - 2:20 am

Hi
I got a pdb equipped with this function but I don’t want to use it. If I didn’t wire the current sensor terminal would this affect the other wirings ?
Thanks

Reply
Oscar 22nd May 2018 - 3:44 pm

no, it won’t affect anything, you can just leave it if you don’t want to use it.

Reply
abutalib 23rd May 2018 - 4:18 am

appreciated, thanks the informative blogs.

Reply
Peter Takacs 11th May 2018 - 7:18 am

Dear Oscar,

I think, the correct formula is:
old_scale : OSD_mAh_consumed = new_scale : mAh_charged
old_scale x mAh_charged = new_scale x OSD_mAh_consumed
new_scale = old_scale x (mAh_charged / OSD_mAh_consumed )

Peter

Reply
blub 31st May 2018 - 2:43 am

This formula can’t be correct, at least not with Betaflight.
If the current measurement is too high, you have to increase the scale value. Using this formula would decrease the scale. The example by Oscar shows it the right way.

My guess is, that this is different to Cleanflight. Their documentation shows your formula as correct.

Reply
Brandon Hill 31st December 2018 - 11:47 am

I agree, Peter. The correct formula is scale x actual mAh / estimated mAh.

Reply
bragee 13th March 2018 - 11:48 am

/QUOTE
• Fly a fully charged LiPo pack and land when “mAh consumed” reaches a whole number, for example 1000mah or 1200mah or 1400mah…
/UNQUOTE

Dear Oscar,
do you think is really necessary to land the quad when a whole number is reached?
In theory, since I know the total mAh capacity of the battery, any value is good for calculation… eithe 998 consumed mAh, 655, 1247 etc..
It’s all a matter of calculations no? I’m I somehow wrong?

Thanks a lot for your clear and exhaustive article and forgive me if my question is silly…
Best regards,
bragee

Reply
Benoit PAILLARD 5th February 2018 - 8:57 pm

Oscar,
Thanks for your very usefull knowledge sharing blog. In fact, I could calibrate precisely the Typhoon32 4 in 1 4 X 35A ESC connected to the OMNIBUS PRO F4 V5. With the soft method I obtained 230 to put on the Betaflight onboard current sensor tab..

Best reguards

Benoit

Reply
Brenden 17th January 2018 - 6:21 pm

my current sensor readout is backwards, how do i fix it?

Reply
ViES 16th September 2017 - 12:32 am

By the way, for Matek FCHUB-6S the scale value specified in documentation. mateksys.com/?portfolio=fchub-6s

Reply
Steven 1st September 2017 - 1:39 am

Okay I have wraith esc they have current sensing and matek fchub 6 w current sensing and f7 can I connect my swift w osd to flight controller because it has filtering for camera or do I have to connect to pdb to use current sensing capabilities?
Thank you,
Steven

Reply