Using Arduino to manage shutters
As I have 8 shutters to automate, I need :
- 16 I/O to get each shutter button states
- 2 I/O for the main button
- 16 I/O to give up or down order for each motor
So a total of 34 I/O.
I have chosen to use an Arduino Mega 2560 :
With this Arduino board I have enough I/O. I just need to build a PCB to adapt Arduino’s connectors to my boards.
For this I have created a PCB. This is a really simple PCB, here is the schematic :
I just added a connector to have 2 I2C header.
Here is the PCB I get :
This PCB is directly plugged on Arduino and then I used flat wires to link to all boards.
Arduino is 5Vdc powered, 24 Vdc for relays. So I have added a power supply that is delivering those voltages.
Arduino is powered via its USB connector. Ethernet shield is not necessary, I added it in the case I want to implement a web server to handle shutter via Internet…
Program
Now that hardware is all right, software should be implemented.
What I wanted to do is to drive motors only the necessary time, without any automation, there is a mechanism that limit up and down of the shutter. With the program I would like to put 230V on the motor to go up and down, but when the shutter is arriving at the limit, I want to stop 230V.
I have 3 kind of shutters, big medium and small. I measured time needed to go from up do down for each of them :
Small : 15 seconds
Medium : 20 seconds
Big : 25 seconds.
So after this time, relays should open to avoid having 230V on the motor.
This of course is not necessary as there is some limit implemented in the motor, but as this is easy to program…
Here is the declaration of pins :
// Setup pin number for relays
int pinShutter1Up = 22;
int pinShutter1Down = 23;
int pinShutter2Up = 24;
int pinShutter2Down = 25;
int pinShutter3Up = 26;
int pinShutter3Down = 27;
int pinShutter4Up = 28;
int pinShutter4Down = 29;
int pinShutter5Up = 30;
int pinShutter5Down = 31;
int pinShutter6Up = 32;
int pinShutter6Down = 33;
int pinShutter7Up = 34;
int pinShutter7Down = 35;
int pinShutter8Up = 36;
int pinShutter8Down = 37;// Setup pin number for wall switch
int pinSwitch1Up=38;
int pinSwitch1Down=39;
int pinSwitch2Up=40;
int pinSwitch2Down=41;
int pinSwitch3Up=42;
int pinSwitch3Down=43;
int pinSwitch4Up=44;
int pinSwitch4Down=45;
int pinSwitch5Up=46;
int pinSwitch5Down=47;
int pinSwitch6Up=48;
int pinSwitch6Down=49;
int pinSwitch7Up=51;
int pinSwitch7Down=50;
int pinSwitch8Up=52;
int pinSwitch8Down=53;// Setup pin number for centralized switch
int pinSwitchCentralizationUp=A14;
int pinSwitchCentralizationDown=A15;
For debugging purposes I added also a LCD display using I2C.
Full program is : volet.ino
What should be keep in mind is the status at start up. I mean when the board is powered on, I should get states of all switch and do nothing. I do not want to have all shutter going up in the middle of the night after a power failure !
So in the setup part I initialize pins and read states.
Then in the loop program I just read switch states and do actions accordingly. In fact always the latest action is taken into account.
With this program, shutter can be open and close individually using the dedicated button like it was before the automation. But now, also using the general button, I can open and close all shutters.
The only limitation is when user request 2 actions at the same time : shutter 1 asked to go up or down, and another one asked also to do the same. Here only the first one will be taken into account.
This is the only limitation using Arduino. In fact I will be able to solve this issue if I am able to use threads. I tested with DuinOS, but unfortunately after 3 or 4 threads, the processor is overloaded and cannot do anything.
Maybe there is also another way to handle this, but after 1.5 year of use this small thing is not so important. Also in the same time a new board was released : Raspberry Pi
I decided to build a board to connect a Raspberry Pi to this automation.




Bonjour,
Pour commencer, je parcours les tuto arduino sans trouver exactement ce que je cherche,
Ceci dit, le descriptif que vous avez publié est sans doute le plus proche de ce que je souhaite réaliser. Je m’explique :
Mes recherche étaient sur volet roulants et arduino. Mon projet est plutôt un élévateur réglable par bouton poussoir (monter descendre)… Avec des butées fin de courses…
J’estime le poids à soulever à 5 kg maxi
Je n’aurais donc qu’un seul volet roulant à contrôler. Pensez vous que je sois dans le bon sens pour ma réalisation, a savoir me suis-je bien orienté ou ais-je tout faut ?
Merci a vous pour vos conseilles éclairés.
Mrerci pour votre soutient en tous cas .
Bonjour,
Désolé de ne répondre que maintenant, mais oui je pense que vous êtes dans la bonne direction.