Current Sensor Calibration in Betaflight

by Oscar

Having an accurate current sensor on your FPV drone allows you to determine how much battery is left and what the current draw the motors are drawing in real time. In this article I will show you how to calibrate current sensor in Betaflight.

banggood

Benefits of Current Sensor

If you have a current sensor, you can display “Battery current draw” and “Battery current mAh drawn” in OSD.

Knowing your “amp draw” and how much “mah” has been used can be extremely useful.

  • LiPo battery consumption (aka “Battery current mAh drawn”) tells you how much battery has been used. In my opinion, it’s just as a good battery indicator as voltage (VBAT), sometimes even more reliable because voltage can sag when you punch throttle
  • The real time current draw is a good indicator how power hungry your motor and propeller combo is, you can use this to test different combo. You can also use this to test how well different batteries handles voltage sag

Virtual Current Sensor

If you don’t have a physical current sensor in your flight controller or ESC, then you can try setting up a virtual current sensor. Virtual current sensor is a feature in Betaflight, current consumption is estimated by how much you move your throttle, therefore it’s not the most accurate in the world, but it might be good enough for some people.

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

How to Calibrate Current Sensor

Betaflight uses a simple equation to allow users to adjust/calibrate the current sensor output:

 y = ax + b

“a” is the scale, “b” is the offset. In most cases, offset is usually zero, and you only need to change scale.

There are a few different ways to calibrate current sensors.

Trial and Error

This is my “go-to” way of current sensor calibration, it’s not the fastest, but safe and doesn’t require additional equipment.

  • fly a fully charged battery
  • write down the “Battery current mAh drawn” that is displayed in your OSD after you landed (OSD_mAh_consumed)
  • fully charge the battery and see how much mAh is put back (mAh_charged)

Use this formula you can calculate the new current sensor scale:

new_scale = old_scale x (OSD_mAh_consumed / mAh_charged)

You might want to repeat this process some more times to ensure you have an accurate enough scale number.

Note that the current sensor 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:

  • Your current sensor scale is 400
  • You fly a fully charged battery and at the end of the flight (doesn’t matter what the voltage is), Betaflight OSD shows 1100mAh drawn
  • When you fully recharge the battery, the charger shows 1000mAh was put back into the battery
  • You can calculate the new scale value: New scale = 400 x (1100/1000) = 440
  • Now repeat this process until you are happy with the accuracy

Low Current Test Using Multimeter

Using the motor tab in Betaflight, you can spin the motors without props and get some current measurements from the flight controller (same as the value displayed in OSD). You only need 3 to 5 measurements below 5A, so it’s relatively safe to perform.

Betaflight 10.8.0 Motor Tab Spin Current Amp Draw

However you do need a multimeter and crocodile clip cables for this test. Also the amp draw readings tend to jump around quite a lot so it’s very hard to take precise measurements. That’s why I still prefer the trial and error method described above. Anyway I thought I’d mentioned it in case someone is interested.

Learn how to use multimeter to measure current here.

Take the current draw measurements from the FC and multimeter, then put them in this spreadsheet and it will return the offset and scale values: https://docs.google.com/spreadsheets/d/1lkL-X_FT9x2oqrwQEctDsEUhgdY19upNGc78M6FfJXY/edit#gid=0

Calibrate Current Sensor Fpv Drone Fc Esc Multimeter Amp Current Draw

If you have an adjustable bench power supply like the ToolkitRC P200, it’s even easier as you can read the current draw off the screen.

Calibrate Current Sensor Fpv Drone Fc Esc Power Supply Psu P200 Amp Current Draw

High Current Test Using Power Meter

This way can be much quicker to work out the scale and offset values for your current sensor. You need to strap your quad to the bench (with propellers mounted), attach a power meter (watt meter) to the quad (between the quad’s XT60 and the battery) so you can measure the actual current draw while running the motors.

Powering your drone on the bench with spinning propellers can be dangerous, do this at your own risk. You can make it safer by putting the opposite props on so they don’t push up but down.

Get a watt meter here:

You are going to notice there is small current draw even when the motors are idle, that’s normal because your FC, RX, ESC etc are all drawing a small amount of current. The current sensor on our FC/ESC isn’t super accurate when measuring small current. I’d normally ignore any difference in current draw when the motors are idle.

