Arduino Roller Shutters / Roller Blinds Controller

The Arduino Roller Shutters Controller is an Arduino Pro Mini 3.3V based device to automate the roller shutters / roller blinds.

My current setup for the control of the roller shutters / roller blinds is a Niko Easywave system with multi channel 868,3 MHz remote control and built-in wall receivers. This remote controller has only buttons and no possibility to set a time for automated functions.
Unfortunate in the Niko Easywave series there is no affordable alternative for automatisation so I decided to make my own custom Arduino home automation system. Here is an overview of my controller:

Niko Easywave Prototype Final

The home made controller

Pro Mini

Arduino Pro Mini used for the controller

Rolling shuttersRolling shutters (picture only for demo)

Niko materials: 
Niko Easywave build-in receiver for shutter control: product 05-333
Niko Easywave remote controller with 4 channels and 13 buttons: product 05-312

Niko 05-333 Receiver     Niko 05-312 Remote    2015-02-26 13.32.43 aangepast

For more information about the Niko products: http://www.niko.eu

The research, 868.3 MHz is a no-go:
The radio frequency is 868.3 MHz, not a very often-used  radio frequency.
The best solution would be to generate codes on this frequency in combination with a transmitter for the Arduino. But I was unable to successfully copy the transmitted codes or generate compatible codes. The receivers are self-learning so I also tried to learn them my codes but this didn’t work ether. So the used protocol stays a mystery.

Arduino “push a button”:
After that I decided to design a circuit so the Arduino can “push a button” on the remote.

With a direct digital output/input from the Arduino you can bypass a real switch, witch in reality equals a “push” on a button. In my case iI wanted to keep the 2 systems completely separate. In this way I can’t damage the original remote with any external voltages.

After some measurements and research on the PCB of the remote I connected wires directly to the buttons and brought them out with a pin female header connector so I can easily disconnect the remote when necessary.

The “push” circuit is very simple and based on optocouplers I had laying around, the circuits are separated with an optical coupling. An optocoupler is a LED and photodiode in the same package. When current flows through the LED, the resistance of the photodiode decreases. This means no VCC of GND signal is connected. This also means the original battery has to remain in the remote to power itself.

Optocoupler diagram

Outputs required for controlling the remote:
On the remote there are in total 12 buttons who need to be “pushed”, so 12 optocouplers and 12 digital outputs are required. On a regular Arduino Pro Mini 3.3V there are not a lot pins. Well, this may be a problem considering what’s used in this project:
The Atmel ATmega328P has only 32 pins with 22 I/O pins configurable.
In reality these are not all digital outputs, some are analog input only like pin A6 & A7 and cannot be used as output.
Pin D0 & D1 are the TXO en TXI programming lines and should be left alone if possible.
Finally there are the data lines: I2C (A4 & A5) [Needed for RTC] and SPI (D9, D10, D11 and D12 mostly) [Needed for OLED display]

This means I have 12 outputs and 2 analog inputs left for general purpose.
Good luck I only needed 12 outputs! These were all used for controlling the remote.

This also means I have 2 analog inputs left at the moment.

Time keeping made easy:
A feature of the controller is the function to keep track of the current time without loosing it when powered down. To solve this I used a RTC (Real Time Clock) DS3231 module. This module does al the time keeping including date and year. All I need to do is process and manage the time. When the module starts up it reads the current time stored in the module, from that moment the Arduino works interrupt based by counting the hour, minutes and seconds passed. To keep the time correct the Arduino synchronizes once a day with the RTC to get the exact time because the time shifts a couple of seconds a day.
The module is connected on the I2C data line (SDA/SCL) and has a 3V cell as backup voltage to remember the real time.

DS3231 RTC

The DS3231 Module

A small OLED display:
A standalone device without any way to display information is not very handy. That’s the reason i chose to add a small 1.3″ SPI OLED graphics display. The display has 128×64 pixels and can be used for graphics, not only text. It uses SPI to communicate with the Arduino on 4 general-purpose  I/O pins. I chose the default software SPI pins: 9 (MOSI), 10 (CLK), 11 (DC), 12 (CS).

Niko Easywave Prototype Screen

What about controls for the display?
Because I only have 2 analog inputs left and I need more than 2 buttons to use the controller I was forced to use a resistor network in combination with tactile switches to detect any inputs. I chose for 5 tactile switches, this is the most users friendly for this application.
The buttons are read by ADC (Analog to Digital conversion) and processed in the Arduino to decide which button was pushed.

Tact Switch

Extra feature: Photodiode for light measurement!
After a while I came up with the idea of using a photodiode to measure the light intensity. This “sensor” looks like a ordinary 5mm LED (located next to the OLED display), is also read by ADC and is connected to the very last available pin on my Arduino Pro Mini 3.3V. The Arduino processes the value and now can be used for an automatic light intensity closing.

A short specs overview:
– Arduino Pro Mini 3.3V (8MHz)
– 1.3″ SPI OLED display (128×64 pixels)
– RTC DS3231 Module
– 5 inputs switches
– 12 outputs
– 12 optocouplers
– Photodiode

Total expenses:
Less than 15 euro everything together. This is really cheap compared to those expensive home automation controllers. Off course there are a lot of hours researching, developing and testing witch you don’t have when you buy a system.

The big advantage of building your own controller is that I can do anything I want, that’s not possible with bought stuff.

And this is the result:
The device is still a prototype and made on pieces of stacked breadboard. In the future the device is getting it’s own PCB with Lithium-ion battery power supply. That’s off course the main reason the 3.3V Arduino Pro Mini was used.

Niko Easywave Prototype Final Arduino Pro Mini 3.3V (8Mhz), RTC module DS 3231 and OLED display with 5 buttons. 

Niko Easywave Prototype Final

Remote connected to the controller

 And this is how the remote is modified inside:

Niko Easywave Remote inside

Power consumption:

At the moment the controller can operate between maximum 5.5V and will still work to a minimum of 2.8V to 2.7V. This is ideal to use with a Lithium-ion battery.
On 5V the measured current is 15-20 mA
On 3V the measured current is 10-12 mA

For example, on a single 18650 3,7V Lithium-ion 2600 mAh cell the controller should work between 5 and 10 days in theory.

Note: with a optimized Arduino code you can get even better battery life. (I did nothing in the Arduino code to save any power)

Software:
I’m not planning to post the code. But questions are welcome.

Prototype in action!
Video coming later!