One of my current DIY projects: Build a can solar air heating panel for the summerhouse.
I mounted the cans so they are “floating”. I.e. not touching anything but a few supports. This is to avoid any heat to be lost from heat transfer to a colder object. Then placed all the cans in an isolated box with a reflective surface on the inside so any sun rays passing next to the cans are reflected back up on the can from below instead of heating up the box. The whole thing is covered with a sheet of 3mm UV-stable polycarbonate and carefully sealed with silicone so no water goes where it’s not suppose to.
Status May 2014 is that the solar heater has been assembled and the initial function tests has been performed. The prototype for the control is also assembled. 1 Raspberry Pi. 3 onewire temperature sensors. 1 Pecan relay board. 1 luminosity sensor (for fun) there is a complete parts list at the end of the post including links to products. Combined the prototype assembly of the above ended up looking like this 😉
Pretty? Nope. But it does work.
Check out how easy it is to set up and use the DS18B20 digital 1-wire temperature sensors here. Note that you can have a number of these sensors connected in parallel(!). They are just individually addressed by their unique serial number. Very nice 🙂
The Pecan relay does not require any setting up. It simply works with the RPI’s GPIO Pin # 25, 17, 27, 22, 23 and 24. And then a connection to ground (GND). The relays are opened and closed using any GPIO access library. Of which I will recommend WiringPi. Setting e.g. pin #22 to high (
gpio -g write 22 1) will close the relay. And setting the same pin to low will open the relay again:
gpio -g write 22 0. Easy. The Pecan relay board does require its own power supply since the relays draw a bit too much power to be run from the Pi’s 5V line. But you can set up the relay board such that the Pi is powered from the Pecan board. Effectively this means that you still only need one power source. Just make sure it’s one with sufficient power. 1A should do fine.
When you have these two things talking to your Pi you are pretty much ready to start coding.
I have build a web interface for the solar panel using the brilliant Internet of Things framework WebIOPi for Raspberry Pi. I love the simplicity of getting software and hardware to interact and the ease and flexibility of linking stuff to a web interface with some Java and HTML and whatever you like :o).
I found it to be a rather steep learning curve getting familiar with how WebIOPi works. But once you grasp the concept it is really easy and powerfull. So stick with the tutorials on thier project page and you will quickly learn enough to start having fun with it.
Unfortunately I have found the python bit of WebIOPi somewhat unstable. It will crash after a few hours of running regardless of what I have tried. The debug output gives some hint that it is the 1-wire sensors which from time to time output very low values and that is giving some problems. I couldn’t be bothered with trying to fix it so I gave it up for now (but looking very much forward to the next release!). Instead I am running a shell script once every 10 min which stops the WebIOPi daemon then runs a stable python script to check the state of the sensors and set the fan to On or Off. Lastly starts WebIOPi again. I.e. shell script looking like this:
sudo /etc/init.d/webiopi stop
sudo python mypath/solar_panel.py
sudo /etc/init.d/webiopi start
Save this into a run.sh file using:
sudo nano run.sh
Lastly set crontab by
crontab -e to run every 10 min:
And now go check out the cool web interface I made with WebIOPi!
You can view the source of the interface script (index.html) by right clicking on the page and choosing “view source”. The script.py for the WebIOPi I just left performing nothing. So it want mess anything up. You can’t have any GPIO access libraries running at the same time as WebIOPi. That is why I close it down before running the python script as this uses the mentioned GPIO access library WiringPi.
The solar panel is to be mounted on the roof of my summer house and a fan is drawing in the hot air from the array and into the house. Schematically the whole thing is shown below. T-out is the temperature of the outlet air from the solar panel. T-in is the inlet temperature (i.e. the outside ambient temperature). T-room is the inside room temperature.
Control thingy is quite simple:
- Turn the fan On when T-out is 10°C larger than T-room.
- Turn the fan Off when T-out is less than 5°C larger than T-room.
- Turn the fan Off when T-room is larger than 22°C
Some photos of the building/assembly/installation process:
Parts list for the prototyping.