ScR4tCh
homectrl – a raspberry pi based home automation gateway
Hey this is the introduction to a project of mine, to build a cheap home automation gateway using a raspberry pi. The gateway is (for now) capable to control 433mhz outlets and has a small touchscreen to control things directly in the future.
parts
- Raspberry Pi Model B (rev 1) —- desoldered composite out
- Adafruit Pitft
- An universal housing box (found at my local electronics dealer 120×70×30 mm)
- Edimax nano usb wifi dongle
- 32g SD-card
- 18 “wire” flat cable (scavanged from an old usb expansion from my “i'd use it somewhen in the future” box)
- f-f jumper wires —- cutted – soldered the connectors to the flat cable
- 4 tactile switch buttons
- 433 Mhz sender module (the cheap thing … have a look at ebay)
- 3 mini leds (green) + 3 resistors
- shrinkable tubing (isolate soldered connectors / resisors)
- “tons” of hot glue ;)
software
I started off using the raspian wheezy image. The following software/libraries/code is used to provide basic functionality
- pitft kernel link
- rcswitch pi —- provides a binary to send commands via the transmitter to the power sockets
link
- code to control leds (hdd/net) link
- class to control tactile buttons/backlight fot pitft (pitftgpio.py) link
init script to init gpio i/o
/etc/init.d/gpioinit
#! /bin/sh
# /etc/init.d/gpioinit
#
# init gpio ports (to output)
case "$1" in
start)
echo "setting gpio ports to output "
/usr/local/bin/gpio -g mode 4 out
/usr/local/bin/gpio -g mode 17 out
#/usr/local/bin/gpio -g mode 24 out
;;
esac
exit 0
things done so far
- desoldered composite out to fit pi into housing
- drilled and cut holes for display/connectors/switches/LEDs
- cut extra hole for secondary USB port
- soldered antenna to the 433mhz transmitter (see this link).
Overall this little box might not win any award (not for design nor for crafing skills) but it works well since month now :). holes were cur using a cutter knife and a drill ( i had no dremel available back then). Updates follow …