Commit 9b3c0d52 authored by Armin's avatar Armin
Browse files

Version 1.1

parent bfe25c59
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<listOptionValue builtIn="false" value="E:/Elektro/arduino/hardware/arduino/avr/variants/standard"/> <listOptionValue builtIn="false" value="E:/Elektro/arduino/hardware/arduino/avr/variants/standard"/>
<listOptionValue builtIn="false" value="E:/Elektro/arduino/hardware/arduino/avr/cores/arduino"/> <listOptionValue builtIn="false" value="E:/Elektro/arduino/hardware/arduino/avr/cores/arduino"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/lib/SoftI2CMaster}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/lib}&quot;"/>
</option> </option>
<option id="de.innot.avreclipse.cppcompiler.option.def.1867196469" name="Define Syms (-D)" superClass="de.innot.avreclipse.cppcompiler.option.def"/> <option id="de.innot.avreclipse.cppcompiler.option.def.1867196469" name="Define Syms (-D)" superClass="de.innot.avreclipse.cppcompiler.option.def"/>
<option id="de.innot.avreclipse.cppcompiler.option.optimize.other.247153119" name="Other Optimization Flags" superClass="de.innot.avreclipse.cppcompiler.option.optimize.other" value="-ffunction-sections -fdata-sections" valueType="string"/> <option id="de.innot.avreclipse.cppcompiler.option.optimize.other.247153119" name="Other Optimization Flags" superClass="de.innot.avreclipse.cppcompiler.option.optimize.other" value="-ffunction-sections -fdata-sections" valueType="string"/>
...@@ -96,4 +96,5 @@ ...@@ -96,4 +96,5 @@
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="de.innot.avreclipse.core.AVRGCCManagedMakePerProjectProfileCPP"/> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="de.innot.avreclipse.core.AVRGCCManagedMakePerProjectProfileCPP"/>
</scannerConfigBuildInfo> </scannerConfigBuildInfo>
</storageModule> </storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject> </cproject>
...@@ -25,11 +25,4 @@ ...@@ -25,11 +25,4 @@
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>de.innot.avreclipse.core.avrnature</nature> <nature>de.innot.avreclipse.core.avrnature</nature>
</natures> </natures>
<linkedResources>
<link>
<name>src/lib/SoftI2CMaster</name>
<type>2</type>
<location>E:/WORKSPACE_ARDUINO/lib/SoftI2CMaster</location>
</link>
</linkedResources>
</projectDescription> </projectDescription>
# SMB - Smart Battery Module (Laptop Battery Pack) Info # SMB - Smart Battery Module (Laptop Battery Pack) Info
Gibt die Daten des SMB Controllers aus. Prints SBM controller info
Basiert auf https://github.com/PowerCartel/PackProbe von Power Cartel http://powercartel.com/projects/packprobe/. Hier gibt es auch weitere wertvolle Informationen. Based on https://github.com/PowerCartel/PackProbe from Power Cartel http://powercartel.com/projects/packprobe/.
Needs SoftI2CMaster library for I2C / SMBus / https://github.com/felias-fogg/SoftI2CMaster/archive/master.zip
## Identifying the right connection
After startup, the program scans for a connected I2C device.
Just try different pin combinations until led stops blinking and "Found I2C device attached at address: 0x0B" is printed.
After connecting full data is printed.
Dynamic values is checked every 3 seconds and printed if changed.
Tested with bq20z70, bq20z451, bq2084, bq80201DBT, bq40z50.
## German Documentation
Gibt die Daten des SMB Controllers aus.
Basiert auf https://github.com/PowerCartel/PackProbe von Power Cartel http://powercartel.com/projects/packprobe/. Hier gibt es auch weitere wertvolle Informationen.
Bentigt SoftI2CMaster Library fr I2C / SMBus / https://github.com/felias-fogg/SoftI2CMaster/archive/master.zip Bentigt SoftI2CMaster Library fr I2C / SMBus / https://github.com/felias-fogg/SoftI2CMaster/archive/master.zip
## Finden der Anschlsse. ## Finden der Anschlsse.
Nach dem Booten sucht das Programm nach einem angeschlossenen I2C Device. Nach dem Booten sucht das Programm nach einem angeschlossenen I2C Device.
Man kann also alle mglichen Pinkombinationen von Clock und Data am Battery Pack ausprobieren. Man kann also alle mglichen Pinkombinationen von Clock und Data am Battery Pack ausprobieren.
Bei der Richtigen hrt das Blinken der Led auf und es kommt sofort die Ausgabe "Found I2C device attached at address: ox0B" und direkt danach werden die Daten ausgegeben. Bei der Richtigen hrt das Blinken der Led auf und es kommt sofort die Ausgabe "Found I2C device attached at address: 0x0B" und direkt danach werden die Daten ausgegeben.
Bei den Laptop Battery Packs war Plus und Masse immer auen. Bei den Laptop Battery Packs war Plus und Masse immer auen.
Wenn mehr als 5 Kontakte vorhanden waren, waren sie wie folgt belegt: Wenn mehr als 5 Kontakte vorhanden waren, waren sie wie folgt belegt:
...@@ -29,66 +42,84 @@ Einen Schaltplan zu den Batterie Modulen gibt es im Datenblatt zum TI bq29311 au ...@@ -29,66 +42,84 @@ Einen Schaltplan zu den Batterie Modulen gibt es im Datenblatt zum TI bq29311 au
![Breadboard](https://github.com/ArminJo/Smart-Battery-Module-Info_For_Arduino/blob/master/img/Breadboard.jpg) ![Breadboard](https://github.com/ArminJo/Smart-Battery-Module-Info_For_Arduino/blob/master/img/Breadboard.jpg)
###Beispieloutput: ###Sample output:
Sample outputs can be found in folder extras.
```
START ../src/SBMInfo.cpp
Version 1.1 from Jul 25 2018
I2C initalized sucessfully I2C initalized sucessfully
Found attached I2C device at 0xB Found attached I2C device at 0xB
*** STATIC INFO *** *** STATIC INFO ***
```
Chemistry: LION Chemistry: LION
Manufacturer Name: DP Manufacturer Name: GW
Manufacturer Data:   K24005SDI  Manufacturer Data: A;0  & - 0x86 41 3B 30 FF 1E 0 11 0 C8 0 AC 26
Device Name: bq20z451 Device Name: DELL 0
Serial Number: 11518 Serial Number: 46
Manufacture Date (YYYY-MM-DD): 2009-8-27 Manufacture Date (YYYY-MM-DD): 2012-9-12
Design Capacity (mAh): 5450 Design Capacity: 6600 mAh
Design Voltage: 10.950 Design Voltage: 11.100 V
Specification Info: 49 Charging Current: 4100 mA
Cycle Count: 255 Charging Voltage: 12.600 V
Max Error of charge calculation (%): 1 Specification Info: 33
RemainingTimeAlarm (min): 10 Cycle Count: 39
Remaining Capacity Alarm: 300 Max Error of charge calculation (%): 8
Battery Mode (BIN): 0b110000000000001 RemainingTimeAlarm: 10 min
- Internal Charge Controller Supported Remaining Capacity Alarm: 660 mAh
Battery Mode (BIN): 0b110000000000000
- Battery OK - Battery OK
- Disable AlarmWarning broadcast to Host and Smart Battery Charger - Disable AlarmWarning broadcast to Host and Smart Battery Charger
- Disable broadcasts of ChargingVoltage and ChargingCurrent to Smart Battery Charger - Disable broadcasts of ChargingVoltage and ChargingCurrent to Smart Battery Charger
Pack Status (BIN): 0b1000011010010000
*** MANUFACTURER INFO *** *** MANUFACTURER INFO ***
ManufacturerAccess: 304 / 0x130 Device Type: 2084 / 0x824
Device Type: 1105 / 0x451 Controller IC identified by device type: bq2084
Hardware Version: 0xA6 End of Discharge Voltage Level: 9.900 V
Firmware Version: 0.3
Manufacturer Status (BIN): 0b10001111 Firmware Version: 1.50
- FET Status 2 Manufacturer Status (BIN): 0b0
- State: 0b1111 - FET Status 0
Battery Pack removed - State: 0b0
*** TEST INFO *** *** RATE TEST INFO ***
Average Current (mA): 1 Setting AT rate to 100 mAh
AtRateTimeToFull: 65535 TimeToFull at rate: 265 min
AtRateTimeToEmpty: 65535 Setting AT rate to -100 mAh
AtRateOK: 1 TimeToEmpty at rate: 3061 min
Can be delivered for 10 seconds at rate: 1
*** DYNAMIC INFO *** *** DYNAMIC INFO ***
Full Charge Capacity (mAh): 2845 Full Charge Capacity: 5545 mAh
Remaining Capacity (mAh): 2720 Remaining Capacity: 5102 mAh
Relative Charge(%): 96 Relative Charge(%): 92
Absolute Charge(%): 50 Absolute Charge(%): 77
Minutes remaining for full charge: 7500 Minutes remaining until empty: 2915 min
Battery Status (BIN): 0b100100011100000 Average minutes remaining until empty: 2943 min
- TERMINATE_CHARGE_ALARM Minutes remaining for full charge: Battery not beeing (dis)charged
- TERMINATE_DISCHARGE_ALARM Battery Status (BIN): 0b11000000
- Initialized - Initialized
- Discharging - Discharging
- Fully Charged Voltage: 12.212 V
Voltage: 12.253 Current: -105 mA
Current (mA): 0 Average Current of last minute: -104 mA
Temperature (C): 24.85 Temperature: 25.95 C
State of Health: 4084
Cell 1 Voltage: 4.084 *** DYNAMIC NON STANDARD INFO ***
Cell 2 Voltage: 4.085 Cell 1 Voltage: 4.074 V
Cell 3 Voltage: 4.084 Cell 2 Voltage: 4.070 V
Cell 3 Voltage: 4.068 V
Cell 4 Voltage: 0.000 V
State of Health: 0
*** CHANGED VALUES *** *** CHANGED VALUES ***
Remaining Capacity: 5101 mAh
Minutes remaining until empty: 2914 min
Average minutes remaining until empty: 2942 min
Average minutes remaining until empty: 2914 min
Voltage: 12.209 V
Remaining Capacity: 5099 mAh
Minutes remaining until empty: 2913 min
Average minutes remaining until empty: 2913 min
``` ```
START ../src/SBMInfo.cpp
Version 1.1 from Jul 25 2018
I2C initalized sucessfully
Found attached I2C device at 0xB
*** STATIC INFO ***
Chemistry: LION
Manufacturer Name: GW
Manufacturer Data: A;0  & - 0x86 41 3B 30 FF 1E 0 11 0 C8 0 AC 26
Device Name: DELL 0
Serial Number: 46
Manufacture Date (YYYY-MM-DD): 2012-9-12
Design Capacity: 6600 mAh
Design Voltage: 11.100 V
Charging Current: 4100 mA
Charging Voltage: 12.600 V
Specification Info: 33
Cycle Count: 39
Max Error of charge calculation (%): 8
RemainingTimeAlarm: 10 min
Remaining Capacity Alarm: 660 mAh
Battery Mode (BIN): 0b110000000000000
- Battery OK
- Disable AlarmWarning broadcast to Host and Smart Battery Charger
- Disable broadcasts of ChargingVoltage and ChargingCurrent to Smart Battery Charger
Pack Status (BIN): 0b1000011010010000
*** MANUFACTURER INFO ***
Device Type: 2084 / 0x824
Controller IC identified by device type: bq2084
End of Discharge Voltage Level: 9.900 V
Firmware Version: 1.50
Manufacturer Status (BIN): 0b0
- FET Status 0
- State: 0b0
*** RATE TEST INFO ***
Setting AT rate to 100 mAh
TimeToFull at rate: 265 min
Setting AT rate to -100 mAh
TimeToEmpty at rate: 3061 min
Can be delivered for 10 seconds at rate: 1
*** DYNAMIC INFO ***
Full Charge Capacity: 5545 mAh
Remaining Capacity: 5102 mAh
Relative Charge(%): 92
Absolute Charge(%): 77
Minutes remaining until empty: 2915 min
Average minutes remaining until empty: 2943 min
Minutes remaining for full charge: Battery not beeing (dis)charged
Battery Status (BIN): 0b11000000
- Initialized
- Discharging
Voltage: 12.212 V
Current: -105 mA
Average Current of last minute: -104 mA
Temperature: 25.95 C
*** DYNAMIC NON STANDARD INFO ***
Cell 1 Voltage: 4.074 V
Cell 2 Voltage: 4.070 V
Cell 3 Voltage: 4.068 V
Cell 4 Voltage: 0.000 V
State of Health: 0
*** CHANGED VALUES ***
Remaining Capacity: 5101 mAh
Minutes remaining until empty: 2914 min
Average minutes remaining until empty: 2942 min
Average minutes remaining until empty: 2914 min
Voltage: 12.209 V
Remaining Capacity: 5099 mAh
Minutes remaining until empty: 2913 min
Average minutes remaining until empty: 2913 min
START ../src/SBMInfo.cpp
Version 1.1 from Jul 25 2018
I2C initalized sucessfully
Found attached I2C device at 0xB
*** STATIC INFO ***
Chemistry: LION
Manufacturer Name: DP-SDI51
Manufacturer Data: ] 1g 9 - 0x83 5D B 31 67 14 96 11 0 C8 0 1A 39
Device Name: Vail
Serial Number: 24156
Manufacture Date (YYYY-MM-DD): 2008-2-2
Design Capacity: 5100 mAh
Design Voltage: 14.400 V
Charging Current: 100 mA
Charging Voltage: 16.800 V
Specification Info: 33
Cycle Count: 195
Max Error of charge calculation (%): 2
RemainingTimeAlarm: 10 min
Remaining Capacity Alarm: 510 mAh
Battery Mode (BIN): 0b100000001
- Internal Charge Controller Supported
- Battery OK
- Charge Controller Enabled
Pack Status (BIN): 0b1000001110110000
*** MANUFACTURER INFO ***
Device Type: 2084 / 0x824
Controller IC identified by device type: bq2084
End of Discharge Voltage Level: 14.618 V
Firmware Version: 1.43
Manufacturer Status (BIN): 0b0
- FET Status 0
- State: 0b0
*** RATE TEST INFO ***
Setting AT rate to 100 mAh
TimeToFull at rate: 26 min
Setting AT rate to -100 mAh
TimeToEmpty at rate: 1953 min
Can be delivered for 10 seconds at rate: 1
*** DYNAMIC INFO ***
Full Charge Capacity: 3299 mAh
Remaining Capacity: 3255 mAh
Relative Charge(%): 99
Absolute Charge(%): 64
Minutes remaining until empty: Battery not beeing (dis)charged
Average minutes remaining until empty: Battery not beeing (dis)charged
Minutes remaining for full charge: Battery not beeing (dis)charged
Battery Status (BIN): 0b100000011100000
- TERMINATE_CHARGE_ALARM
- Initialized
- Discharging
- Fully Charged
Voltage: 16.638 V
Current: 0 mA
Average Current of last minute: 0 mA
Temperature: 27.15 C
*** DYNAMIC NON STANDARD INFO ***
Cell 1 Voltage: 4.165 V
Cell 2 Voltage: 4.155 V
Cell 3 Voltage: 4.159 V
Cell 4 Voltage: 4.160 V
State of Health: 4160
*** CHANGED VALUES ***
This diff is collapsed.
...@@ -12,49 +12,56 @@ ...@@ -12,49 +12,56 @@
#define SBM_DEVICE_ADDRESS 0x0B #define SBM_DEVICE_ADDRESS 0x0B
// Standard and common non-standard Smart Battery commands // Standard and common non-standard Smart Battery commands
#define MANUFACTURER_ACCESS 0x00 // Manufacturer specific values #define MANUFACTURER_ACCESS 0x00 // r/w Manufacturer specific values
#define REMAINING_CAPACITY_ALARM 0x01 #define REMAINING_CAPACITY_ALARM 0x01 // r/w
#define REMAINING_TIME_ALARM 0x02 #define REMAINING_TIME_ALARM 0x02 // r/w
#define BATTERY_MODE 0x03 #define BATTERY_MODE 0x03 // r/w
#define AtRate 0x04
#define AtRateTimeToFull 0x05 #define AtRate 0x04 // r/w
#define AtRateTimeToEmpty 0x06 #define AtRateTimeToFull 0x05 // r
#define AtRateOK 0x07 #define AtRateTimeToEmpty 0x06 // r
#define AtRateOK 0x07 // r
#define TEMPERATURE 0x08 #define TEMPERATURE 0x08
#define VOLTAGE 0x09 #define VOLTAGE 0x09
#define CURRENT 0x0A #define CURRENT 0x0A
#define AverageCurrent 0x0B // of last minute #define AverageCurrent 0x0B // of last minute
#define MAX_ERROR 0x0C // of state of charge calculation -Byte #define MAX_ERROR 0x0C // Byte - of state of charge calculation
#define RELATIVE_SOC 0x0D // StateOfCharge -Byte #define RELATIVE_SOC 0x0D // Byte - StateOfCharge
#define ABSOLUTE_SOC 0x0E // -Byte #define ABSOLUTE_SOC 0x0E // Byte
#define REMAINING_CAPACITY 0x0F #define REMAINING_CAPACITY 0x0F
#define FULL_CHARGE_CAPACITY 0x10 #define FULL_CHARGE_CAPACITY 0x10
#define RUN_TIME_TO_EMPTY 0x11 #define RUN_TIME_TO_EMPTY 0x11
#define AVERAGE_TIME_TO_EMPTY 0x12 #define AVERAGE_TIME_TO_EMPTY 0x12
#define TIME_TO_FULL 0x13 #define TIME_TO_FULL 0x13
#define CHARGING_CURRENT 0x14 #define CHARGING_CURRENT 0x14 // r/w ?
#define CHARGING_VOLTAGE 0x15 #define CHARGING_VOLTAGE 0x15 // r/w ?
#define BATTERY_STATUS 0x16 #define BATTERY_STATUS 0x16 // r/w ?
#define CYCLE_COUNT 0x17 #define CYCLE_COUNT 0x17
#define DESIGN_CAPACITY 0x18 #define DESIGN_CAPACITY 0x18
#define DESIGN_VOLTAGE 0x19 #define DESIGN_VOLTAGE 0x19
#define SPEC_INFO 0x1A #define SPEC_INFO 0x1A
#define MFG_DATE 0x1B #define MFG_DATE 0x1B
#define SERIAL_NUM 0x1C #define SERIAL_NUM 0x1C
#define RESERVED_1 0x1D - 0x1F
#define MFG_NAME 0x20 // String #define MFG_NAME 0x20 // String
#define DEV_NAME 0x21 // String #define DEV_NAME 0x21 // String
#define CELL_CHEM 0x22 // String #define CELL_CHEM 0x22 // String
#define MFG_DATA 0x23 // String #define MANUFACTURER_DATA 0x23 // Data
#define RESERVED_2 0x25 - 0x2E
#define PACK_STATUS 0x2F // r/w Word - OptionalMfgFunction5
#define CELL4_VOLTAGE 0x3C // Individual cell voltages don't work on Lenovo and Dell Packs #define RESERVED_3 0x30 - 0x3B
#define CELL3_VOLTAGE 0x3D
#define CELL2_VOLTAGE 0x3E
#define CELL1_VOLTAGE 0x3F
#define STATE_OF_HEALTH 0x4F // in % -Byte #define CELL4_VOLTAGE 0x3C // r/w Word - OptionalMfgFunction4 - Individual cell voltages don't work on Lenovo and Dell Packs
#define CELL3_VOLTAGE 0x3D // r/w Word - OptionalMfgFunction3
#define CELL2_VOLTAGE 0x3E // r/w Word - OptionalMfgFunction2
#define CELL1_VOLTAGE 0x3F // r/w Word - OptionalMfgFunction1
#define STATE_OF_HEALTH 0x4F // in % Byte - = CELL1_VOLTAGE for bq2085
/* /*
* Bits of BatteryMode * Bits of BatteryMode
...@@ -65,6 +72,8 @@ ...@@ -65,6 +72,8 @@
#define ALARM_MODE 0x2000 #define ALARM_MODE 0x2000
#define CHARGER_MODE 0x4000 #define CHARGER_MODE 0x4000
#define CAPACITY_MODE 0x8000 #define CAPACITY_MODE 0x8000
const char StringCapacityModeCurrent[] = " mAh";
const char StringCapacityModePower[] = "0 mWh"; // 10mWh
/* /*
* Bits of BatteryStatus * Bits of BatteryStatus
...@@ -84,19 +93,21 @@ ...@@ -84,19 +93,21 @@
#define FULLY_DISCHARGED 0x0010 #define FULLY_DISCHARGED 0x0010
struct SBMFunctionDescriptionStruct { struct SBMFunctionDescriptionStruct {
uint8_t FunctionCode; uint8_t FunctionCode;
const char * Description; const char * Description;
uint16_t lastValue; void (*ValueFormatter)(struct SBMFunctionDescriptionStruct * aDescription, uint16_t aValueToFormat);
void (*ValueFormatter)(struct SBMFunctionDescriptionStruct * aDescription, uint16_t aValueToFormat); uint16_t lastValue;
}; };
/* /*
* TI few ManufacturerAccess Commands * TI few ManufacturerAccess Commands
*/ */
#define BQ20Z70_Device_Type 0x0001 #define TI_Device_Type 0x0001
#define BQ20Z70_Firmware_Version 0x0002 #define TI_Firmware_Version 0x0002
#define BQ20Z70_Hardware_Version 0x0003
#define BQ40Z50_Hardware_Version 0x0003
#define BQ20Z70_Hardware_Version 0x0003
#define BQ2084_EDV_level 0x0003 #define BQ2084_EDV_level 0x0003
#define BQ20Z70_Manufacturer_Status 0x0006 #define BQ20Z70_Manufacturer_Status 0x0006
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment