SunControl Solar Controller LiPo Temperature Charging

SunControl Solar Controller LiPo Temperature Charging

The SunControl Solar Power Controller Board for Raspberry Pi, Arduino and Cell Phone Charger is a 4th Generation Solar Charging and Sun Tracking Board designed by and manufactured by SwitchDoc Labs.

You can use this board to power, measure  and control your Solar Power projects. It incorporates a number of outstanding features in a very compact, inexpensive single fully assembled and tested PC Board.  SunControl is customizable with your software and hardware.  It’s even used on Project Curacao2.

Temperature and LiPo Batteries

Charging LiPo batteries is a complicated business.   SunControl is designed to automate that process and maximize the charging rates in an appropriate manner for LiPo batteries.   While there are a number of rules to follow, one that is not talked about very often is the temperature limits for charging.

Low Temperature Charging

In essence, fast charging of LiPo batteries should be limited to the temperature range 0C(32F) to 50C(122F).  Under 0C, the LiPo battery will appear to be charging normally, plating of metallic lithium can occur on the anode during a sub-freezing charge.    This is permanent and cannot be removed with cycling.      Batteries with lithium plating are move vulnerable to vibration or other stressful conditions.

During charge, the internal resistance will slightly increase the temperature which can compensate for the external temperature to some degree.   The internal resistance of LiPo batteries (and other batteries too) increases when cold, which prolongs charge times.

While SunControl uses the 0C limit with the onboard charging circuitry (with the optional 10K NTC Thermistor), recent research has shown that you can charge all the way down to -30C but only at very low currents.    At these low currents, the charge time for a reasonable battery would stretch out beyond 50 hours.

High Temperature Charging

Heat is the enemy of batteries.  High temperatures reduce the lifetime of LiPo batteries (as well as others).   Those who have followed Project Curacao2 know that it was a battery problem that killed the original Project Curacao after two years in the tropic heat.  LiPo batteries perform well at elevated temperature (discharge wise), but charging and discharging at elevated temperatures is subject to gas generation that might cause a pouch cell to swell.   Most chargers (including SunControl) will stop charging at 50C.

 

The SunControl Temperature Sensor SystemSunControl

If you plan to have your project outside or unattended for long periods of time, you may want to add the optional 10K NTC 3950 Thermistor to SunControl.

The MCP73871 device on SunControl continuously monitor battery temperature during a charge cycle by measuring the voltage between the THERMISTOR and GND pins. An internal 50μA current source provides the bias for most common 10 kΩ negative-temperature coefficient thermistors (NTC). The MCP73871 device compares the voltage at the THERMISTOR pins to factory set thresholds of 1.24V and 0.25V, typically.

Once a voltage outside the thresholds is detected during a charge cycle, the MCP73871 device immediately suspends the charge cycle. The MCP73871 device suspends charge by turning off the charge pass transistor and holding the timer value. The charge cycle resumes when the voltage at the THERMISTOR pins returns to the normal range.

You can find an inexpensive compatible 10K NTC 3950 Thermistor on store.switchdoc.com.

How to Add  a Thermistor to SunControl 

Simply remove the 10K surface mount resistor from the THERMISTOR pads (or cut the trace going to it, which is what we did in the Grand Test below), and solder in a 10K NTC 3950 thermistor in the provided holes. You can test out the temperature system by trying to charge while you place the thermistor in a freezer or against some ice, as well as in a cup of > 50°C hot water.

SunControl should stop charging the battery and the CHARGING LED should turn off.

When you are done testing, attach the sensing element of the thermistor (the epoxy bulb) so it is resting against the battery.

 

Our Grand Test

Because we wanted to use an AM2315 Temperature sensor in our testing to measure the temperature that the thermistor is experiencing, we used a heated Rice Bag for the hot test and a bag of ice for the cold test.

First we cut the trace (as indicated above):

We taped the thermistor onto the AM2315 to get them pretty close to each other:

Next we soldered the thermistor in place (after adding longer wires to the 10K NTC 3950 thermistor because we wanted to put the thermistor inside of the rice pack and in the middle of the ice pack):

 

Next we set up the Raspberry Pi DataLogger (and modified the graph routine to display both current and the AM2315 temperature) and heated up the rice bag:

