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
- 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