Welcome to the rosner.net.nz solar blog
This blog is about an electronics project - a web server based on a 100% solar-powered Raspberry Pi computer.
In this blog you will find the technical details as well as usage updates and enhancements to the system.
This blog, as well as the rosner.net.nz site, is hosted on the solar-powered server. The idle plaything of a mad electronics hobbyist...
Aside from updates to the system, I'll also add other posts and links to interesting use of either Solar or Raspberry Pi hardware.
This blog is hosted on the solar-powered Raspberry Pi server
Click on the categories on the right to get started, or scroll down to the next post for more details on the system
This page describes the project to build the solar-powered web server this site and the rosner.net.nz sites are running on.
A Solar-powered Web Server?
Correct. The server this site runs on is 100% solar-powered. Solar panels running the server and charging up a deep-cycle battery during the day, the battery runs the server at night.
Why not? Some things, because they can be done, they must be done. The site is hosted on a small low-power computer called a Raspberry Pi. Previously the rosner.net.nz site had been running on the Raspberry Pi using a power adaptor, so the idea of solar-powering it seemed like a good extension of the idea.
What is a Raspberry Pi?
The Raspberry Pi is a tiny computer, about the size of a credit card. It is a very low-power device that can be run from a phone charger or similar small power supply. Its power needs are small because it is a very low-power device; any smartphone will have more computing power than a Pi.
The Raspberry Pi is a remarkable little device. Full GNU/Linux computer, using a SD card for a hard drive.
The Raspberry Pi has taken the world by storm. Robust, reliable, inexpensive, versatile, there are lots of ways to describe it, all positive
Having previously run the rosner.net.nz website on a Pi, the idea of returning it to its original host, but building a 100% solar power system beckoned. This involved designing the system, shopping for parts, and putting it all together.
This page deals mostly with the build of the solar power system - since the Pi is essentially a small GNU/Linux computer, the Linux aspects of configuring the web server were pretty much the same as a conventional computer.
Shopping for parts
The first order of business was to work out the size of the power system needed. The plan was to put up a solar panel outside, use it to charge a 12V battery, and use the 12V battery to power the Pi.
The Pi needs 5V - its power lead-in is a Micro-USB socket, allowing the use of a phone charger. So the idea was to get a car mobile phone charger, run that off the 12V battery, and power the Pi from it.
I did some web research including looking at other similar projects, to decide on the size of power system I needed. It was important to consider winter days when the sun is not shining for around 15 hours in the day; the battery should have sufficient reserve capacity to get through a winter night.
The parts needed to turn this plan into reality were:
- Solar Panel and mounting brackets
- Charge regulator
- 12V battery
- USB power supply
- Cables, connectors and fuses
Jaycar in Wellington had all the parts I needed in stock, so an early-morning visit resulted in a bootful of parts for this project.
Here's the collection of parts, which was around $300:
Building the system
The next step was to put the system together. First problem was that the mounting rails for the solar panel had holes in the wrong place since it was actually for a different panel. Out with the drill...
Next, a suitable North-facing location (yes, North... I'm in the Southern Hemisphere!) was determined that gets a lot of sun, in winter as well as summer. As a bonus, this is clearly visible when approaching the house, so it says something about the attitude to renewable energy sources of the occupants.
The bracket allows for easy tilting of the panel, so that its angle can be changed with the changing of the seasons, to maximise energy collection.
Cables had to be neat and tidy, to keep the installation looking good and to minimise risk of damage. A Staple gun and Cable (zip) ties were employed to run the cable under the fenceline overhang.
The completed System
The completed system looks like this:
And then the Raspberry Pi was configured with Apache, it was given a 32GB USB stick to act as its public_html directory, Samba was set up so I could talk nicely to it from my Windows machine, and ddclient set up for DynamicDNS since my nice 100/50 fibre internet connection doesn't offer a Fixed IP address.
It remains to be seen how the system will work given a few days of cloudy weather, and whether the shorter daylight hours in wintertime will cause a problem. As we're in Spring at the moment the days are getting longer, so the experiment is a work-in-progress. Stay tuned!
Usage Results and updates
See results pages and updates
Major parts only - cable, connectors, etc. not included
- Solar Panel - Jaycar ZM9094 $94.90
- Mounting brackets - Jaycar HS8785 $74.90
- Charge regulator - Jaycar AA0348 $35.90
- 12V battery - Jaycar SB2487 $49.90
- USB power supply - 1A Car USB charger, random type, around $5
- Cables, connectors and fuses - Fuses are important, you can start fires with SLA batteries!
Plus the Raspberry Pi and a USB stick for its hard drive.
(Skip this unless you are a total nerd. Actually you're already a nerd if you're reading this)
Power requirements: Online research as to the power consumption of the Raspberry Pi was inconclusive. The Pi's documentation warned that USB ports "probably" wouldn't be able to supply enough power. The USB spec calls for an upper limit on the power available through a USB port at 500mA. At 5V, this is 2.5 Watts. There are also anecdotal reports that people have run it from a USB port. So if it needs more than 2.5W it's not much more.
So, I decided to measure it. I measured the draw on the 12V side, as this would allow for the inefficiency of the USB power adaptor as well, and give me an accurate idea of battery drain.
The drain measured at 220mA at 12.6V - which equals 2.8 Watts.
The battery is rated at 9Ah.
So, 9Ah X 12V = 108 Wh (Watt-hours) - this is our battery capacity. This means (theoretically) - it could deliver one watt for 108 hours, 2 watts for 54 hours, 3 watts for 36 hours, etc.
In an ideal situation then, the fully-charged battery would run the Pi for 36 hours before being exhausted.
Of course, there needs to be a fudge-factor, or to put another way, the battery tax-man will have his cut... the tax in this case being the cumulative effect of inefficiencies and margins-of-error. So let's be pessimistic and say this battery could run things for 24 hours.
Another possible factor is that the battery's capacity isn't exactly linear... the battery's capacity is quoted as a fairly low level of discharge. The faster you discharge a battery, the less total power you'll get out of it before it's exhausted. Think of it like the opposite of filling a bucket - fill it with a firehose and you'll only get it part-full, but fill it very slowly and it'll take longer but you'll get much more water into it.
Likewise, drain a battery slowly and you'll get all its charge out, drain it fast and it'll give up long before it's actually empty.
Luckily in this case, we are discharging the battery at a very low rate, around 1/40th of its rating. Most batteries have their capacity rated at the "C/20" rate - or put another way - the capacity if discharged at 1/20th of their rated maximum. This means we will not lose any battery capacity due to high rate discharge inefficiency.
OK, I've kept it simple for you so far. Now we get techy. We're going to talk about Discharge Curves.
Check out this graph, note especially the "C/40" line, as that most closely matches our usage here:
From Home Power Magazine, Sep 93
This gives us a useful way to assess the battery's state of charge based on its voltage.
If the Pi is drawing a constant 2.7 watts, and the solar cell is producing 20 watts, then it means the excess energy not used by the load is available for charging the battery, to get it through the night, when there's no solar generation.