{"id":23333769,"url":"https://github.com/scttnlsn/bms","last_synced_at":"2026-03-09T23:34:15.796Z","repository":{"id":142162345,"uuid":"99603013","full_name":"scttnlsn/bms","owner":"scttnlsn","description":"Battery management system for 4-series li-ion packs","archived":false,"fork":false,"pushed_at":"2021-06-16T19:03:17.000Z","size":215,"stargazers_count":56,"open_issues_count":1,"forks_count":31,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-09T18:55:57.373Z","etag":null,"topics":["arm","battery","battery-management-system","bq76920","cortex-m","zephyr"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scttnlsn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-08-07T17:30:05.000Z","updated_at":"2025-02-26T00:42:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"0e87ca24-e6a8-4c8c-b83a-bc37258b8232","html_url":"https://github.com/scttnlsn/bms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scttnlsn/bms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttnlsn%2Fbms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttnlsn%2Fbms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttnlsn%2Fbms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttnlsn%2Fbms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scttnlsn","download_url":"https://codeload.github.com/scttnlsn/bms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttnlsn%2Fbms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30316771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm","battery","battery-management-system","bq76920","cortex-m","zephyr"],"created_at":"2024-12-21T00:32:19.563Z","updated_at":"2026-03-09T23:34:15.779Z","avatar_url":"https://github.com/scttnlsn.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BMS\n\nIntegrated battery management system for 4-series li-ion packs (based on the [BQ76920](http://www.ti.com/product/BQ76920) from Texas Instruments).\n\n![Board](hardware/board.jpg)\n\n* programmable over/under voltage protection for each cell\n* programmable short-circuit detection\n* auto cell balancing\n* cell voltage monitoring\n* coulomb counting for accurate state-of-charge tracking\n* status available over BLE\n\n## Hardware\n\nFull schematic and PCB layout available in the `hardware` directory.\n\n* [TI BQ76920](http://www.ti.com/product/BQ76920) analog front-end\n* [Nordic nRF51822](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822) ARM Cortex-M host controller\n* FETs for enabling or disabling charge/discharge\n* shunt resistor for current measurement\n\n## Firmware\n\nThe host controller firmware is based on the [Zephyr RTOS](https://www.zephyrproject.org).  It communicates with the BQ76920 via I2C and handles various error states that may occur in the BQ76920.  It also exposes a BLE peripheral for wireless monitoring.\n\n### Build\n\nRequirements:\n\n* [GNU ARM Embedded Toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm)\n* [OpenOCD](http://openocd.org)\n* [Zephyr RTOS](https://www.zephyrproject.org) (included as submodule)\n* [elftools](https://github.com/eliben/pyelftools)\n\nSetup:\n\n* `git submodule update --init`\n* `./setup.sh`\n\nCompile and flash:\n\n* `make`\n* `make flash`\n\n### Configuration\n\nThere are various configuration options which can be specified via Kconfig.  Run `make menuconfig` to browse the available options and override any of the default values.\n\n* `CONFIG_BMS_BOOT_DEVICE` (default: `GPIO_0`)\n* `CONFIG_BMS_BOOT_PIN` (default: `21`)\n* `CONFIG_BMS_ALERT_DEVICE` (default: `GPIO_0`)\n* `CONFIG_BMS_ALERT_PIN` (default: `22`)\n* `CONFIG_BMS_BLINK_DEVICE` (default: `GPIO_0`)\n* `CONFIG_BMS_BLINK_PIN` (default: `18`)\n* `CONFIG_BMS_OVP_ENABLE` (default: `3550` mV)\n* `CONFIG_BMS_OVP_DISABLE` (default: `3350` mV)\n* `CONFIG_BMS_UVP_ENABLE` (default: `3000` mV)\n* `CONFIG_BMS_UVP_DISABLE` (default: `3100` mV)\n* `CONFIG_BMS_SCD_DELAY` (default: `10000` ms)\n* `CONFIG_BMS_OCD_DELAY` (default: `10000` ms)\n\n## BLE Protocol\n\nThe BMS implements a Bluetooth Low Energy peripheral for monitoring cell voltages, current draw and state-of-charge.  All status data is part of a single characteristic.\n\nPeripheral UUID: `8D9D7800-5B61-412A-AB71-5C7E0E559086`\n\nCharacteristic UUID: `8D9D7801-5B61-412A-AB71-5C7E0E559086`\n\nValue structure (MSB to LSB):\n\n* status [1 byte]\n* cell 1 (mV) [2 bytes]\n* cell 2 (mV) [2 bytes]\n* cell 3 (mV) [2 bytes]\n* cell 4 (mV) [2 bytes]\n* current (mA) [2 bytes signed]\n* charge used (mAs) [4 bytes signed]\n* state of charge (percent) [1 byte]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscttnlsn%2Fbms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscttnlsn%2Fbms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscttnlsn%2Fbms/lists"}