As I mentioned on my profile page, I spend some time at a local horse farm. They have a golf cart that gets used and abused. Recently, my wife commented that it is running slowly. So, I checked the water level in the six 8.8V lead acid deep discharge batteries and replaced one of the 6 gauge cables that appeared corroded. A fresh charge and it seemed to work well. Of course, a few days later it was back to running slowly. So, I figured this would be a great Arduino project. Using all 6 of the analog input pins on an Uno, I would hook up voltage dividers to the + side of each battery (8.8, 17.6, 26.4, 35.2, 44.0, 52.8 volts).
I designed a shield for this project (I have learned that shields do not need to cover the entire Arduino board). Here is a thumbnail of the GCBMv1.0 board.
I had to figure out reasonable resistor values (using resistors I have in my parts bin) for each divider network to get a little below 5V to feed to the analog in pins.
So, how do you test 53v signals if you don’t have a fancy bench power supply? 9V batteries snap together quite nicely.
To compute the input voltage, I use some code like this:
uint16_t b1 = analogRead(A0); float v1 = b1 * 0.0118487;
That magic constant (0.0118487) is computed as:
But things are never quite that simple. The actual resistance of my resistors is not exactly 4.7k and 3.3k. The voltage of my Arduino Uno is not exactly 5.0v. Pete recently sent out a pointer to a site that tells you how to use the internal 1.1 vref of an Atmel chip to somewhat accurately measure the input voltage. In the end, I just measured the voltage with a voltmeter and read the analogRead value and computed a proper conversion factor. The exact values do not really matter for what I am trying to do. I want to see relative voltage as a function of time and load (driving uphill, stopped, …).
So, I hooked up to all of the batteries in the golf cart
and collected some data. The first 30% of the chart is stopped. The next 25% is driving downhill. The last 45% is driving back uphill. This was before I tuned the magic constants, so I do not think that Series 5 being higher than the other batteries is significant.
Nothing too surprising from this data. So, I removed my equipment and waited. Two weekends later, my wife said it was slow again, so I did another data collection run.
Wow, quite different. Battery 4 is showing serious voltage droop under load. Looks like that one is a candidate for replacement.
Here is the code (remove the .txt and put it in a directory called GolfCartBatteryMonitor). You can remove the lcd code and just monitor things from the serial monitor.