Sunny Buddy Solar Charger V13 Hookup Guide a tutorial

Available online at:



Heads up! If you have an older version of the Sunny Buddy (V1.0 and older), please refer to this hookup guide. For V1.3 and beyond, continue reading. Check the back of the board for the version number.

The Sunny Buddy is a small maximum power point tracking solar charger for single-cell LiPo batteries.

SparkFun Sunny Buddy - MPPT Solar Charger

SparkFun Sunny Buddy - MPPT Solar Charger


This tutorial will help you understand what the Sunny Buddy is, why it's useful, and how to use it.

Required Materials

The Sunny Buddy can't do anything without a supporting cast. Pair the Sunny Buddy with these buddies to make it work:

Suggested Reading

Here are some other tutorials you may find useful before delving into this hookup guide:


The Sunny Buddy is a maximum power point transfer (MPPT) solar charger. Why does that matter? What makes it worth having in a circuit? The answers lay ahead.

How Batteries Are Charged

Battery charging is a current dependent action, not a voltage dependent action. Battery chargers monitor the current flowing into the battery and limit it to some set value, chosen to prevent damage to the battery. An ideal battery charger will provide as much current to the battery as it is capable of drawing from its power supply, but no more than the battery can handle.

Power Supply Behavior

Consider the first part of that last sentence: "as much current as it is capable of drawing from its power supply." I've collected some data from five different power supplies: a 2000 mAh LiPo battery, a bench supply, our small solar cell, our large solar cell, and the Sunny Buddy attached to the small cell in full Colorado sunlight (albeit in midwinter).

-> Load testing results of various supplies

That's some mighty fine data!

The chart compares output voltage versus load current for the five sources listed above: in short, how much current each is capable of providing. For a sort of baseline comparison, note that the output of the bench supply, the battery, and the Sunny Buddy are pretty flat. You can clearly see the point at about 240mA where the Sunny Buddy could no longer safely draw more current from the solar cell. In a charging application, that's the point at which it would have settled in and charged the battery. Since I was actively increasing the load to stress the supplies, it folded back to a lower voltage to gracefully handle the excessive load without bursting into flames.

The solar cells, however, behave quite differently. They slowly droop until they reach a certain point, then decline increasingly rapidly until even a small increase in current draw causes the output voltage to plummet. There's a point on that curve, in the "knee" region, where the power transferred to the load is at its peak. This point, called the maximum power point, is crucial to squeezing the most efficiency out of a solar cell.

Finding that point is the key here. The solar cell curves will be compressed along the X-axis in lower light conditions, and, while the unloaded voltage may remain quite high even in low light, the amount of current which can be drawn from the cell decreases rapidly with the amount of light available.

The Sunny Buddy locks in on that point in the curve, pulling the maximum current the cell will provide, but no more, and turning it into charge current. The circled region of the graph shows this: the highest current the small solar cell can deliver is around 180mA, but the Sunny Buddy pushes out 240mA before entering current limit. That's an extra 33% more charge current available to your battery over a comparable 5V charger.


Efficiency in any power supply system can be said to be the ratio of power out to power in. This is another place where the Sunny Buddy is better than comparable linear solutions.

The Sunny Buddy is a switching supply; the output power is given by the equation Pout = Pin * Efficiency. The Sunny Buddy's efficiency has repeatedly measured to be about 80% in tests.

Let's consider a linear solution. To avoid getting too far into that steep region of the graph, we'll set our charge current at 160mA. To calculate the output efficiency, we divided the output power by the input power. Looking at the voltage on the solar cell curve, we see that for 160mA the output voltage is about 7V; thus, input power is 7V * 160mA = 1142mW. Output power is 4.2V * 160mA = 672mW. That's the approximate charge voltage times the charge current. Efficiency is power in over power out: 672/1142 = 59%. Best case, that's the percentage of the electric power generated by the cell that you're using. It will actually be lower when the cell voltage is lower than 4.2V, which it will be over most of the charging range.

Here, again, Sunny Buddy wins: it's using (at least) 20% more of the available power from the solar cell.

Cloudy Days

But what happens to our linear charge circuit when the sun goes behind a cloud? As I mentioned earlier, as available solar energy decreases, the graph compresses along the X-axis. If that steep region drops below the set current of our charger, things go pear-shaped fast. The available voltage plummets, and the charger stops working.

We can combat that by either setting a lower charge current in the first place, which isn't ideal because it means on a good, sunny day, you're losing a lot of potential solar energy by not loading the solar cell heavily enough, or by servoing our charge current to the voltage, reducing or increasing it based on the cell voltage. While that may sound simple, in practice it's quite complex.

Enter the Sunny Buddy

The Sunny Buddy does just that: it monitors the cell voltage and stops drawing current when the voltage droop indicates the cell is being pushed a little too far. Furthermore, since the Sunny Buddy uses a switching topology rather than a linear topology, it has a better efficiency than any linear solution can provide.

