This repository contains Arduino code for a comprehensive Battery Monitoring and Management System (BMS). The system is designed to monitor multiple battery cells, calculate State of Charge (SoC) and State of Health (SoH), and perform data logging and remote data transmission.
- SoC Calculation: Measures and calculates the State of Charge of battery cells.
- SoH Calculation: Determines the State of Health based on the remaining capacity.
- Data Logging: Records parameters on an SD card.
- Remote Data Transmission: Sends data to a ThingSpeak channel for remote monitoring.
- Cell Balancing: Actively balances the cells to maintain uniform charge levels.
- Coulomb Counting: Essential for accurate SoH monitoring.
- Any Arduino compatible mucrocontroller
- SD card module for data logging
- Wi-Fi module for remote data transmission
- Voltage measurement setup for battery cells
- Digital pins for cell balancing control
- Custom Scheduler Library: Download from GitHub
ThingSpeaklibraryWiFilibrary for ESP8266/ESP32SPIandSDlibraries for SD card operationsmath.hfor mathematical functions
- Ensure all required libraries are installed in the Arduino IDE.
- Connect the hardware as per the schematic (not provided in this README).
- Configure the Wi-Fi credentials and ThingSpeak API details in the code.
- Upload the code to your microcontroller.
- Update the
network_nameandnetwork_passwordvariables with your Wi-Fi credentials. - Set the
channel_idandAPI_Keyfor your ThingSpeak channel. - Adjust
V1,V2,V3, etc., pins according to your setup. - Modify
capacity,Time, and other constants as per your battery specifications.
- The
setup()function initializes the Wi-Fi connection, SD card, and sets up the pins. - The
loop()function manages the task scheduling for continuous monitoring and balancing of cells. - Data is logged on the SD card and sent to ThingSpeak for remote monitoring.
Contributions to improve this project are welcome. Feel free to fork this repository and submit pull requests with your enhancements.
This code is provided "as is" and without any warranty. The author is not responsible for any damage caused by the use of this code.