I was looking for an option to use the GPIO Pins with Perl directly. Thanks to Gordon the solution was pretty easy with the wiringPi framework and the perl wrapper wiringPi-Perl created by Gadgetoid. Gordon also created the useful PIN mapping overview which I used for my own table shown below which also includes the translation to the Ardafruit T-Cobbler.
Inspired by the Nest® learning thermostat I want to improve the HomeAutomation capabilities of the Raspberry Pi by adding some sensors to enhance the functionality.
Temperature and humidity sensor
To measure the rooms temperature and humidity and to control the electrical valve accordingly. The reason to choose the sensor DHT22 over the DHT11, is the much higher precision. For example for temperature measures: ±0.5°C accuracy (DHT22) vs. ±2°C accuracy (DHT11). To my believe ±2°C is not acceptable for steering the temperature in a room.
Temp/Hum Sensor (on the right hand side) already hooked up to the T-Cobbler on a breadboard
The Pi should be able to notice whether someone is in the room and regulate the temperature accordingly. Over time the server should be able to build a schedule and maintain this schedule. I’ll use this sensor from adafruit.com
IR distance / proximity
With this sensor the server should be able to detect a human being close to itself and enable interaction by making the user inteface available. For the time being I will work with the Sharp GP2Y0A21YK0F and may move to a DIY version later on.
One great feature of the Raspberry Pi is the extendability via the GPIO pins. I’m using a case around the Pi, while this is a good solution to avoid issues with shortcut circuits on the other hand the access to the GPIO is more complicated and involves in almost all cases disassembling the enclosure. Luckily I found the solution for me on the adafruit.com website, the Adafruit Pi T-Cobbler Breakout Kit for Raspberry Pi.
A closer look at the PCB shows how nicely the cobbler transfers the GPIOs to the breadboard. For me this better overview is the major advantage of the T-Cobbler over the standard cobbler from Adafruit. Please also note that the changes between the Raspberry Generation 1 and Generation 2 are reflected properly [PIN #21 (v1) vs PIN #27 (v2)].
Finally my Raspberry Pi has arrived and I want to use it as the server for the perl based HomeAutomation server fhem http://fhem.de/fhem.html.
For the fhem set-up I followed the installation instruction as described under http://www.fhemwiki.de/wiki/Raspberry_Pi and this worked like a charm
The installation of the culfw firmware was a bit more tricky, but with the following steps I was able to flash the CUL to the latest version.
Download the firmware
sudo wget http://culfw.de/culfw-1.46.tar.gz
and unpack it
sudo tar -zxvf culfw-1.46.tar.gz
Change into your device directory (e.g. Devices/CUL)
Install the package dfu-programmer
sudo apt-get install dfu-programmer
Insert the device into the USB slot while pressing the micro-switch
sudo make usbprogram_v3 V3 to be used for CUL V3.
After flashing the CUL, a new USB device should appear: “03eb:204b Atmel Corp.”. If not re-insert the device without pressing the micro-switch.
The server is now up and running since several days. For the time being the server is just listening to the FS20 traffic in the air and logs it.
I want to control the FHT8v directly from this server without the need to use the FHT80b device which is originally intended to steer the valve controller. Normally this should be straight forward but a first test was not successful. I will publish the results once I have it running.