Hardware Reference
In-Depth Information
For energy usage, the OWL system has received compliments of late, particularly as it is possible to connect its Owl
Sensor Receiver to a Raspberry Pi and recover the data. The project detailed at http://www.raspberrypiusers.com/?p=7486
shows the simplicity involved, thanks in part to OWL multicasting its data to the network, allowing you to open a socket and
retrieve data with the Pi's language of choice, Python, using code such as:
import socket
import struct
MULTICAST_ADDRESS='224.192.32.19'
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1)
s.bind(('', 22600))
mreq = struct.pack ('4sl', socket.inet_aton(MULTICAST_ADDRESS), socket.INADDR_ANY)
s.setsockopt (socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
buffer = s.recv(800)
Proximity Sensing
For those wanting the Raspberry Pi to play a more serious role in a smart home, the BlueProximity project
( http://blueproximity.sourceforge.net ) provides a means to automatically lock, and unlock, an X Window session
based on how close your Bluetooth-enabled phone is to the machine in question. Naturally, this doesn't need to be plugged
into the machine you want to lock! You can place a Raspberry Pi, and its Bluetooth unit, in the doorway of the den, or by the
front and back doors. The simplest way of sending messages between machines involves an HTTP GET request from one to
the other, and a small script checking for the correct parameters (as they should include a password of sorts.)
This idea can be extended by using several proximity sensors placed around the house, to work out an
individual's location. To facilitate this, work is underway on a version 2.0 of BlueProximity which will monitor the
Bluetooth signal strength on several different machines, and use this to deduce your location.
This location information can be used to target feedback messages and alerts to your current location. So if, for
example, the software has detected you're in the living room it can display the message on your TV screen. By being
able to target specific devices in this way eliminates the need to send all the messages to your phone. Also, it allows
to you use your phone as a remote control that can intelligently target whichever device is closest to your current
location. As I say, this project is still in development, but has potential, and is an excellent example of a solution that
would not otherwise be possible if the controlling PC was much larger, or more expensive, than the Raspberry Pi!
Coffee Machine
In the 1970s and 1980s, a teasmaid was the middle-class gadget du jour! At night you'd fill the machine with water and
tea, or coffee, and set the alarm for the following morning. Then, acting like an alarm clock, it would automatically
make your first cuppa in the morning. Through the X10 project we covered in Chapter 2, this is now again possible.
But with the Raspberry Pi capable of greater control opportunities, its scope can be improved.
The benefit of a Raspberry Pi over X10 is that you can have a feedback loop from the teasmaid to a web page,
and you can control more parameters of the device, since the modern espresso machine has a multitude of buttons
for the different coffee types, it isn't enough to just switch on the power as it is for a teakettle. As an example of this,
Shawn Wallace and Matt Richardson built a Raspberry Pi-controlled coffee machine, as covered at
http://blog.makezine.com/2013/02/11/raspberry-pi-for-web-initiated-coffee .
Search WWH ::




Custom Search