lpollier / battmon

Battery monitor for Aibo
MIT License
19 stars 2 forks source link

BattMon 2.0

Monitors the characteristics of your battery equipped with the bq2040 gas gauge.

BattMon 2.0 is a toolkit that works with an Arduino Uno and a 2x16 LCD keypad shield to access parameters from a bq2040 gas gauge such as Voltage, Current, State of Charge, Temperature, Remaining Capacity or Cycle Count. This fuel gauge and other TI products like the bq2060, have been included in Lithium-ion battery pack, especially for the Sony Aibo ERS-2xx (ERA-201B1), ERS-3xx (ERA-301B1) and ERS-7 (ERA-7B1/ERA-7B2) robot series.

Connection

Here is an example of connection between a Sony Aibo ERA-201B1 battery pack and the assembly of the Arduino Uno + 2x16 LCD keypad shield. The pin closest to the edge is 1 and the one opposite is 6:

ERA-201B1 battery pack connection with BattMon 2.0 toolkit

The Arduino Uno is powered by the battery when pin 4 (/EN) is connected to pin 6 (Pack-) using a switch.

To avoid discharging the battery unnecessarily, you can also power the Arduino Uno with a USB cable. In this case, it is useless to connect pin 1 (Pack+) or the switch indicated in the wiring diagram.

Program

The BattMon 2.0 code consists of four Arduino files. A battmon main file and three format, i2c and lcd dependency files. All these files are to be placed in a project created from the Arduino IDE software (1.8.+) to compile the code and then upload the program into your Arduino Uno.

Remember to place these four files in a project directory whose name is that of the battmon main file so that it can be compiled.

Libraries

The code also needs for its compilation the internal LiquidCrystal library and the following external libraries which must be imported into your Arduino IDE:

Name Link
phi_prompt libraries/phi_prompt.zip
phi_interfaces libraries/phi_interfaces.zip
phi_buttons libraries/phi_buttons.zip
phi_keypads libraries/phi_keypads.zip
i2cmaster libraries/i2cmaster.zip

Go to Sketch > Include Library > Add .Zip Library and add them one by one. The LiquidCrystal library is already included. More help with this on instructables.

Settings

You may have to modify the keypads values in the battmon main file. Two sets are already available in the code for the values[] array, but if none of them works, you can find your own values using the keypad_values_test file.

Menu tree

This is the menu tree of the BattMon 2.0 program. The Setup submenu is used to test the connection, the Read info submenu to display the essential parameters of the pack and the Control submenu to read or write the other registers of the gas gauge.

Main menu
├── Setup
│   ├── Test SMBus
│   ├── Scan SMBus
│   ├── Enter address
│   ├── Set command
│   └── Main menu
├── Read info
│   ├── Battery ID
│   ├── Charge data
│   ├── Statistics
│   └── Main menu
└── Control
    ├── Single command
    ├── Write word
    ├── Read word
    ├── Read block
    └── Main menu

Wiki

A wiki page is available to illustrate the display of the entire menu and submenus of the BattMon 2.0 program on the LCD keypad shield.

Documentation

Credits

BattMon 2.0 project is based on the SMBusBattery_Phi/BattMon 1.0 code available on the Arduino forum topic initiated by FalconFour.

Bonus

If you are motivated, qualified and experienced in electronics, I propose a reverse engineering schematic of the Sony Aibo ERA-201B1 battery pack PCB and for the curious and do-it-yourself repair enthusiasts, I offer a re-cell tutorial on how to refill it.

There is also a promising Aibo-ERS-xxx-battery project by r00li who wants to use newer components to replace the original battery packs while remaining compatible with Aibo robots.

Disclaimer

It requires electronics skills. There is no guarantee. Use this repository code and associated data at your own risk.

License

This project is licensed under the terms of the MIT license.

License: MIT