My main reason for automating my room was to make it easier to get up in the morning. Here is my wakeup system in a working, but not very sleek form.
It consists of the following modules:
- A Nexa remote controlled power switch pack for the lights.
- A roller blind motor + control panel with RF receiver and a AVR ATMEGA 168 microcontroller.
- A Raspberry PI with a Creative N400 USB speaker and a 433MHz RF transmitter+receiver.
The Nexa system
The Nexa pack i bought consists of one 433Mhz transmitter with 7 buttons and 3 receivers connected to 220V relays. I am only using one receiver in this system.. The receivers are able to “learn” what button they are assigned to. I have four small lamps connected to this receiver. In the future i will connect my main roof light as well. This will require invasion of my 22V electrical system, which is why i am hesitant.
The roller blind controls
The roller blinds are driven by a 12V DC motor with 1,3Nm of torque. The motor sits inside a small box at the end of the roller blind’s shaft. The motor is in turn driven by a DC motor driver circuit, which is controlled by the ATMEGA 168 microcontroller. The ATMEGA runs some simple logic for reading buttons and controlling LED’s, in addition to decoding the 433Mhz RF signals sent from either the Nexa remote or the Raspberry PI. Power is supplied by a standard 220V-12VDC adapter.
The Raspberry PI
The rPI serves as the main control module or “main hub” of the system. It is set up with a 433Mhz receiver and transmitter, which makes it able to communicate with the Nexa system and roller blind controls.
I have made code that samples RF signals and saves them to a file. These files can be replayed at any time, effectively emulating the physical remote.
It plays music through the USB speakers using a software called mpg231. I chose this because its command line interface suited my needs, but i am sure there are better options. The USB speaker setup was done with minor tweaks to the system, i found a guide with a simple google search, but i don’t remember where it is now.
The wakeup sequence, which starts 15 mins before i should get up:
- Play song nr 1
- Turn on the lights
- Play song nr two
- Roll up the roller blinds
- Play song three and four.
- Alarm on my smartphone rings
Future additions
- Set the alarm time from my smartphone using the internet and/or bluetooth LE. (it is set as a cron task at the moment)
- Connect my helicopter launcher
- Add end switches to the roller blinds control mechanism
Have you published the code for recording and replaying radio with the RFM12B module anywhere? I’d love to get hold of it!
Here you go!
https://github.com/anderss90/Home-automation
It uses the bcm2835 lib for raspberry pi. Should be easily ported to WiringPI and similar gpio libraries.
http://www.airspayce.com/mikem/bcm2835/
compile with “gcc inputfile -o outputfile -lbcm2835
Hello, Im interested in the code that is controlling the blinds. Would you mind sharing? Would be an awesome feature for the home theature!
Hey.
The code for the blind control is very quick and dirty, but i have added it to the github repo: https://github.com/anderss90/Home-automation
The code here decodes nexa signals.
Instead of using that code, i advice you to take a look at the sender av receiver code of my tank project. It implements adress bits as well as error detection using checksums.
https://github.com/anderss90/Cardboard_tank
NB: None of these projects are written to be distributed, so the code quality is not very good.
Please ask if you need any explanation or help.
Check out this link for more info on the nexa protocol.
http://dephiox.blogspot.no/2013/01/decoding-new-nexa-protocol.html