Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battery charging #10

Closed
charlespax opened this issue May 19, 2016 · 5 comments
Closed

Battery charging #10

charlespax opened this issue May 19, 2016 · 5 comments
Milestone

Comments

@charlespax
Copy link
Member

charlespax commented May 19, 2016

Implement a solid battery charging circuit. See http://community.paxinstruments.com/t/pax-instruments-labwiz/167

@charlespax
Copy link
Member Author

From stmdude:

Power.. Battery... I've been looking at the T400 schematic with regards to the battery and charging.
Now, before you read further, you need to know that I'm very paranoid and particular about the charging of lithium based batteries. 😉

To decide how (and if) you want to charge a LiPo cell, there are a few parameters one has to know:

  1. The maximum allowed charge-current for the cell
  2. The lowest cell voltage allowed for full-current charge
  3. The maximum allowed cell-voltage for the cell
  4. The current temperature of the cell

So, in the T400, the MCP73831 handles a lot of this (btw, you haven't specified which MCP73831 you are using in the schematic. Using the wrong one (I'm thinking of people copying the board, etc) can lead to over-charged cells, which is bad).

  1. Is set by the resistor on the PROG pin
  2. The MCP73831 uses a very safe value for this. Downside: Charging an over-discharged battery can take a while longer than it should/could
  3. This isn't handled. And, considering the nature of the device, it probably should.

So, if you read the datasheet for a LiPo battery, you'll find two temperatures. These specify the range where charging is permitted (typically from 0C -> 45C). Charging the battery when it's outside of these temperature-ranges can damage it.

So, my suggestion is: Since the battery itself doesn't have a thermistor in it, use the internal themometer in the STM to sense the temperature. Put a N-Channel MOSFET on the PROG pin of the MCP, which the STM32 can control. This allows you to terminate charging (floating PROG = disabled charging).

Also, I'm assuming you'll adopt the battery detect circuitry to the STM, and just feeding VBAT into an ADC channel (via a voltage divider, of course)? (With a FET to be able to get rid of the leakage, just like the T400 has)

Sorry for the rant..

@charlespax
Copy link
Member Author

I just ripped open a BL-5C battery. Here is the internal protection PCB.
d9d5010e75819f5cd54aacaf05dd2d8ac8dc04b4_1_690x266

It contains two ICs. One is marked DW01 z, which is a battery protection IC from Fortune Semiconductor. It is probably similar to this one. The 8205S is a 8205A dual NFET.
e5ca1a334d8c39f92ede216440cf8a37611c9e78
5120c79fcaea953de3724e96545adb41ccd7a21b_1_467x500

What do you think?

@charlespax
Copy link
Member Author

From stmdude:

It's a pretty basic (and adequate) protection circuit. One thing you should confirm though (you might have already done it) is to make sure that the MCP73831 actually tries to charge a little bit before trying to do a battery detect (VBAT > 0V). Otherwise, "4. Charge Detection after Overdischarge" won't work. I've been bitten by that one once before. (Not with the MCP chargers though, that was a BQ)

Still, some rudimentary temperature checks would be in order (considering that people might very well put an instrument like this in a temp-chamber)

@charlespax charlespax added this to the Milestone 2 milestone May 19, 2016
@charlespax
Copy link
Member Author

charlespax commented Jul 24, 2016

The Adafruit Feather boards could be a nice reference design for our battery charging system. It's fairly similar to the T400 as well. Adafruit has a series of Feather boards with different microcontrollers and various wireless options.

Below are the power and battery charging circuits for the various boards. Decoupling cap and other bits may be left out.

Adafruit-Feather-32u4-Basic-Proto-PCB
screen shot 2016-07-24 at 12 38 05
screen shot 2016-07-24 at 12 37 53

Adafruit-Feather-32u4-Bluefruit-LE-PCB
screen shot 2016-07-24 at 12 38 51
screen shot 2016-07-24 at 12 39 06

Adafruit-Feather-32u4-FONA-PCB
screen shot 2016-07-24 at 12 40 09
screen shot 2016-07-24 at 12 40 42

Adafruit-Feather-32u4-RFM-LoRa-PCB
screen shot 2016-07-24 at 12 42 03
screen shot 2016-07-24 at 12 41 58

Adafruit-Feather-ESP8266-HUZZAH-PCB
screen shot 2016-07-24 at 12 42 50
screen shot 2016-07-24 at 12 42 41

Adafruit-Feather-M0-Adalogger-PCB
screen shot 2016-07-24 at 12 43 31
screen shot 2016-07-24 at 12 43 23

Adafruit-Feather-M0-Basic-Proto-PCB
screen shot 2016-07-24 at 12 44 58
screen shot 2016-07-24 at 12 44 28

Adafruit-Feather-M0-Bluefruit-LE-PCB
screen shot 2016-07-24 at 12 46 30
screen shot 2016-07-24 at 12 45 58

Adafruit-Feather-M0-RFM-LoRa-PCB
screen shot 2016-07-24 at 12 47 09
screen shot 2016-07-24 at 12 47 28

Adafruit-Feather-M0-WiFi-WINC1500-PCB
screen shot 2016-07-24 at 12 48 17
screen shot 2016-07-24 at 12 48 36

Adafruit-WICED-WiFi-Feather-PCB
screen shot 2016-07-24 at 12 49 41
screen shot 2016-07-24 at 12 49 31

All Feather boards use the same MCP73831 battery charging circuit that we also use in the T400, so I think we should stick with that for the LabWiz board.
screen shot 2016-07-24 at 12 38 05

Each Feather board uses one of two LDO voltage regulators: SPX2319-3.3, AP2112-3.3.
screen shot 2016-07-24 at 12 49 31
screen shot 2016-07-24 at 12 43 23

@charlespax
Copy link
Member Author

Here is the voltage regulator and the battery charging circuit.
screen shot 2016-08-08 at 23 09 00
screen shot 2016-08-08 at 23 08 30

We still need to implement switching between battery power and USB power #37.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant