Project Curacao – Solar Power Subsystem
NOTE: The Solar Panel Charger Controller in this project has been replaced by a 3rd Generation Controller by SwitchDoc Labs called SunAir.
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 SwitchDoc Labs SunAirPlus Solar Power Controller
- 2 3300 mAh 3.7V LiPo batteries
- 1 Raspberry Pi Model A
- Wifi
- 3 Adafruit INA219 Current Sensors (I2C) – Now included in SunAirPlus
- 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.
Why are the solarpanels at 90degrees? I’d think they’d be at 15degrees to get a better angle to the sun.
tom
Tom,
Good eye! Yes, they should be at 12 degrees, to be exact. The problem was that the platform we had brought all the way down to the Caribbean did not fit the tower. We had purchased the wrong size. So, because there was no place to buy one on the Island, and FedEx doesn’t work very well down there (and it’s very expensive), we had to strap it on to the tower with a ton of black wire ties (that resist ultraviolet radiation) at 90 degrees.
It is now off the tower (after the wind turbine destroyed itself) and sitting at about 25 degrees. Much better power (https://www.switchdoc.com/2014/07/solar-power-raspberry-pi-results/).
The angle is very important. The difference between 12 degrees (pointed at the sun) and 90 degrees is about 50%. At this time of year the maximum energy flux on the panels over a 24 hour period from the sun will be when the panels are pointed straight at the sun when it crosses the meridian about noon. That’s pretty much straight overhead at 12 degrees latitude at this time of year.
With the camera pointed at the ocean the box is about 15-20 degrees from vertical the flux will be (sin x)*flux (max), where x is the angle (angle(max)-angle(box)), certainly less than half of what it gets if pointed straight up. We tried putting a mirror up to help, but it made little difference.
I’m going to add more solar panels during the upgrade trip this fall.
I’ve been watching your project because I have a very similar project. Instead of 3500 miles away though, it’s about an hour drive away. Fortunately I can use a cellular repeater to get internet, and I do have a building nearby where I already have a bunch of solar panels.
It’s still a work in progress, but I’m hoping to learn from your project!
Good luck,
tom
Tom,
I’d be very interested if you would describe how you are getting TCP/IP from the use of a cellular repeater (obviously, you have a cellular board) to your project? That sounds like something I’d like to do with some local mobile projects.
BR,
John
Hi
Re Cellular – that’s what I’m planning for mine. Problem of course is that I can’t access the remote Pi (which has cellular) directly, because of Firewall. Fortunately, here in Finland always-on, “all the bandwdth I can eat” is pretty cheap – I’ve 3x SIM-cards, cost me about €20/month total. OK, I’m limited to 2megabit/sec, but plenty fast enough.
So, Firewall…What I’ve tested (albeit partially) is for the remote Pi to access my Local Pi (on which my website runs) then create an ssh tunnel, and use scp etc to ‘squirrel’ data, piccies, etc. to-and-forth.
I’ve written up a bit on my site under the tab ‘PILAB’.
Basically, I use sakis3G and UMTSKeeper on the Pi.
Please find my rough notes and ramblings here:
https://oululife.dnsdynamic.com/wp-content/uploads/2013/12/Forest-Pi-setup.pdf
Hope it’s of some use.
(Part 2 – WordPress threw a Mod-security wobbly if all in one)
Incidentally, I’ve had success turning off the ethernet chip – and more importantly, turning it back on again. Follows is an extract of a mail I sent to sleepy Pi’s creator today. As my remote Pi will be a helluvalot closer than yours (30-minute walk, rather than 3500 miles…you might wanna put a ‘watchdog’ such as to test ethernet can be brought up successfully, reboot if not at, say, daily intervals.
“Reason is, I want to make sleepy have TWO levels of sleep. I’ve discovered that it’s possible to turn off the ethernet chip, and turn it on again using:
(part 3 follows)
Andy,
This is great information. I think I will do a column on it for my November SwitchDocLabs column in Raspberry Pi Geek magazine. How to do this “remote cellular Pi” here in the US (as well as abroad).
Sorry – can’t post the codey bit, even wrapped in
tags.
Wordpress, being the dumbass that it is throws this insanely unhelpful drivel:
"An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security."
Mail me, and I'll attach. Basically, I turn the ethernet chip on the Pi off, and consumption goes from 2.35W to 1.6W. Importantly, I can turn it on again.Reliably.
-Andy
Ha! I just heard from my Pi down in the Caribbean. It told me:
From: projectcuracao
Subject: ProjectCuracao Fan ON(HUM)
Date: July 31, 2014 at 4:03 PM To:
Fan turning ON: State: ot:27.80 it:29.20 oh:1.00 ih:87.20 sv:4.24
This means that the Pi is turning the fan on because the inside humidity is 87%. Note that the outside humidity sensor is still baking in the sun (hence 1% – should be about 79%). Solar voltage at 4.24 which will run the fan for a while.
John