Home Automation with a Raspberry Pi and an Arduino.
The Hardware:
Using an Arduino Uno and a few cheap sensors we can receive data about the environment around them, giving you a visual representation of your home's
readings. The Arduino can also receive commands to control any relays or other outputs connected to the microcontroller, letting you gain control of your lighting and other electrical systems all on the one device.
The Arduino is limited in it's capabilities and it depended on another machine to do some of the processing. To combat this we have the Raspberry Pi acting as a server for the Arduino which connects to it over a usb-serial interface. This gives the system much more computing power and allows for much more functionality and mobility for the Raspberry Pi as it only requires a power supply and a network connection to run once the system has been fitted in the home.
The Software:
The Arduino loops a C program which collects all the data from the sensors as well as sends commands to the output pins on the Arduino. This data is sent over the serial port while also reading the incoming bytes sent from the Raspberry Pi.
The Raspberry Pi runs the Raspbian Wheezy distro which boots straight into the command line with SSH access enabled to allow remote access over the local network using PuTTY. The Raspberry Pi runs as both a client and a server so the majority of the work is happening here.
To connect with the Arduino, the Pi uses Python scripts which import the PySerial library among others to process,send and receive data over the serial connection.
A LAMP web server is served up by the Pi which gives the user a nicely designed web application that displays data from the MySql database as well as providing the user with controls to send and receive data throughout the system.
The Goal:
Create a system that is low-cost, but highly functional.
One that works, and works well.
Something that completes complex tasks with a simple design.
Make it ultra plug and play and easy to retro-fit into existing buildings.
-Conor

No comments:
Post a Comment