It’s more reliable to use the motor tab in Betaflight to spin up the motors as it doesn’t get affected by PID and the motor outputs and current draw are more stable. Increase throttle slowly, watch the current meter and 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 have 30A on the watt meter, but you get 35A in your OSD, then try to increase the scale by +50. If now you get 27A in the OSD, then you need to decrease scale a little. You can calculate how much you need to decrease exactly by using this equation: (27-35)/50 = -0.16A, this is how much change in amp draw for per increment in scale value.

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

And that’s it!

Voltage Sensor Calibration

You don’t normally need to calibrate the voltage sensor as it should be accurate out of the box.

Take a battery, check its voltage either using a battery checker or multimeter. Then plug it in to the drone.

If the reported voltage in the configurator (circle in red in below image) is far off from your measured voltage, then you should calibrate the voltage sensor.

Betaflight 4.3 Voltage CalibrationClick the calibration button, and enter the measured voltage, click Calibrate and it will ask to apply a new voltage scale. That’s it.

Betaflight 4.3 Voltage Calibration Measured Voltage

Edit History

  • Apr 2017 – tutorial created
  • Nov 2022 – updated post for Betaflight 4.3

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.

38 comments

shahar 15th November 2022 - 8:34 pm

Hi Oscar,
hope you ca help, since i upgraded from 4.2.9 to 4.3.1 – I get an un steady current measurement both for low and high currents, using speedbee V2 . Both the configurator and OSD show me an unstable current reading fluctuations.
seems to me betaflight doesn’t average the samples . Same setup was perfect in 4.2.9, any idea what happened?

Reply
Oscar 15th November 2022 - 10:06 pm

Make sure the current sensor pin from the ESC is actually matching the current sensor on the FC if you are using the ribbon cable.
Or it could just bad current sensor, it does happen to some ESC. In that case just calibrate it the best you can.

Reply
shahar 16th November 2022 - 7:53 pm

Hi
I am not using the ESC for current sense, I use the on board ADC with amp scale 168 as manufacturer recommend for speedybee F7 V2
it was working perfect in 4.2.9,looks like wrong hysteresis (averaging) setting…
any Idea?

Reply
Giuliano 9th November 2022 - 10:13 am

Hi Oscar, why don’t you also explain how to use the method with the spreadsheet that can be found here directly on the betaflight wiki?
You can find it here: https://docs.google.com/spreadsheets/d/1lkL-X_FT9x2oqrwQEctDsEUhgdY19upNGc78M6FfJXY/

Reply
Oscar 9th November 2022 - 12:31 pm

Personally I don’t like this method, the current value jumps a lot on both OSD and multimeter at low current draw (for example you may see 3.2A-3.7A, some current sensors jump even more than that), it’s really hard to take precise measurements.
Also not everyone has the needed equipment like multimeter or the necessary cables.
I still found it way more practical to just do the trial and error method.
But thanks for mentioning it i will add a link to the post just in case anyone is interested.

Reply
Gavin Percy 27th May 2022 - 2:10 pm

Hi Oscar

My current sensor is way off. In goggles it reported 545Mah used from a 1300Mah battery, at this point the voltage said land (3.5v per cell).

When I recharged the battery it said it put a full 1.30ah in.

100 is the scale in Betaflight currently.

I’ve used your formula, which in this case is 100 X (545/1300) which returns a result of 42. Should I set my new scale to 40??

Thanks

Gavin

Reply
Oscar 27th May 2022 - 5:31 pm

Give that a try, and check mah in OSD and compare that with the number from your charger?
It’s likely that you have to repeat this process 2-3 times until you get it right.

Reply
Jako 16th March 2022 - 1:46 am

Hello Oscar! Thanks for the article. Been calibrating my 7 inch for a while but I’m constantly rising the scale or lowering..never satisfied. But than I noticed, that until I don’t arm the quad, the amp stays on 0! But ofcourse it is consuming, vtx, camera, gps…So until I wait to get gps fix it should be let’s say 50 mah used or more, but it is 0. It is just a bug(bf 4.2) or should I play with the offset? Somethimes, at the end of flying, osd shows 3000 but in reality I used 3200, and sometimes(same scale) osd 3200, real mah=3000. Is this normal? It is a Mamba stack f405 mk3.

Reply
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