Since the Raspberry Pi was first released back in 2012 we have had many people enquiring about the practicality of powering a Raspberry Pi with a PV solar panel. In this article we will look at the practicalities of doing so.
The first thing to consider is the power requirements of a Raspberry Pi. Assuming a headless installation – i.e. no monitor and probably no keyboard or mouse – the Raspberry Pi draws around 2 Watts of power. This is very low for what is basically a fully functional computer, but supplying 2 Watts of power 24 hours per day 7 days per week is not a small requirement.
The Raspberry Pi requires a stable 5 Volt DC power supply, but for economical solar charging it is best to use a 12V charging solar panel and a 12V deep cycle or leisure battery. In order to get the 5V from the >12V of the battery, we will need a regulator, but we will come to that later.
The Solar Panel
Even with a very efficient voltage regulator, there will still be some losses in our power system. It is best to assume 80% efficiency, and therefore 2.5 Watts will be taken from the battery to keep the Raspberry Pi powered. With a battery at 12V, 2.5 Watts corresponds to a current supply of 0.2 Amps. Therefore 0.2Ah (Amp Hours) of charge will be taken from the 12V battery every hour by the Raspberry Pi. That corresponds to 4.8Ah of charge per 24 hour period which is therefore the amount the solar panel must on average be able to put into the battery each day.
While we may expect many hours of good sunshine in the summer, it is the winter we need to focus on if the Raspberry Pi is to be solar powered all year around. It is safe in the UK to assume 2 hours of good solar generation on average per day in mid-winter – i.e. 200Wh of charge per day will be put into a battery by a 100 Watt solar panel on average in the winter.
We need around 5Ah going into the battery each day, and we assume at least 2 hours of good charging per day in the winter, therefore we need a solar panel which will give us 5/2 = 2.5 Amps charging current. For a 12V battery system that means we need a solar panel of at least 12 x 2.5 = 30 Watts rated power output.
To be on the safe side therefore, a solar panel of the order of 40 Watts should be considered, and in Scotland 50 Watts. Above 20 Watts, the price of solar panels increases by less than £1 per Watt, so it is well worth spending a few pounds extra for peace of mind.
Click here for a selection of 40 Watt Solar Panels with prices starting at around £45-50. If you decide to go for a larger panel, for some reason, solar panels in the range of 50-75W are relatively expensive, so it is worth considering an 80 Watt Solar Panel as these are priced from around £70 which is almost always cheaper than any 50,60 or 70W panels you might find!
The battery for a solar powered Raspberry Pi must be a deep cycle battery – certainly not a car battery. For a deep cycle battery to last many years, it should not be used below 40% charge, and should be kept fully or nearly fully charged as much as possible (hence the suggestion to use a 40 or 50 Watt solar panel when a 30W panel may be up to the job).
The Raspberry Pi will be taking approximately 5Ah of charge from the battery each day, and there may well be days (or multiple days in a row) without any sunshine – therefore the battery should be sized to provide at least 7 days of power for the Raspberry Pi without sunshine and without the charge of the battery falling below 40%. Therefore as 7×5=35Ah is at most 60% of the charge of the battery we need a battery of at least 35/0.6=58Ah.
As with the solar panel, the price difference between say a 60Ah and an 80Ah battery is relatively small, and so it is worth spending a few pounds extra to have a battery that is more than up to the job.
Click here for a range of excellent 12V deep cycle batteries for solar delivered free in the UK.
The 5V Regulator
It is possible to use a cheap linear regulator such as the common L7805 (pictured above) to bring the 12V from the battery down to the 5V for the Raspberry Pi, but such a regulator will by only 40% efficient with these voltages resulting in 60% of your solar generation being wasted at heat in the regulator. Instead a switching regulator should be used which will give much better efficiency. This regulator must be able to supply up to 700mA in case you ever want to connect up a USB keyboard and mouse etc to your Raspberry Pi.
One option is to use an in car 12V to 5V USB charger such as the one pictured above. You can then plug in a standard USB to mini-USB cable between the ‘charger’ and your Raspberry Pi. These are available from just £1 here 12V USB charger.
The next (more efficient) option is a switching 12V to 5V step down regulator/converter. These can offer efficiencies well over 90-95% which is exactly what you need for a solar powered application like this, and are usually rated at 15 Watts (3A @ 5V). An example is pictured above – they are available from around £3-4 here 5V Step-Down Regulator.
The Solar Charge Controller
The last part of the puzzle is a solar charge controller. This device stops the battery from being over-charged in the summer months when the Raspberry Pi is using less battery charge than the solar panel is capable of putting into the battery. Assuming a solar panel of under 80 Watts, a 10 Amp rated unit is all you need. Click here for suitable 10 Amp MPPT Solar Charge Controller with prices starting at around £10. (Pick something offering PWM at the very least least, but ideally MPPT as these are the most efficient solar charge controllers. MPPT is 10-30% more efficient than PWM, and this efficiency difference being greater in the winter months when it is most significant.
The Total Costs
So, the grand total outlay for a solar power system for a Raspberry Pi is of the order of at least £150 on top of the cost of the Raspberry Pi itself, plus cables, connectors, fixings, and other little bits and pieces. As the Raspberry Pi will use no more than around 20-30 kWh (units) of electricity per year when connected to the mains via a good switching 12V to 5V regulator, it would take decades for the cost of such a solar set up to pay for itself; but if you want to use a Raspberry Pi where there is no mains electricity, it is certainly possible to have a reliable completely self-sufficient system for under £200.