Getting more power from your solar panels


Figure 1 is the block diagram for SunTracker, which is a pretty simple system. It has two independent solar power systems, each run by a separate SunAirPlus solar power controller/data collector. Each SunAirPlus has a three-channel INA3221 current- and voltage-measuring I2C unit, and each is connected to an identical Voltaic Systems 3.5W, 6V solar panel. The 5V output of SunAirPlus also is connected to a 10W, 10-ohm load resistor (connected just to discharge the LiPo battery – more on that later).

Figure 1: SunTracker block diagram.

The sun-tracking solar panel is mounted on top of a 3D-printed stand (ignore the cannon-shaped tubes on the front; they are left over from a previous experiment) and then mounted on the shaft of a 5V stepper motor. The stepper motor is driven by a Grove motor controller.

Because the two SunAirPlus controllers share the same I2C addresses, I use a Grove I2C four-channel mux to switch between them. One of the channels drives the 5V Grove motor controller and the 5V stepper motor. Each of the channels can be 3.3V or 5V, so this was a convenient solution to driving the 5V motors and interfacing with the 3.3V Raspberry Pi.

One thing to remember about the way a solar power charger works is that the amount of power that will be used is dependent on the LiPo battery needing the power for charging. LiPo batteries don't like being undercharged or overcharged. SunAirPlus has a LiPo charging chip that regulates the amount of power delivered to the battery. The key to setting up this test is to discharge the batteries of both units with a 10-ohm, 10W resistor through the SunAirPlus 5V power supply (to protect the LiPo battery from being discharged too much); then, the batteries are ready to take a full day's worth of solar energy. If you don't discharge the batteries (which I forgot to do on March 30), you will see the solar cell voltage graph shown in Figure 2, which shows the solar panel voltage climbing as the battery nears full charge. Furthermore, the two batteries are in different charge states, with the sun-tracked battery having a bigger charge than the non-tracked battery. Figure 3 shows the solar voltage on March 31, when the battery had been discharged properly.

Figure 2: March 30 solar voltage.
Figure 3: March 31 solar voltage.

Additionally, I connected a Grove 128x64 OLED display to see what the SunTracker was doing in real time. (See the "Parts List" box.) Figures 4 through 6 show the configuration and setup of the tracking and stationary test systems.

Parts List

  • Grove SunAirPlus (two) [3]
  • Grove DRV8830 motor controller [4]; I2C mini motor driver
  • Grove I2C four-channel mux [5]
  • Grove connector to pin header adaptor [4]; four-pin female jumper to Grove four-pin conversion cable
  • Small 5V stepper motor [6]
  • JST2 to male header conversion cable [7] and solder male jumpers to the wires
  • Optional Grove 128x64 OLED display [8]
  • Raspberry Pi (any version)
Figure 4: Inside the SunTracker box.

To start, you point the entire unit due east at a 90-degree bearing. However, you have to remember one thing: Due east on a compass is not true due east. You need to compensate for magnetic declination [9], which occurs when the magnetic north pole is not the same as the geographic north pole. At the SwitchDoc Labs location, declination is about 14 degrees; therefore, I point the unit at 76 degrees instead of 90 degrees to get due east. Does this matter? Yes. Fourteen degrees is almost an hour of sun travel, and you won't be pointing correctly if you don't take this into account.

The unit then tracks the sun the length of the day (based on 763 minutes of sun on March 1 for the lab location) over a total of 180 degrees. Again, if I were being more careful, I would probably track about 150 to 160 degrees because of the horizon.

The Code

The Python code [10] for SunTracker is pretty simple. After sunrise, the program starts tracking the sun by turning the stepper motor two steps every six minutes, which for the stepper motor used, corresponds to 0.7 degrees per step or 1.4 degrees every six minutes.

The program reads the amount of solar power created by both solar panel systems and then stores the data in a MySQL database on the Raspberry Pi for later graphing and analysis. The test ran for three days from March 30 through April 1.

Figure 5: Complete SunTracker test units.
Figure 6: Deployed SunTracker test units.

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content