Hooking It Up

There are three parts to consider when embedding the Sunny Buddy into a project:

Sunny Buddy Hookup

Solar Panel Input

The input side of the Sunny Buddy comes with a common barrel jack installed.

Input diagram

The following solar panels can be plugged directly in to the Sunny Buddy's female barrel jack with ease.

Solar Panel - 3.5W

1 Retired

Solar Panel - 6W

2 Retired

Solar Panel - 9W

1 Retired

There are also additional footprints for attaching 3.5mm screw terminals or an additional barrel jack to the board.

Screw Terminals 3.5mm Pitch (2-Pin)

Screw Terminals 3.5mm Pitch (2-Pin)

DC Barrel Power Jack/Connector

DC Barrel Power Jack/Connector


Please note that if you intend to use two solar panels, you must clear solder jumper JP1 (it ships closed by default) and close solder jumper JP2 (it ships open by default). Failure to do this will result in the second supply being left unconnected. If both jumpers are left unconnected, no power will be sent to the board. If both jumpers are shorted, the second panel will be shorted out and contribute no power to the system but may be damaged by being short circuited.

The maximum recommended input to the board is 20V; this is a stack of two of our panels. The minimum is 6V, but most solar panels should be above this.

A useful trick for monitoring the input current of a single-panel system is to open JP1 and close JP2, then connect an ammeter between the + pads on the two 3.5mm footprints. This will allow you to monitor the current draw from the solar panel. Note that JP1 must be resoldered and JP2 reopened before attempting to use the SunnyBuddy without the meter in place!

Setting the Input Current Limit

The revised Sunny Buddy has an input set point potentiometer. This allows the user to set an input voltage at which the Sunny Buddy will reduce its current draw to maintain peak power input from the solar panel.

You'll want the voltage at this node to be at 2.7V when the solar panel is at the "knee" voltage we discussed in the Why MPPT? section above. Some solar cell manufacturers may give you this information; the manufacturers of our panels, however, have not. You can either take the hard road and characterize your cell (ick) or take the easy road and make an educated guess that the MPPT point will be at about 90% of the voltage you see when you're in full sun.

To find that point, plug your solar panel into the Sunny Buddy, but don't put a battery or load on it. Measure the voltage from the "SET" pad to the "GND" pad next two it, and tweak the potentiometer until that voltage is about 3V. At that point, the Sunny Buddy will draw current until either 450mA is going to the load and the battery or the solar cell voltage is 90% of its full-sun open-circuit nominal voltage.

Battery Output

The output of the Sunny Buddy is intended to charge a single Polymer Lithium Ion cell. A 2-pin JST connector is populated, and will mate up to most of the LiPo batteries SparkFun sells.The load should be connected in parallel with the battery; again, footprints for a 3.5mm terminal or a standard .1" spaced header have been provided.

Output diagram

The charge current is set by resistor R1 in the schematic. By default it comes set to a maximum charge current of 450mA. It's recommended that batteries not be charged at greater than their capacity rating; thus, the smallest battery that should be charged with the Sunny Buddy is 450mAh.

The revised Sunny Buddy adds an additional sense resistor footprint in parallel with the built-in resistor. The charge current is equal to .1/(R1||RSen); putting a 1-ohm resistor on the Rsen pads will increase the charge current to ~550mA. R1 can be desoldered from the board if charge currents below 450mA are desired.

Note that it is possible to set the charge current to impossible levels. If the current level is too high, the inductor will saturate, which will limit the output current artificially.

Finally, note that there's a jumper on the board that can be cut to allow you to monitor the output current of the charger. You'll need to reconnect the jumper pads after you've finished taking measurements.

The Load

The load can be connected to either the 0.1" or 3.5mm spaced pads on the right edge of the board.

Break Away Headers - Straight

Break Away Headers - Straight

LED Strip Pigtail Connector (2-pin)

LED Strip Pigtail Connector (2-pin)

Female Headers

Female Headers

Screw Terminals 3.5mm Pitch (2-Pin)

Screw Terminals 3.5mm Pitch (2-Pin)


It's important that the load not be too heavy; since it is in parallel with the battery, it will steal some of the charge current from the battery when it is operating.

To avoid this, consider putting active circuitry to sleep whenever possible, or using a microcontroller to turn parts of the load on or off as they are not needed. Methods for doing this are beyond the scope of this tutorial.

Resources and Going Further

If you're looking to get more out of your Sunny Buddy, be sure to check out these resources first:

If you're looking for some inspiration for a project that you can embed the Sunny Buddy into, check out some of these related tutorials and projects:

You can also check out this blog post for more ideas:

ATP: How Solar Cells Work

September 10, 2018

Enginursday: 3D Printed Housing Fixtures

August 29, 2019 | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado