Raspberry Pi Helps With 2.4GHz Home Automation

Wanting to extend the capabilities of the radio frequency devices in his home [Kalle Löfgren] turned a Raspberry Pi into an RF control hub. We’ve seen some of his home automation work in the past. In his media room he built a universal remote base station which used the same RF board as in this project. The main difference is that before he went with an AVR microcontroller and this time he’s upgrade to a Raspberry Pi board.

The RPi brings a lot more to the table. Notably, the scripting (whose output is shown above) and networking features. His radio board is an nRF24L01 which he talks to via the SPI protocol. The Raspberry Pi has no problem talking to SPI devices through its GPIO header. [Kalle] just needed to do a bit of setup to configure the pin modes.

A Python script lets him sent commands using his keyboard, but this can also be automated. Combine that with the TCP server script he wrote and it opens up the a wide range of configurations to switch or talk to any device operating on the 2.4 GHz band.

15 thoughts on “Raspberry Pi Helps With 2.4GHz Home Automation

    1. What is the benefit with wiringpi2 over Quick2Wire? does it come with the python API as well?
      The nice thing with the python code, is that it is very simple compared to the other c-based codes i have seen out there, like this one: http://arduino-for-beginners.blogspot.se/2013/02/setup-nordic-nrf24l01-rf-modules-to.html
      The pyton code makes is very easy to setup for different configurations, since it only depends on this one py-file!

      Anyway i find the quick2wire python API to be very easy to work with!
      Hope it can help someone out there..

      1. It just seems as though wiringPi is much more adopted. As well, instead of whitelisting the SPI module, you can dynamically load it from the command line using “gpio load spi”.

        wiringPi-python provides the bridge over to Python. SPI performance has been fantastic on it.

        That guide does seem brutal. Assuming the SPI on the NRF24L01 is well documented, it wouldn’t be that hard for us to write a library for it :)

        Thanks for posting your guide. I’ll have a look at it this weekend to see if I can optimize any of my projects. All I have right now is my OLED weather station which polls Environment Canada every 15 minutes.

  1. I’ll need to try this out, been playing with the nRF24L01 modules and Arduino for a while. Time to try it with an RPi. BTW, the little nRF24L01 modules cost less then 2$ a piece from China.

  2. I’ve got a rPi listening for data from a bunch of arduinos around my house – see here : https://www.rmhome.co.uk/pi/ – The arduino’s are a mix of protoboards, rFU 328’s (from Ciseco) which send their data every 60 seconds. I’ve also added a 433MHZ radio for controlling my LightwaveRF devices (light switches) which seems to screw up some of my nodes… working on that.

    It’s running as a c++ app that my node.js app spawns and controls via STDIN/STDOUT. I’ll need to post up some more detail though since I don’t have a blog ready.

  3. Looks like everyone is doing something similar. My setup is based on JeeNodes and 433MHz senders to control light switches, then bridge to my older wire based bus devices, and a few Arduinos here and there. RasPi could be a nice next generation of the project.. but I should finish this one first! :)

  4. So “everybody” is using these nRF24L01 modules. But just how far do they go? Let’s say in a house with concrete walls and with at least one WiFi router/access-point running? I’ve been following this module for awhile but I’ve never seen any real-world range test results.

    1. I would love to see a performance test on these little modules! My experiences is that when transmitting at 1 Mbps the transceivers can go through thick concrete walls and reach ~5-10m.
      When I use the 250 kbps mode (nrf24l01+), and with a simple antenna (http://www.ebay.co.uk/sch/i.html?_nkw=nrf24l01+pa+lna+1000m&_sacat=0&_odkw=nrf24l01+pa+lna+1000&LH_BIN=1&_sop=15&_jgr=1&_fcid=192&gbr=1&_osacat=0&LH_PrefLoc=2&_sc=1),
      I have a link that manages 2 concrete walls (at an angle) and reaches 250m to my car, to control the engine warmer…

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.