Powering a Raspberry Pi With a 5W Solar Panel





Introduction: Powering a Raspberry Pi With a 5W Solar Panel

My plan was to make a solar powered raspberry pi.

What you will need:

1 x Raspberry pi (we used model B)
1 x 5 Watt solar panel with USB connector
2 x Female breadboard connector (we used something similar)
1 x USB wire with connector
1 x Toggle switch
1 x Brain
1 x Soldering iron & solder

Powered by LEICESTER HACKSPACE and INSTRUCTABLES for supplying the solar panel.

Step 1: Find the Required GPIO Pins

I googled the GPIO pin layout on google, and luckily there was a nice diagram which worked with my model B.
The pins match up with the ones on the raspberry pi.

We want the red 5V and the black Ground on the top left of the diagram.

Step 2: Find the USB Power Wires.

Now we want to find the power wires from a standard USB wire. Like mine!

In my case it was the red and black, but may be different depending on your wire, so remember to check it with a volt meter before soldering.

Step 3: Soldering

Now you want to solder the wires together, I used a switch aswell.

I soldered the red wire from my USB to one of the female connectors which would go on pin 2 on the raspberry pi,
and I soldered the black wire from my USB to another one of the female connectors which would go on pin 6 on the raspberry pi.

I made a ascii circuit diagram for you: (It Looked better on notepad)

Red USB+-------------------------------+5V Red GPIO (Pin 2)
Black USB+-------------------+Switch+-----+round Black (Pin 6)

Step 4: Test

Now its time to test it. Because this 5 Watt solar panel is not powerful enough to create a lot of electricity, It might struggle to run the raspberry pi unless it's a bright day.

Mine worked under a bright light, but wasn't able to run under a normal light bulb.



  • Epilog Challenge 9

    Epilog Challenge 9
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
  • Paper Contest 2018

    Paper Contest 2018

We have a be nice policy.
Please be positive and constructive.




Nice Idea. A solar powered Pi allows projects to easily move out into the backyard without having to worry about mains power.

But why make a custom cable to go from the USB out on the panel
to the GPIO header? Wouldn't a normal micro USB cable have worked just
as well?
By going direct to the GPIO you are bypassing any electrical protection the micro USB port provides.

I would suggest a much larger wattage solar panel to cope with cloud cover. You don't want the Pi shutting down every time a cloud goes past the sun.

Also adding a cron job to do a graceful shut down a short while before the sun gets too low. A controlled shut down is better than just losing power, especially if it is going to do it every day.

Maybe even add a USB battery bank to provide enough power to keep the Pi going overnight. Of course this would require more or larger capacity panels to supply the Pi and charge the battery during the daylight hours.

Also you have to be very sure your solar panel puts out a stable 5 volts.
The USB output type of solar panels usually have some sort of regulator but many solar panels do not. In strong sunlight an unregulated solar panel can put out a voltage much higher that their label suggests. Sending this unregulated power direct to the GPIO may cause damage to the Pi.

OK thanks, I was thinking of using a battery, but I didn't have one at that time

Well...OK, nice start.
Unfortunately, the first cloud that comes along is eventually gonna toast your SD card with an uncontrolled power-off.
In other words,
Now then. Take it further.
First, Have a look at Julian Ilett's Youtube videos regarding MPPT charging.
Then, head over to
and have a gander at that.
Slap a battery to it (If you don't like Julian's ideas have a look at using a LiPo cell with a serious - cheap - solar lithium controller, and a step-up board. You'll get the lot from, e.g. Banggood cheaper than three corrupt SD's.
I know. I've done it.

Good effort! Keep it up!

OK thanks, I will take that into consideration next time

What if you put two solar panels in parallel? Would that be enough to power your Raspberry Pi?

That's a great idea! and will work, unfortunately I only have 1 solar panel.