Wednesday, October 14, 2020

More about Airball probe v8 charging

Fancy aerospace R&D requires fancy instrumentation. No expenses spared. So you will be delighted to know that the Airball project has acquired a top-of-the-line Eversame USB Digital Power Meter (Amazon's Choice) instrument. Nothing but the best.

With the help of this device, and accounting for milliamps here and there, it seems that our charging circuit is "losing" maybe 20 mA somewhere, but otherwise, the current that gets soaked up by the running system plus the current dumped in to charge the battery more or less equals the 470 mA that we are drawing from USB, which makes sense given that we are a "USB500" device that promises only to draw 500 mA. So all is good on that front.

The next step is -- when I know that I am charging, I can put the ESP32 into a sleep mode to minimize the amount of current I'm drawing for stuff like Wi-Fi transmission. This should hopefully let me charge at a somewhat faster rate. It is probably possible to keep my TCP connections going and transmit battery status only, once a second or something, while in charge mode, but that's fancy. For now, I know I can accomplish what I want to accomplish.

But. There is always a "but", isn't there?

Remember how the circuit has this nice blue LED blinkenlight that blinkens when it's charging? In case you forgot, it's this one:


Ya well, so when the power switch is OFF, the TI BQ24075 chip does NOT charge the battery (weird, but mmkay, whatevs), however it also keeps the "charging" LED ON!

In other words, you plug your probe into USB with the power switch OFF; it tells you it is charging; you go to sleep and come back the next morning; and it has lied to you! It has not been charging the battery.

This is bad. Wrong feedback is strictly worse than no feedback. :P

So a very kind EE friend looked over the data sheet and my design, and confirmed that yes, the data sheet is SUPER misleading. According to their design, this behavior is "allowed". They even give you a sample design with a little "charging" LED just the way I've done it, and it's useless.

So basically I'm going to blow away the "charging" LED and instead use the signaling LED that I have access to from software. I will detect whether or not I'm charging, and based on that, blink the LED appropriately. And also do the sleep thing to save current.

Sunday, October 11, 2020

Airball probe v8 battery charging

To match the battery drain test, I timed a battery charge cycle starting from the completely discharged state. Here is what we have:

You can see that my charger is charging at 270 mA, no more no less. It takes about 12 hours to get to a full charge. Can we do better? Let's think this through --

  1. I am configuring the charger chip (a TI BQ24075) to draw at most 500 mA from the USB input. This is so that I am safely a "USB 500" device and am compatible with most computer USB ports and charger bricks.
  2. I am also configuring the chip to charge the battery at whatever current it can get away with, basically, given whatever the input provides.
  3. I am using a "power" switch connected to the SYSOFF signal on the BQ24075 to control whether the entire system is on or off. When SYSOFF indicates the system should be "off", but the USB input is connected, the BQ24075 powers up the whole system anyway. This means that, any time it is charging, regardless of the value of SYSOFF, the circuitry is operating and drawing the usual 180 mA.
  4. For 500 mA of input, we expect the maximum battery current to be (500 - 180) = 320 mA.
  5. We are getting 270 mA, which is (270 / 320) = 84% of the theoretical maximum.

Based on all this, it seems like the circuit is operating the way I asked it to, and indeed, because of the enormous size of my battery (3700 mAh), and the degree to which I am being "conservative" about the charging, I should not be surprised that it's taking 12 hours to charge.

So how would we "improve" this, today or in the future?

The reason I am "conservative" with the charging is that, as a hobby device, this thing will be connected to people's computers. If it draws too much power, the computer (or cheapy USB hub or whatever) will bump it off USB. This kills the ability to program the thing from the same USB port I'm using for charging, and also makes it hard for people to charge the thing simply by plugging it into their PC because they don't happen to have a power brick laying around at any given moment.

I could create two USB ports -- one for programming and one for charging. The programming port would draw zero current, and the charging port would not do any comms. But then I'd have to explain all this, and mess around.

Another way to think about it is this. I run at -180 mA and charge at +270 mA. Since (180 / 270) = 0.67, what this means is, for 1 hour of operation, you need 40 minutes of charging. Is that great? Is it a "fast charge" monster? Is it a consumer device for the ages? No. But ... does it work? Yes.

My inclination is to leave it as-is and call it a measured success.