I’ve long had a fascination for renewable energy – be it from wind, solar, or hydro-electric sources. Perhaps it’s just my penchant for penny-pinching, but the idea of free and (virtually) unlimited energy is something I find quite appealing. So, in February of 2009 (wow, has it been that long?) I bought my first SUN 90W, 18VDC photovoltaic (PV) panel:
(As a side note, if that looks like a stock image, that’s because it is. However, it really is a picture of my very own panel and voltmeter. Stock photography is another hobby of mine which I may post on later.)
So, what did I have in mind for this 90W powerhouse? A reverse-UPS of course! What is a UPS, you ask? Well first off, UPS stands for uninterruptible power supply. You typically find these connected to computers, particularly server computers. Their purpose is to continue supplying power in the event of an outage. Essentially they’re fancy battery backup systems that can be switched on almost instantly in the event of a main power failure. Actually, some UPS systems run their inverters continuously and only rely on the mains input to keep their internal batteries charged.
Now most uninterruptible power supplies power their loads via a connection to the mains (120VAC) until an outage occurs. At this point the load is switched over to battery power. My plan for a reverse-UPS was just the opposite. I intended to power loads via solar and battery power until the battery reached a certain level of discharge (~70% of full charge so as to extend the life of my battery), then automatically switch over to mains power.
To accomplish this, I first bought a 63Ah deep-cycle lead acid battery and a SunSaver 15A MPPT charge controller from the Alternative Energy Store. While the MPPT feature on the charge controller did cost me a bit more, I think it’s a big plus, particularly for cloudy winter weather. So far I’ve been very impressed with the SunSaver’s performance:
The next step was to obtain an AC inverter. I considered making one myself (as well as the charge controller), but opted to go COTS for convenience and safety. I may have it backwards, but I generally feel more comfortable using professionally-made devices when it comes to dealing with high voltage and current. (But of course I also fused just about every wire in the system – a very good choice, as you’ll see later.) I also wanted a pure sine-wave inverter for efficiency and smooth SSR switching (discussed later).
So with my battery-backed solar-powered AC source, all I needed was a means of switching between that and line AC. Paralell solid-state relays (SSRs) seemed to be the best solution because of their speed and easy of use. All I needed was an accurate and reliable way of controlling them. For that, I chose a simple 8-bit AVR microcontroller, the ATMega48. This is a great little MCU that can handle plenty of digital I/O and up to eight analog inputs. One of those inputs was wired up to monitor the battery. Several digital inputs went to switches and buttons, and two digital outputs went to the SSRs.
Switching from line AC to inverter AC was actually quite simple. Once you remove the digital “ON” signal from the SSR, it takes at most half an AC cycle to turn off (this is because its current must reach zero before turn-off occurs; see TRIAC). So, for a 60Hz AC source (standard here in the US), that means 8.3ms. To be safe, I went ahead and doubled that figure. So, to switch between relays, the MCU only needs to turn one off, wait about 16ms, then turn another on. Of course, the consequences of getting that timing wrong could be painful, so I was sure to thoroughly stress-test my code and electronics before running a powered test. So far, no fuses have been blown by crossed sources.
Here are a few images of the original completed system (before any revisions):
Yes, it’s made of wood. Pine, if I recall correctly. And yes, wood is flammable. I don’t plan on taking advantage of that fact. The cooling fan is there to keep everything well below flash point. It’s also intended to vent any hydrogen gas that may be given off by the lead-acid battery. Wood does have one plus though: it’s non-conductive.
Below is a close-up of the front panel, where all the user interaction happens. The large switch on the top left connects the solar panel to the charger. The bottom left connects the battery to the rest of the system (inverter, microcontroller, etc.). The left black button allows the user to force the battery to operate even if it’s below 70% of full charge. The right button allows the user to manually command line AC output if desired.
Here are a couple shots with the lid removed. The system measures about 16″ x 12″ x 14″ and, with battery in place, weighs about 40lbs. I don’t remember exactly why we started calling it the “Doom Box” – perhaps it just sounded amusing. I suppose it is a potentially dangerous box to go sticking your hands in…
I’m happy to report that the doom box worked quite well for a number of months. I strapped my 90W solar panel to a lawn chair, weighed that down with a cheap sack of marble chips, and put the whole thing out on my east-facing balcony. The AC output was connected up to an old laptop I run as a server. It draws about 35W continuously. So whenever the sun was out and the battery fresh, the laptop was powered entirely by the doom box. Once the sun moved out of view and the battery discharged to 70%, the box automatically switched the laptop over to line AC.
Unfortunately, given its location, the solar panel only saw direct sunlight for a few hours each morning, but that’s the best I could do at the time. As such the laptop was only off the grid for about 6-8 hours each day. I was also quite surprised at the difference in performance between direct sunlight and cloudy days. Very cloudy days cut down my power input by about 80-90%.
Well since this initial build I’ve modified the MCU to support a greater level of monitoring. Current sensors are now in place and the entire system is programmed to log and report its status via website. I’ve also added a second solar panel and battery. But that’s another post for another time. Stick around for dramatic stories of inverter failure!
Part II of this article may be found here!