Skip to content

Commit 47dea57

Browse files
committed
Minor improvements
1 parent 58e8bb7 commit 47dea57

16 files changed

+653
-433
lines changed

README.md

Lines changed: 115 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# [SMB](https://github.com/ArminJo/Smart-Battery-Module-Info_For_Arduino) - Smart Battery Module (Laptop Battery Pack) Info
2-
### Version 3.1.1
2+
### Version 4.0.0
33
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
44
[![Build Status](https://github.com/ArminJo/Smart-Battery-Module-Info_For_Arduino/workflows/TestCompile/badge.svg)](https://github.com/ArminJo/Smart-Battery-Module-Info_For_Arduino/actions)
55
[![Hit Counter](https://hitcounter.pythonanywhere.com/count/tag.svg?url=https%3A%2F%2Fgithub.com%2FArminJo%2FSmart-Battery-Module-Info_For_Arduino)](https://github.com/brentvollebregt/hit-counter)
@@ -9,12 +9,12 @@ Prints SBM controller info
99
Based on https://github.com/PowerCartel/PackProbe from Power Cartel http://powercartel.com/projects/packprobe/.
1010

1111
# Disclaimer
12-
**I do not know how to enter full access mode, clear permanent filure or unlock any controller IC.** Unfortunally according to most datasheets, you need an unlock key.
12+
**I do not know how to enter full access mode, clear permanent failure or unlock any controller IC.** Unfortunally according to most datasheets, you need an unlock key.
1313
See also this [article from 2011](https://media.blackhat.com/bh-us-11/Miller/BH_US_11_Miller_Battery_Firmware_Public_WP.pdf).
1414
Extract: *Macbook batteries ship with a default unseal password (0x36720414). This was found by reverse engineering a Macbook battery update. On Macbook batteries, the full access mode password is also hardcoded and default (0xffffffff).*
1515

1616
## Compile with the Arduino IDE
17-
Download and extract the repository. In the Arduino IDE open the sketch with File -> Open... and select the src/SBMInfo folder.
17+
Download and extract the repository. In the Arduino IDE open the sketch with File -> Open... and select the SBMInfo folder.
1818

1919
## Identifying the right connection
2020
The minimal connector layout is: | GROUND | THERMISTOR (103AT) | CLOCK | DATA | VCC (11 or 14 volt) | (clock and data my be switched).
@@ -32,25 +32,52 @@ Examples:
3232
| GROUND | BatteryPresent | THERMISTOR ? | CLOCK | DATA | VCC | - seen at HP packs.
3333
| GROUND | GROUND | Alert ? | HostPresent | BatteryPresent | DATA | CLOCK | VCC | VCC | - seen at Dell packs.
3434

35-
After startup, the program scans for a connected I2C device.
36-
You can try different pin combinations until led stops blinking and `Found I2C device attached at address: 0x0B` is printed.
37-
If you connect clock or data with the thermistor connector, the scanning stops.<br/>
35+
After startup, the program scans for a connected I2C device.<br/>
36+
In version 4.0 a voltage and resistance measurement by means of 4 additional resistors is integrated **to identify the I2C pins**.
37+
It measures voltage or resistance to ground (if voltage is zero).<br/>
38+
**The I2c pins have around 300 kOhm to 1000 kOhm**, the thermistor 10 kOhm.
39+
40+
You can try different I2C pin combinations until led stops blinking and `Found I2C device attached at address: 0x0B` is printed.
41+
If you connect clock or data with the thermistor connector or ground, the scanning stops.<br/>
3842
After connecting, full data is printed.<br/>
3943
Dynamic values like temperature, voltage and current are checked every 3 seconds and printed if changed.
4044

4145
Tested with bq20z70, bq20z451, bq2084, bq80201DBT, bq40z50.
4246

4347
An example schematic for a SBM module can be found in the datasheet of TI bq29311 at page 9.
4448

45-
![My setup](https://github.com/ArminJo/Smart-Battery-Module-Info_For_Arduino/blob/master/extras/Breadboard.jpg)
49+
![Simple breadboard setup](pictures/Breadboard.jpg)
50+
51+
# LCD display content
52+
### LCD Display before device connected
53+
1. line: "SBMInfo" | Version | VCC voltage
54+
2. line: Date of program compilation
55+
3. line: "Scan for device" | Scan counter
56+
4. line: Resistance or Voltage
57+
58+
### LCD Display after device connected
59+
1. line: "SBMInfo" | Version
60+
2. line: Date of program compilation | Manufacturer name
61+
3. line: Manufacturer date (YYYY-MM-DD) | Battery cycle count
62+
4. line: Design voltage | Design capacity
63+
64+
### LCD Display dynamic data
65+
1. line: Voltage | Current (negative for discharging) | optional 'H' for read error (hold)
66+
2. line: Percent of designed full charge capacity | Design capacity -> Full charge capacity
67+
3. line: Percent of relative charge
68+
3. line: Time to empty of full at current current (of line 1)
69+
4. line: Currently available (remaining) capacity
4670

47-
![My setup](https://github.com/ArminJo/Smart-Battery-Module-Info_For_Arduino/blob/master/extras/With_LCD.jpg)
71+
| Dynamic data | Dynamic data while discharging |
72+
|-|-|
73+
| ![LCD start](pictures/LCDDisplay_DynamicData.jpg) | ![Dynamic data discharging](pictures/LCDDisplay_DynamicData_Discharging.jpg) |
4874

4975
## German Documentation
5076
Gibt die Daten des SMB Controllers aus.
5177
Basiert auf https://github.com/PowerCartel/PackProbe von Power Cartel http://powercartel.com/projects/packprobe/. Hier gibt es auch weitere wertvolle Informationen.
5278

5379
## Finden der Anschlüsse.
80+
In der Version 4.0 ist eine Spannungs und Widerstandsmessung mittels 4 Widerständen integriert, um die I2C Pins zu identifizieren.
5481
Die Clock und Data Eingänge waren bei meinen Packs die Anschlüsse mit einem Widerstand von ca. 300 k bis 1 MOhm nach Masse.
5582
Nach dem Booten sucht das Programm nach einem angeschlossenen I2C Device.
5683
Man kann also alle möglichen Pinkombinationen von Clock und Data am Battery Pack ausprobieren.
@@ -71,89 +98,104 @@ Tested with bq20z70, bq20z451, bq2084, bq80201DBT, bq40z50.
7198

7299
Einen Schaltplan zu den Batterie Modulen gibt es im Datenblatt zum TI bq29311 auf Seite 9.
73100

74-
###Sample output:
75-
Sample outputs can be found in folder extras.
101+
### Sample output:
102+
Sample outputs can be found in folder [extras](https://github.com/ArminJo/Smart-Battery-Module-Info_For_Arduino/tree/master/extras).
76103

77104
```
78105
START ../src/SBMInfo.cpp
79-
Version 2.1 from Oct 27 2018
80-
I2C initalized successfully
106+
Version 4.0 from Oct 12 2021
107+
No LiPo supply detected -> fast display timing
81108
Found attached I2C device at 0xB
82109
83-
*** STATIC INFO ***
84-
Chemistry: LION
85-
Manufacturer Name: GW
86-
Manufacturer Data: †A;0ÿ  È ¬& - 0x86 41 3B 30 FF 1E 0 11 0 C8 0 AC 26
87-
Device Name: DELL 0
88-
Serial Number: 46
89-
Manufacture Date (YYYY-MM-DD): 2012-9-12
90-
Design Capacity: 6600 mAh
91-
Design Voltage: 11.100 V
92-
Charging Current: 4100 mA
93-
Charging Voltage: 12.600 V
94-
Specification Info: 33
95-
Cycle Count: 39
96-
Max Error of charge calculation (%): 8
97-
RemainingTimeAlarm: 10 min
98-
Remaining Capacity Alarm: 660 mAh
99-
Battery Mode (BIN): 0b110000000000000
100-
- Battery OK
101-
- Disable AlarmWarning broadcast to Host and Smart Battery Charger
102-
- Disable broadcasts of ChargingVoltage and ChargingCurrent to Smart Battery Charger
103-
Pack Status (BIN): 0b1000011010010000
110+
Battery mode (BIN) 0b110000010000001
111+
- Internal Charge Controller Supported
112+
- Battery OK
113+
- Disable AlarmWarning broadcast to Host and Smart Battery Charger
114+
- Disable broadcasts of ChargingVoltage and ChargingCurrent to Smart Battery Charger
115+
116+
Manufacturer Name DP-SDI51
117+
Chemistry LION
118+
Manufacturer Data 0x6 7D B B1 67 14 96 D 0 C8 0 A9 2A
119+
Device Name DAVOS
120+
Serial number 55982 | 0xDAAE
121+
Manufacture date (YYYY-MM-DD) 2008-5-25
122+
Design voltage 10.800 V
123+
Design capacity 5100 mAh
124+
Charging current 3570 mA
125+
Charging voltage 12.600 V
126+
Specification info 33 | 0x21
127+
Cycle count 277
128+
129+
Max error of charge calculation 100%
130+
Remaining time alarm 10 min
131+
Remaining capacity alarm 510 mAh
132+
Pack status (BIN) 0b11010110000
104133
105134
*** MANUFACTURER INFO ***
106-
Device Type: 2084 / 0x824
107-
Controller IC identified by device type: bq2084
108-
End of Discharge Voltage Level: 9.900 V
109-
110-
Firmware Version: 1.50
111-
Manufacturer Status (BIN): 0b0
112-
- FET Status 0
113-
- State: 0b0
135+
Device Type: 0 | 0x0
114136
115137
*** RATE TEST INFO ***
116-
Setting AT rate to 100 mA
117-
TimeToFull at rate: 265 min
118-
Setting AT rate to -100 mA
119-
TimeToEmpty at rate: 3061 min
120-
Can be delivered for 10 seconds at rate: 1
138+
Setting AT rate to 100 mA
139+
TimeToFull at rate Battery not being (dis)charged - received 0xFFFF
140+
Setting AT rate to -100 mA
141+
TimeToEmpty at rate 21 h 28 min
142+
Can be delivered for 10 seconds at rate: 1 | 0x1
121143
122144
*** DYNAMIC INFO ***
123-
Full Charge Capacity: 5545 mAh
124-
Remaining Capacity: 5102 mAh
125-
Relative Charge(%): 92
126-
Absolute Charge(%): 77
127-
Minutes remaining until empty: 2915 min
128-
Average minutes remaining until empty: 2943 min
129-
Minutes remaining for full charge: Battery not beeing (dis)charged
130-
Battery Status (BIN): 0b11000000
131-
- Initialized
132-
- Discharging
133-
Voltage: 12.212 V
134-
Current: -105 mA
135-
Average Current of last minute: -104 mA
136-
Temperature: 25.95 C
145+
Full charge capacity 4215 mAh = 82%
146+
Remaining capacity 2148 mAh
147+
Relative charge 51%
148+
Absolute charge 42%
149+
Voltage 11.467 V
150+
Current 0 mA
151+
Average current of last minute 0 mA
152+
Temperature 21.55 C
153+
Minutes remaining until empty Battery not being (dis)charged - received 0xFFFF
154+
Average minutes remaining until empty: Battery not being (dis)charged - received 0xFFFF
155+
Minutes remaining for full charge Battery not being (dis)charged - received 0xFFFF
156+
Battery status (BIN) 0b11000000
157+
80 Initialized
158+
40 Discharging
159+
137160
138161
*** DYNAMIC NON STANDARD INFO ***
139-
Cell 1 Voltage: 4.074 V
140-
Cell 2 Voltage: 4.070 V
141-
Cell 3 Voltage: 4.068 V
142-
Cell 4 Voltage: 0.000 V
143-
State of Health: 0
162+
Cell 1 Voltage: 3.826 V
163+
Cell 2 Voltage: 3.823 V
164+
Cell 3 Voltage: 3.819 V
165+
Cell 4 Voltage: 0.000 V
144166
145167
*** CHANGED VALUES ***
146-
Remaining Capacity: 5101 mAh
147-
Minutes remaining until empty: 2914 min
148-
Average minutes remaining until empty: 2942 min
149-
Average minutes remaining until empty: 2914 min
150-
Voltage: 12.209 V
151-
Remaining Capacity: 5099 mAh
152-
Minutes remaining until empty: 2913 min
153-
Average minutes remaining until empty: 2913 min
168+
169+
--- Next values are from another Pack! I connected 22 Ohm Resistor -> 699 mA discharging
170+
171+
Voltage 15.788 V
172+
Average current of last minute -187 mA
173+
Average minutes remaining until empty: 15 h 24 min
174+
Cell 4 Voltage: 3.935 V
175+
Voltage 15.807 V
176+
Average current of last minute -120 mA
177+
Average minutes remaining until empty: 24 h 1 min
178+
Cell 4 Voltage: 3.949 V
179+
Average current of last minute -77 mA
180+
Average minutes remaining until empty: 37 h 25 min
181+
Voltage 15.714 V
182+
Current -699 mA
183+
Average current of last minute -178 mA
184+
Minutes remaining until empty 4 h 7 min
185+
Average minutes remaining until empty: 16 h 11 min
154186
```
155187

188+
### Fritzing board
189+
![Fritzing board](extras/SBMInfo_Steckplatine.png)
190+
### Fritzing schematics
191+
![Fritzing schematics](extras/SBMInfo_Schaltplan.png)
192+
156193
# Revision History
194+
### Version 4.0.0
195+
- Integrated voltage and resistance measurement.
196+
- Major improvements in I2C communication and output.
197+
- Detection of disconnect.
198+
157199
### Version 3.1.1
158200
- Better prints at scanning.
159201

0 commit comments

Comments
 (0)