PDA

View Full Version : Web based automation courtesy of Raspberry Pi



wraggster
July 17th, 2013, 23:01
http://hackadaycom.files.wordpress.com/2013/07/web-based-automation-via-rpi.png?w=580&h=321
This project is a great example of the Raspberry Pi’s ability to eclipse Arduino when it comes to interaction. [Fall Deaf] mentions that he used to use an Arduino board with an Ethernet shield to add extensible interactivity to his project. But this one, which is a home automation lamp project (http://falldeaf.com/2013/07/the-pi-control-script/), uses a Raspberry Pi instead. The concepts end up being very similar. But the cost of the hardware is less and the coding work is arguably orders of magnitude easier.
Don’t get us wrong, the hardware is fundamentally different. When you move from Arduino to RPi you lose some I/O pins and the low level control of them isn’t quite as straight-forward. But you also don’t have to program the thing in C. The Linux kernel handles the low level control which means you can write your scripts using Python. Because Python is an interpreted language the testing and debugging is much faster — no need to flash new code, just run the script again.
This project used the RPi GPIO to drive a strip of LEDs which use the WS2801 protocol. The board includes a NIC which makes it a snap to use as a web server. The smart phone controls seen above are served up from the Pi using jQuery. Right now there’s a cord running out of the lamp. But there should be plenty of room to use a screw-in outlet adapter and to hide the RPi and its PSU inside.
The board still has enough juice to drive other automation features too, like acting as a web radio server (http://hackaday.com/2013/03/14/raspberry-pi-as-a-spotify-server-with-mpd-control/).

http://hackaday.com/2013/07/12/web-based-automation-courtesy-of-raspberry-pi/