MightyWatt as a Li-Ion charger


MightyWatt electronic load can be used not only to test how a battery is discharged but it can also be used to charge the battery. In conjunction with a fixed-voltage power supply like a wall wart, MightyWatt can be turned into a USB programmable Li-Ion charger with CC/CV mode.
Typically, a Li-Ion battery is first charged by a constant current. When a certain voltage is reached, for example 4.2 V, the charger then keeps the voltage constant until the current drops below some pre-defined threshold. Then the charging process is considered finished.

You can use the MightyWatt in conjunction with a cheap fixed-voltage power supply to create such charger. By connecting MightyWatt in series with the battery and power supply, it will be possible to control the current (and voltage) while measuring voltage at the battery terminals. This is possible thanks to the differential voltmeter whose inputs can be at different potential than the power terminals.

Setting it up

First, be sure that you have a firmware version at least 2.5.1 and Windows control program or higher (get it here).

So, how to do it? First, make the connection (Figure 1): Connect the positive terminal of the battery to the positive terminal of your power supply. Connect the negative terminal of the battery to the positive power terminal (PWR+) of the MightyWatt. The negative power terminal (PWR-) is then connected to the power supply ground. This signal ground will be also the earth ground because the PWR- is connected to earth via USB.

Now, connect the positive sense terminal (SENS+) to the positive terminal of the battery and the negative sense terminal (SENS-) to the negative terminal of the battery. In this way, you will be able to measure the voltage of the battery while controlling the charging current.

Figure 1: Connection schematic to create a programmable CC/CV Li-Ion battery charger.

Let's set the control software correctly now (Figure 2). In this example, I will assume that the battery should be charged with 1 Amp to 4.2 V and then kept at 4.2 V until the current drops to 50 mA.
  1. Safety first: Set up the watchdog. If anything goes wrong, the load will disconnect the battery. I have set the watchdog to stop if current exceeds 1.5 A.
  2. Set the remote (4-wire) voltage sensing.
  3. Define the constant current part of the charging process. I put 1 A for 3 hours (the time limit won't be reached so put something long here). Then define the skip conditon. That means this part of the charging will be terminated when the condition is met. I chose that exceeding 4.2 V will make the program go to the next step.
  4. Define the constant voltage part. It is important to set "constant inverted phase voltage", I will talk about it later. In my example, I will keep 4.2 V for 3 hours (it will finish sooner so once again, put some long time here) and terminate this part when the current drops below 50 mA.
  5. If you wish, set up logging and/or save the program items for future use.
  6. Hit the Start button, you're ready to go!
Figure 2: Setting of a CC/CV mode for battery charger. Watchdog is enabled for safety.

What is the "constant inverted phase voltage" all about?


The second part of the charging process requires the voltage to be kept constant. However, it is not possible to directly use the hardware implemented constant voltage because it has an incorrect phase for this application. Normally, the constant voltage mode assumes that by increasing the current, the voltage will drop. This is normal behaviour of most sources. But look at this setup: increasing current to the battery will actually increase its voltage. It is the difference of power supply voltage and battery voltage that is in fact decreasing. But we want to measure (and control) the battery voltage, not the power supply that is actually loaded. 

So the feedback has to be modified to a system where increasing the current will increase the voltage. In other words, the transistor in MightyWatt must open when the voltage is too low and close when it is too high. This is not implemented in hardware so the firmware must be called to help. In the mode named "constant inverted phase voltage" the firmware (Arduino sketch) will internally switch the load to constant current mode and then increase it when the voltage is lower than the set voltage or decrease the current when the voltage is higher than the set value.

The bottom line


With the new firmware and software, you can turn your MightyWatt (+ cheap power supply) into a great USB programmable Li-Ion battery charger! Use the special "inverted phase voltage" mode to keep the voltage constant in this setup. If you don't have the latest firmware and software, download it from the resource page. Don't forget to copy your calibration values.


  1. Hi there, I was just wondering what board version is the MightyWatt with 4-wire configuration but uses three digital pins instead of four. I think it's r2.3 but I am not too sure.

    1. Starting revision 2, all the boards are 4-wire. Boards with three digital pins are 2, 2.1, 2.2 and 2.3. The revision number should be written on the board left from the input terminals (2–2.3) or between the power supply and analog connection to Arduino (2.4, 2.5). Do you need help with upgrading to the latest firmware? I think that all the revisions can be adapted to the new firmware.

    2. I have board revision 2 and firmware version 2.3.2. The code says the minimum board revision is 2.3; will it still work with revision 2?

    3. Hi Joseph,
      It should work, apart from two things:
      1) It won't work with Arduino Due so stick to Uno.
      2) There is no LED to indicate the flowing current. It was a small addition in the later revisions. So the new sketch has code that toggles pin 5. You can delete the portion of the code or just leave it there, it won't do anything.

      Tell me how you succeeded or if you need any more help with the upgrade.

  2. Hi Jakub,

    Thanks for that. I am just wondering also whether it is absolutely necessary to calibrate the device. Will results be completely inaccurate? Will I get a good estimate? Also, I can't exactly recall where you said this, is there a pin (I think an analog pin) that has to be grounded?



    1. Hi Yousif, it is not absolutely necessary to calibrate but it will probably be few percents off. With calibration, you can get to around 0.3 percent relative uncertainty. Any calibration is better than no calibration.

      When MightyWatt is connected to Arduino, it shares its ground with the one on Arduino. And Arduino is grounded via USB cable to PC, which is typically earthed. MightyWatt also connects ground to the negative power terminal (PWR-) so the PC ground and PWR- are connected. If you need floating ground, you will have to use galvanic isolator (take a look at ADuM4160) or run the PC (laptop) from a battery, without any additional ground connections.