Upgraded version of the Arduino Roller Shutters / Roller Blinds Controller

It took a while to get all the components for the final version, found a little free time to etch the PCB, solder everything together, test the final version and shoot some pictures but it’s worth the result!

(Note: the on screen display language is Dutch)

2015-04-16 11.50.25

Final result of the controller

The controller is a mobile battery powered device, it can be placed everywhere! No longer dependent from power-consuming power adapters!!!!!

Battery value is measured automatic and gives an indication when to recharge the controller. The operating periode is about 2 to 3 weeks with two re-used 6 years old lithium ion 18650 batteries from an old laptop battery pack. The remaining capacity is not much but good enough for this application.

The OLED display consumes the most power. OLED stands for organic LED, this means the display continuously emits light and is easy to read in the dark. The “most” power is a couple of mA’s but this is a lot against some other LCD displays (some µA’s).

The Arduino runs on a 8Mhz clock, with the necessary power saving functions it runs on a couple of hundreds µA (Note: the red power led on the Arduino Pro Mini is removed!), with the OLED display (and all the remaining electronics are negligible) it’s only mA’s of power consumption in total.
That’s battery friendly i guess 🙂

The overall operating voltage has to be between 2,7V and 5,5V for correct functionality. (battery protection auto. shutdown voltage at 2,5V)

Some features of the controller:

2015-04-16 11.48.07

Time schedule of 5 shutters (open/close)

2015-04-16 11.47.38

Option to choose between stored time or light sensor based (with adjust value: lighter/darker) closing of the rolling shutters

2015-04-16 11.47.22

Example: setting and storing time open/close for Rolling Shutter 1

2015-04-16 11.46.34

Setting and storing the day, month and year

The controller has a menu to adjust, change and store:

time (hours: 0 to 23, minutes: 0 to 59)
day (1 to 31)
month (1 to 12)
year (2015 to 2099)
day of the week (Monday, Tuesday, Wednesday, and so on)
random range in minutes (when time is set to 8:00 and random range is 10 minutes: the shutters will open between 7:55 and 8:05)
light measurement adjustment (threshold “dark” value for light sensor)
all roller shutters have there own open/close hour (accuracy is 1 minute, for instance 8:16)
enable/disable channels (for instance if you have a door, you can disable that channel so you can still re-enter. That would not be possible if the shutter was closed!!!)
automatic/timed shutter closing (the option can be “Time” of “Light”, Time means stored time and Light means sensor based)

Note: the time, day, year, .. are kept by the DS3231 Real Time Clock IC and when powerless, powered by the 3V coin cell (= memory function)
Note: other parameters are stored permanently in the Arduino’s EEPROM

The printed circuit board in detail:

The PCB is made in 2 stackable boards, the bottom module is the Arduino Pro Mini 3,3V controller with a LiPo Fuel Gauge from Sparkfun, Lithium ion battery charger module with battery protection for charging and discharging (with shutdown when the voltage drops below 2,5V for no battery damage), a ON/OFF master slide switch, reset button and battery connector terminal.

To recharge the module, simply plug in a micro USB cable. The charger board has 2 on board indication leds: RED: charging and BLUE: charged.

2015-04-16 11.44.12

Bottom module

The top module has al the features for time keeping (DS3231 IC in the middle of the board), light measurement, switching capabilities, 5 input tactile push buttons for navigation in menu & settings and the OLED connector for the 1,3″ OLED display. At the top of the module is the connector for the Niko Easywave remote control.

2015-04-16 11.40.41

Top module (picture without OLED display)

Side view
The side view of the controller, the headers are default 2,54mm headers. The male headers are 17mm long in stead of the 10mm usual. (because the 3V coin cell backup battery for the RTC on the bottom of the top module)

2015-04-16 11.41.30 Side view of the controller

2015-04-16 11.43.46

 Bottom side of top & bottom module (with 3V coin cell on the left board)

Following pictures are the bare PCB’s

2015-03-18 13.39.192015-03-18 13.39.41

That’s a short overview of the controller, more detailed information about the working and components can be found in the previous post of the “prototype” of the controller.


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)

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

Prototype in action!
Video coming later!