LiFePO4 battery manegement
This page documents the battery/bike monitoring system I'm building for this project. If you are interested you can get your own circuit board for building this system here: BatchPCB.
Description: This is a board I designed to monitor the A123-systems cells in my electric bike project. The function of the board is to monitor all the relevant operational variables of the bike and report a simplified view to the rider. It also is in charge of shutting the bike down if any of the cells are too unbalanced or low. I also wanted the ability to log data to an SD card for later analysis of efficiency and performance. The battery inputs are 16 LT1990 op-amps multiplexed into two MCP3553 ADC's. There are digital inputs for user buttons, a 1-wire temperature sensor and a speedometer. An rs-232 serial port allows communication with an Alltrax AXE motor controller and a logic level serial port communicates with an LCD for information display. There is a Batt+ input for detecting the presence of the battery pack, and to provide power for the 3 relay outputs. The relays are designed to operate a main contactor, and the Keyswitch/Halfspeed inputs of the AXE motor controller. A DosOnChip module from SparkFun allows easy data logging to an SD card. Processing power is provided by a Microchip DSpic33FJ128GP804 and a standard Microchip ICD2/3 programming header is provided.
The LCD I use is a 128x64 serial graphical unit from SparkFun but any LCD with a serial interface could be used.
Here are some pictures of the top and bottom of my board. You'll notice that the bottom has some wires hacked on. The reason for this is that my board was the prototype, and I made some improvements to it before posting it to BatchPCB. Any of the boards ordered from there will not require any modification.
Parts list lifepo4_partslist.txt
Display:
I built a custom display module that incorporates the LCD, buttons, and some LED indicators. The PCB is available on batchPCB as well. Firmware for this board is available on https://sourceforge.net/projects/serialglcd/ The code for this module is in the firmware/branches/e-bike_display directory of the SVN tree.
Source code:
Currently in development. I'm using FreeRTOS as a base for the code, and it is making my life much easier. I have code written to monitor the speedometer and button inputs, and to calculate speed and distance. I'll post the code as soon as it will do something useful. This weekend I'm going to try to get the LCD interface working. Then I could use it as a speedometer until the rest of the code is finished.
Application
| Attachment | Size |
|---|---|
| SerialGLCD1.6beta.zip | 58.96 KB |
| case_front_bottom.jpg | 633.72 KB |
| case_front_top.jpg | 604.19 KB |
| display_back.jpg | 746.6 KB |
| display_front.jpg | 626.34 KB |
| display_in_case_back.jpg | 618.77 KB |
| display_in_case_front.jpg | 600.82 KB |
| case_top_full_v2.stl | 482.99 KB |








Comments
#1 That is very nice! I am
That is very nice! I am working on my controller using a PIC for my brushless electric scooter. I will log my data on a USB thumb drive or a SD card. I was checking some sun readable GLCD from crystalfontz 15 min ago.
https://www.crystalfontz.com/products/parametric.phtml?display_type=grap...
#2 Graphical LCD source code
As I mentioned in a previous post. I have been re-writing the firmware for the SparkFun serial graphical LCD. I have started a sourceforge project for it, so anyone interested can get the code. Also let me know if anyone wants to help develop. The sourceforge project page is http://serialglcd.sourceforge.net The most recent code is from the SVN repository.
#3 Source code
So, I have run into a snag with the source code. The serial LCD from sparkfun was far too slow for my purposes. I have been totally re-writing the code for it to make it faster and add functionality. I am almost done, just a few more tests. When I get it ready for publication I'll post the code here, and on the sparkfun forums.
Because I've been working on the graphics interface, I have not been able to work on the code for the battery monitor. As far as the MCP3553 goes, it is a 3-wire SPI interface, and should be documented in the datasheet. Until I get around to writing code for it, this is all I know.
As soon as I have code for the battery monitor that works, I'll post it.
#4 Source code of MCP 3553
could you please tell me how to do program for MCP3553