Jonathan Evans wrote this useful tutorial for connected digital world.
In this tutorial I’ll show you how to construct a wireless motion sensor and interface it to a Raspberry Pi minicomputer. I’ve detailed two options that both work very well and have long lasting battery power consumption. The first option involves hacking a key fob remote that has four buttons. We will use the remote to send a signal every time the motion detector senses motion. The four buttons of the remote gives you the ability to run 4 wireless motion sensors.
The second option uses a much more sophisticated, but low cost, RF transmitter and receiver made by Ciseco. Ciseco have developed firmware that can be loaded onto the RF modules to give them different personalities (temperature sensor, button, hall affect, relay etc…). The XRF is more expensive than the key fob but it offers much better transmission distances that will penetrate walls a lot better than the key fob remote. The XRF also has the ability to send battery levels and operate different networks that give you an almost limitless amount of sensors that can be connected to the Raspberry Pi.