John Shovic's Google Plus Switch: Project Curacao - Solar Power Subsystem - Part 2

Project Curacao - Solar Power Subsystem - Part 2


Project Curacao - Solar Power Subsystem

The Subsystem

The solar power subsystem consists of two solar panels, a LiPo charger which charges the battery and manages the current from the solar panels as well as supplying a booster from 3.7V to 5V for the USB connector to the Raspberry Pi.  We will also be managing the Raspberry Pi from a Battery Watchdog system consisting of another power system and an Arduino controller.  See Part 3.


What hardware to use in the Solar Power Subsystem?

We are using the following hardware for the power subsystem project:


  • 2 Adafruit 6V 3.4W, 530mA Solar Panels
  • 1 Seeed Studio LiPo Rider Pro charger (includes a booster to 5V from 3.7V)
  • 2 3300 mAh 3.7V LiPo batteries
  • 1 Raspberry Pi Model A
  • Wifi
  • 3 Adafruit INA219 Current Sensors (I2C)
  • 1 Adafruit 12 bit A/D (I2C)

Calculating the power needed

The first criteria for designing the Power Subsystem is determining our goals. We want the Raspberry Pi to run all day and at least three hours before sunrise and three hours after sunset. Our goals and budget influence our hardware choices, so they are not totally independent.

Assume:

  • 8 Hours of Sun running the cells at least at 80% of max
  • Delivery of current to Raspberry Pi at 85% efficiency
  • Raspberry Pi takes 350mA on average


Given these we can calculate total Raspberry Pi runtime during a typical day:

PiRunTime = (8 Hours * 80% * 1020mA) *85% / (350mA) = 15.8 hours

Our goal was for 14 hours, so it looks like our system will work.  6 Hours of running the Raspberry Pi will take (350mA/85%)*6 Hours = 2466mAh which is comfortably less than our 6600mAh batteries can store.


What to measure?

To be able to see what is happening in our Power Subsystem, we want to measure the currents and voltages of the solar panels, the batteries and the current into the Raspberry Pi. We also want to monitor the temperature of the batteries. All of this information will be placed in a MySQL databse for later analysis.





Putting in the sensors

The INA219 are high side current sensors. That means you connect them in-line with the + power lead. These sensors will measure both positive and negative currents. Why negative currents?  The battery will receive current (negative) when charging and supply positive current when driving the load. We are connecting one in-line with the batteries, the USB cord for the Raspberry Pi and the solar panels. The INA219 also measures the voltage at the + power line which allows us to calculate power at each point (P = VI). We are also using a 10K Ohm thermistor wired to channel 0 of a 4 channel 12 bit A/D to measure the temperature of the batteries.
Issues with the sensors
We are using a Python scheduler (apscheduler) to gather the data from all the power subsystem sensors and put the data in a MySQL database on the Raspberry Pi. Part 4 will describe the Raspberry Pi control software. While bringing up the monitoring software for the power subsystem we discovered a problem with reading negative currents from the INA219.  Reading negative currents are critical to this project when the batteries are being charged. It turned out to be a problem in both the Adafruit C++ drivers (fixed as of September 2013) and in the subfact_pi_ina219 Python drivers on GitHub. The subfact drivers fixes are on GitHub/projectcuracao.



Monitoring the sensors remotely

Project Curacao will be monitored remotely through the Internet by the use of SSH and by the use of  RasPiConnect. RasPiConnect allows you to build meters, buttons, and display graphs remotely from the Raspberry Pi remotely. The screen for monitoring the power system is shown below. The software for generating this display is on github.com/projectcuracao and is described on the RasPiConnect page in this blog.


2 comments:

  1. Very interesting. Is there a schematic for power subsystem please

    ReplyDelete
    Replies
    1. Mike,

      Sorry there is no schematic for the power system beyond the block diagram in the article. However, it is quite easy to hook up the Lipo Rider Pro to a LiPo battery and the solar cells. That is totally functional. If you want to sample the currents, then you break each positive wire and run it through an INA219 current sensor.

      The data I've collected by doing this has been fascinating.

      John

      Delete