Project tutorial
SomfyDuino IO

SomfyDuino IO © GPL3+

USB to Somfy IO adapter - accepts serial commands and sends them to any Somfy roller shutter or windows blinds.

  • 2,989 views
  • 2 comments
  • 1 respect

Components and supplies

Ard nano
Arduino Nano R3
×1
Flat Cable
×1
Somfy IO Remote
×1

Necessary tools and machines

09507 01
Soldering iron (generic)

About this project

Ideation

Hi there,

I just tried to implement a USB to Somfy IO Adapter with an Arduino Nano to include my roller shutters in the living room. I wanted to connect to my DIY home automation system without having to get any cloud based hardware from the original supplier - and hey! IT WORKED - using just a simple IO remote.

You need:

  • A Somfy IO Remote - I used the GX037.
  • Almost any Arduino with a USB connector will do - but soft serial also works.
  • A seven core flat cable and a shrink hose for neat packing.

Wiring according to the attachments. The remote is powered through the Arduino - it uses about 20mA while sending, so you should be super fine. So make sure you remove the battery.

Concerning the code:

If you want to connect the whole contraption to e.g. a RPi, you might want to consider removing all Serial.print items - it is way easier to communicate with the Arduino if it just listens and shuts up.

How to send commands is explained in the code.

Have fun - comments are welcome!

Cheers,

Bjoern

P.S. - I used a one channel remote. It basically uses the same layout as the 5 channel remote, but some parts (as the additional LEDs) are missing. I wonder if it will jump to different channels if SELECT is triggered. I have not tried yet because I was just glad I got one channel to work, but I'll keep this updated

P.P.S. just checked - the select button unfortunately has now effect - won't change channels but won't screw up the remote either.

Code

Serial to SomfyArduino
// SomfyDuino
// by Bjoern Foldenauer
// 05/2017


int progPin = 8;
int upPin = 12;
int downPin = 10;
int myPin = 11;
int selectPin = 9;
int ledPin = 13;

boolean upPress = false;
boolean downPress = false;
boolean myPress = false;
boolean progPress = false;
boolean selectPress = false;
unsigned long holdTime = 0;
int repeatSend = 0;

char incomingChar;

void setup() {
  Serial.begin(9600);
  Serial.println("SomfyDuino 0.71");
  Serial.println("Bjoern Foldenauer");
  Serial.println("-----");
  Serial.println("receives single serial characters like:");
  Serial.println("u - prepare to press UP");
  Serial.println("d - prepare to press DOWN");
  Serial.println("m - prepare to press My");
  Serial.println("p - prepare to press PROG");
  Serial.println("s - prepare to press SELECT");
  Serial.println("r - increase send count by one");
  Serial.println("any digit X - increase hold time by X*100 ms");
  Serial.println("e - Execute! Runs a defined (multi button) press and hold");
  /erial.println("");
  Serial.println("Example: regular UP: u5e ");
  Serial.println("         3 second UP/DOWN: ud9993e ");
  Serial.println("         5 second PROG: p999995e ");
  Serial.println("");

  pinMode(progPin, OUTPUT);
  pinMode(upPin, OUTPUT);
  pinMode(downPin, OUTPUT);
  pinMode(myPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  pinMode(selectPin, OUTPUT);
  digitalWrite(progPin, HIGH);
  digitalWrite(upPin, HIGH);
  digitalWrite(downPin, HIGH);
  digitalWrite(myPin, HIGH);
  digitalWrite(selectPin, HIGH);
  digitalWrite(ledPin, LOW);
}

void loop() {
  
  while (Serial.available() == 0) { delay(50); } // wait until serial command comes in
  if (Serial.available() > 0) {
    incomingChar = Serial.read();
    Serial.println(incomingChar);
    if (incomingChar == 'u') {upPress = true;}
    if (incomingChar == 'd') {downPress = true;}
    if (incomingChar == 'm') {myPress = true;}
    if (incomingChar == 'p') {progPress = true;}
    if (incomingChar == 's') {selectPress = true;}
    if (incomingChar == '1') {holdTime += 100;}
    if (incomingChar == '2') {holdTime += 200;}
    if (incomingChar == '3') {holdTime += 300;}
    if (incomingChar == '4') {holdTime += 400;}
    if (incomingChar == '5') {holdTime += 500;}
    if (incomingChar == '6') {holdTime += 600;}
    if (incomingChar == '7') {holdTime += 700;}
    if (incomingChar == '8') {holdTime += 800;}
    if (incomingChar == '9') {holdTime += 900;}
    if (incomingChar == 'r') {repeatSend++;}
    if (incomingChar == 'e') {somSend();}
  }
}

void somSend() {
  Serial.print("Pressing: ");
  
  for(int i=0; i <= repeatSend; i++) {
    if (upPress) {digitalWrite(upPin, LOW); upPress = false; Serial.print("up ");}
    if (downPress) {digitalWrite(downPin, LOW); downPress = false; Serial.print("down ");}
    if (myPress) {digitalWrite(myPin, LOW); myPress = false; Serial.print("my ");}
    if (progPress) {digitalWrite(progPin, LOW); progPress = false; Serial.print("prog ");}
    if (selectPress) {digitalWrite(selectPin, LOW); selectPress = false; Serial.print("select ");}
    digitalWrite(ledPin, HIGH);

    Serial.print("for ");
    Serial.print(holdTime);
    Serial.println(" ms");

    delay(holdTime);

    digitalWrite(progPin, HIGH);
    digitalWrite(upPin, HIGH);
    digitalWrite(downPin, HIGH);
    digitalWrite(myPin, HIGH);
    digitalWrite(selectPin, HIGH);
    digitalWrite(ledPin, LOW);

    delay(holdTime);
  }

  holdTime = 0;
  repeatSend = 0;

  Serial.println("done.");
}

Schematics

Wiring
Wiring werllcysmw
Real life wiring1
Wp 20170517 22 38 35 rich li rwl1hpkk8o
Real life wiring2
Wp 20170517 22 38 25 rich li mpolmvvbtw
Finished and packed

No document.

Comments

Similar projects you might like

RFID Desk Lamp

Project tutorial by Kutluhan Aktar

  • 1,253 views
  • 0 comments
  • 3 respects

WiFi IR Blaster

Project tutorial by BuddyC

  • 85,584 views
  • 43 comments
  • 89 respects

Using Chirpers with Hologram. io

by Moheeb Zara

  • 2,224 views
  • 1 comment
  • 7 respects

Otto DIY+ Arduino Bluetooth Robot Easy to 3D Print

Project tutorial by Team Otto builders

  • 48,322 views
  • 117 comments
  • 163 respects

SMART CUBE: A New Way to Control Your Home

Project tutorial by Alberto Sartori

  • 13,531 views
  • 7 comments
  • 30 respects

How to Configure NeoPixels Using Vixen Lights and Arduino

Project tutorial by Victor Aguilar

  • 13,216 views
  • 23 comments
  • 28 respects
Add projectSign up / Login