This project began when I realized that the large roller shade I installed did not have an automated network interface for control. I have two other shades that can be automated via an iOS app.
I found an excellent guide / howto writeup on the OpenRemote website: How To - Control Sunshades - Somfy-Telis with Raspberry Pi that provided a majority of the hard work including the wiring diagrams and GPIO pin outs for the Raspberry Pi. This solution is closely modeled after the work there, but I'm not using the OpenRemote project (yet).
Here is the shade I wanted to automate:
It's a Motorized Flexshade by Draper (with E-Screen, 3% OF, Koolblack fabric, quiet motor) and an aluminum fascia. It included a single wireless RF receiver. I ordered an extra remote so that I could automate it. This remote is called a Somfy/Telis and can be configured to control a single device:
After removing the cover from the remote we can see the buttons:
The way those buttons work is that when pressed, they make a connection between the two pins. So to automate, all we have to do is connect those via a switch. To test this, you can simply "jump" or complete the connection between the two pins with a piece of wire to trigger the button press.
To truly automate the solution, we'll need to use something called an octocoupler or photocoupler (see: Understanding Octocouplers). It looks like an integrated circuit, but acts like a switch or relay. When you send a "high" or "on" signal to one of the pins, it will "complete" the circuit on the opposite pins. It's designed to isolate circuits from one voltage to another to another different (usually high to low). The Raspberry Pi operates on 5V and can send out 5V (or 3.3V) high signals, while the Somfy/Trellis remote uses a very small battery (I didn't even measure the voltage).
I used the wiring diagrams from the OpenRemote site to create a breadboard version of the circuit. Here's my diagram (very similar):
Here's the completed circuit using the Pi Cobbler breakout board and cable:
I then cut out a small square to let the wires come through so now we have our own breakout wires (and the remote still works, too):
The finished product:
To allow remote control and automate the raising and lowering of the shade, I wanted a simple web application so I could use any device (iPhone, iPad, or just a computer). I'm a big fan of lightweight REST(-like) webservices, so I decided to use Sinatra, a very lightweight ruby framework for building web applications.
The web app works on the concept that if you hit the URL "/up" it will send the command to raise the shades, similiary "/down" and "/stop" will send the commands. I put some buttons that trigger those commands, and it's quite zippy to press the button -- since it simply presses the button on the actual remote.
The code is on github here at Remote Shade Control App. The meat of the code involves shelling out to run the GPIO.sh shell command:
The web app also is fully automated and allows for automatic operation (closing and lowering based on sunrise and sunset) thanks to some clever ruby libraries.
Check out the README for more information, and the full test suite.
Here are some of the parts and estimated prices.
Here's the full album of the build on flickr: Shades Automation on Flickr.
Back to seebq.com.