Then we took the thermistor and AM2315 out of the rice bag, let them get close to ambient temperature and then put them in the ice bag:

And finally we took the thermistor and the AM2315 out of the ice bag and let them return to ambient temperature

The Resulting Graph

A few comments on the test.  First of all, it worked perfectly.  SunControl turned off the charging of the LiPo battery about 50C and turned back on after the temperature dipped below 50C.   And then in the ice pack test, SunControl turned off the charging of the LiPo battery about 0C and then turned it back on after the temperature wen above 0C.

Looks like we did our design job well.   SunControl is now ready for extreme environments, all you SwitchDoc customers in Scandinavia!

Note that the turn off and turn on points are not perfectly aligned with the temperature reported by the AM2315.   This is because the epoxy thermistor and the AM2315 have different thermal masses (the epoxy thermistor is really small and will cool and heat up faster than the comparatively massive AM2315).   This is especially evident after removal of the ice pack when the charging current comes back on.  It looks like it turned off high and turned on back a little lower than 0C, but this is the thermal mass of the AM2315.    It not as obvious in the hot part of the test, but it is the same phenomenon.

The MatPlotLib code for the Graph

Somebody always asks for the code that generates the graph as MatPlotLib for python and the Raspberry Pi is really quite obtuse.   Here is the code used to generate the graph above (minus the annotations).

 

 

def buildINA3221Graph(password, myGraphSampleCount):
                print('buildINA3221Graph - The time is: %s' % datetime.now())

                # open database
                con1 = mdb.connect('localhost', 'root', password, 'DataLogger' )
                # now we have to get the data, stuff it in the graph 

                mycursor = con1.cursor()

                print myGraphSampleCount
                query = '(SELECT timestamp, deviceid, channel1_load_voltage, channel1_current, channel2_load_voltage, channel2_current, channel3_load_voltage, channel3_current, id FROM '+INA3221tableName+' ORDER BY id DESC LIMIT '+ str(myGraphSampleCount) + ') ORDER BY id ASC'

                print "query=", query
                try:
                        mycursor.execute(query)
                        result = mycursor.fetchall()
                        print "---------"
                except:
                        print "3---------"
                        e=sys.exc_info()[0]
                        print "Error: %s" % e


                print result[0]
                t = []   # time
                u = []   # channel 1 - Current 
                averageCurrent = 0.0
                currentCount = 0
                for record in result:
                        t.append(record[0])
                        u.append(record[3])
                        averageCurrent = averageCurrent+record[3]
                        currentCount=currentCount+1

                averageCurrent = averageCurrent/currentCount

                print ("count of t=",len(t))

                fds = dates.date2num(t) # converted
                # matplotlib date format object
                hfmt = dates.DateFormatter('%H:%M:%S')
                #hfmt = dates.DateFormatter('%m/%d-%H')

                fig = pyplot.figure()
                fig.set_facecolor('white')
                ax = fig.add_subplot(111,axisbg = 'white')
                ax.vlines(fds, -200.0, 1000.0,colors='w')



                #ax.xaxis.set_major_locator(dates.MinuteLocator(interval=1))
                ax.xaxis.set_major_formatter(hfmt)
                ax.set_ylim(bottom = 0.0)
                pyplot.xticks(rotation='45')
                pyplot.subplots_adjust(bottom=.3)
                pylab.plot(t, u, color='r',label="OurWeather Current",linestyle="-",marker=".")
                pylab.xlabel("Seconds")
                pylab.ylabel("Current mA")
                pylab.legend(loc='lower center')
                print "-----"
                print max(u)
                print "-----"
                pylab.axis([min(t), max(t), 0, max(u)+20])
                pylab.figtext(.5, .05, ("Average Current %6.2fmA\n%s") %(averageCurrent, datetime.now()),fontsize=18,ha='center')

                pylab.grid(True)
                pyplot.show()
                pyplot.savefig("/var/www/html/INA3221DataLoggerGraph.png", facecolor=fig.get_facecolor())



                mycursor.close()
                con1.close()

                fig.clf()
                pyplot.close()
                pylab.close()
                gc.collect()
                print "------INA3221Graph finished now"