The implementation of an infrared transmitter and receiver function in the Souliss framework

Bachelor Thesis, 2016

41 Pages, Grade: 1,0


Table of Contents

1 Introduction

2 Souliss
2.1 Requirements
2.2 Arduino
2.2.1 Development Environment
2.2.2 Arduino programming language
2.3 Typicals
2.4 Communication

3 Smart Home Framework Comparison

4 openHAB
4.1 Souliss integration in openHAB

5 IR Remote Control
5.1 IR Codes

6 Souliss IR implementation
6.1 IR Gateway function

7 Hardware
7.1 WEMOS D1 mini board
7.2 Souliss IR Cube
7.3 Calculations
7.4 Mechanical Design

8 Conclusion


List of Figures

Code snippets

List of Tables

List of Abbreviations

A: Souliss IR Cube example


Meine Bachelorarbeit behandelt die Implementierung eines Infrarot- Senders und Empfängers in die freie Arduino Bibliothek Souliss. Mit Hilfe der Souliss Bibliothek ist es möglich, ein Netzwerk aus Sensoren und Aktoren für eine Heimautomatisierung aufzubauen. Souliss bietet die Möglichkeit die Sensoren und Aktoren mittels Ethernet, WLAN und einer 2,4GHz Funkverbindung zu vernetzen. In dieser Arbeit wird die fehlende Option, Geräte der Unterhaltungselektronik über Infrarot zu steuern, in die Souliss Bibliothek integriert. Diese Integration wurde mit Hilfe einer Funktion umgesetzt, die die Steuerbefehle einer Infrarotfernbedienung in Souliss Steuerbefehle umwandeln kann. Des Weiteren können auch Souliss Steuerbefehle in Infrarotsteuersignale konvertiert werden. Diese Umsetzung wurde mit Hilfe eines eigens entwickeltem Prototypen, dem „Souliss IR Cube“ getestet. Bei diesem Prototyp wurde ein ESP8266 Mikrokontroller eingesetzt, welcher eine WLAN Funktionalität besitzt. Der elektronischen Komponenten wurden auf einer Lochrasterplatine aufgebaut. Diese Platine ist in einem würfelförmigen Gehäuse untergebracht. An den vier Seitenflächen des Gehäuses ist jeweils eine Infrarot LED und an der Oberseite des Gehäuses ist ein Infrarot Empfänger platziert. Dieses Gehäuse wurde mit Hilfe eines 3D Druckers realisiert.


My bachelor thesis describes the implementation of an infrared transmitter and receiver function in the Souliss framework. Souliss is an open source software for home automation applications. It is possible to connect the sensors and actuators via Ethernet, WLAN and a 2.4GHz radio communication. In this thesis, the missing feature of controlling consumer electronics from an infrared controller is implemented in the Souliss framework. Therefore, a function, which converts the infrared command codes into Souliss command codes, is implemented. In addition, this implementation also includes a function, which is able to translate Souliss commands into infrared command signals. The software modification is tested on a specially designed prototype called “Souliss IR Cube”. This prototype includes the ESP8266 microcontroller, with the integrated WLAN functionality. All the electrical components are placed on a breadboard printed circuit board, which is places in a cubic designed case. On each side of the cube there is placed an infrared LED and on the top of the cube there is an infrared receiver attached. This cased was realized with a 3D printer.

1 Introduction

The concrete task of this thesis was to implement an infrared receiver and transmitter functionality into Souliss and this has to be tested on a microcontroller with a wireless interface. Souliss is a home automation library for the Arduino platform. This library is under the term of the General Public Licence and it can be used for free. With Souliss, a network of sensors and actuators can be set up with little effort. The opportunity to control consumer electronics, which are usually controlled by infrared commands, is not included in the Souliss framework. For this reason, the operation of this software library was analysed to find a way in which the infrared functionality could be implemented. In addition, sensor and actuator modules, which are powered by the Souliss software, can be integrated in a home automations software system called openHAB. In this thesis, the integration of Souliss hardware modules is demonstrated using simple examples. The possibility of an interaction with Souliss hardware modules using the Souliss App for the Android platform is also shown in this thesis. Furthermore, the adaption of the software library was tested on a specially developed prototype. This prototype has included the functionality to transmit and receive infrared control commands. It is based on an ESP-8266EX microcontroller with a WLAN capability. The solution of the infrared implementation in the Souliss framework and the hardware structure of the prototype are described in this thesis.

2 Souliss

Souliss is an open-source framework for Arduino based microcontroller. This framework was developed for Smart Home applications. The Souliss functions can be used to create smart objects and an entire automation system. It is possible to set up a home automation system in a simple way. Only a few lines of code are needed for example to control lamps and heating systems. In addition, measurement values from sensors can be read out, transmitted and processed. Souliss is independent from a central server and cloud services. In case of an error with the internet connection, the Souliss system is still working without any restrictions.

Hardware modules which includes a software with Souliss functions, can be integrated in a popular smart home automation software called “openHAB”. Furthermore, for the Android platform there is an App called “SoulissApp” available. With the help of openHAB and the SoulissApp it is possible to build scenarios. For example, you can open your garage door and switch on the light in the garage. [14]

2.1 Requirements

The requirements for a Souliss network set-up are a microcontroller with a communication interface which is supported by the Arduino libraries, a software development environment and the Souliss library. All microcontrollers which are supported by the Arduino libraries can be used. The supported communication media are Ethernet, WLAN, serial communication over RS485 and a wireless 2.4GHz RF communication. [14]

2.2 Arduino

Arduino is an open-source hardware and software platform for microcontroller. It is developed to create hardware projects in an easy way. Arduino boards are simple designed and they are programmed with by the Arduino programming language. This programming language is based on the programming language C. The Arduino software platform brings a lot of hardware control functions with it. For example, inputs and outputs can be accessed by simple commands without having expert knowledge of the hardware control registers. Arduino is used by a huge community worldwide and as a result there are a lot of free libraries for additional hardware available. Because of its popularity the Arduino platform is ported to microcontroller from various manufacturers like Atmel, Espressif, Microchip, ST Microelectronics and Texas Instruments. In comparison to other microcontroller systems, Arduino boards are inexpensive and the development environment is for free. The Arduino development environment is available for the operating systems Windows, Linux and Macintosh OSX. [1]

2.2.1 Development Environment

Arduino offers a simple integrated development environment. This software package is easy to use and it includes an editor, compiler and a programming functionality. Moreover, other development environments can be used. For example, PlatformIO, Visual Studio and Eclipse. [1]

2.2.2 Arduino programming language

An Arduino program code has included the function “setup” and “loop”. The function “setup” is called once after each power up and reset. This function is usually used to configure the hardware and to initialize functions. The function “loop” includes the program sequence. This function is comparable with a continuous loop and it is called after the “setup” function. [1]

Simple Arduino program example:

This simple program code toggles the GPIO pin 13 with a delay of one second.

Abbildung in dieser Leseprobe nicht enthalten

Code snippet 1: Simple Arduino program example

2.3 Typicals

A Typical is a function with a predefined behaviour with input and output commands. One or more slots are required by the Typical. Following table list the six Typical groups. One slot represents a part of the MaCaco shared memory. Every slot has a size of one byte and one node is limited to 24 slots. [12]

Abbildung in dieser Leseprobe nicht enthalten

Table 1: Overview of Souliss Typicals [12]

Abbildung in dieser Leseprobe nicht enthalten

Table 2: Description of the Typical Group T1n [12]

In the program code, each slot is assigned an index of the MaCaco shared memory. Every Typical has a set of predefined commands, which are written in the required slots. The logical function of the Typicals read out the respective data area and interpret the commands. It is important that the slots do not overlap. The index of the memory starts at zero. [12]

Example of Slot definition:

Abbildung in dieser Leseprobe nicht enthalten

Code snippet 2: Example of a Souliss Slot definition

Example of a Souliss Typical activation:

The activation of the Souliss Typicals is done inside the Arduino “setup” function.

Abbildung in dieser Leseprobe nicht enthalten

Code snippet 3: Example of a Souliss Typical activation

Example of a Souliss Typical function call:

In this example the Typicals are processed every 50ms. A further processing time which can be chosen are 110ms (FAST_110ms) and 10s (SLOW_10s). The functions “Logic_T11” and “Logic_T14” are responsible for processing the incoming control commands and they define the target values of the outputs. The function “DigOut” sets the defined target value to the output of the microcontroller. The output pin has to be configured inside the Arduino “setup” function. [12]

Abbildung in dieser Leseprobe nicht enthalten

Code snippet 4: Example of a Souliss Typical function call

2.4 Communication

Every microcontroller in a Souliss network interacts as a node. A node can either be configured as a gateway or as a peer. Nodes are able to communicate with each other without any central node that is coordinating the flow of information. This form of communication is called peer-to-peer communication. A node must be configured as a gateway when the Souliss App is used or the integration in openHab is desired. [13]

The Souliss API is split up in three layers:

Abbildung in dieser Leseprobe nicht enthalten

Figure 1: Souliss layer model

The communication system in the Souliss framework is based on the vNet transportation protocol. With this protocol, it is possible to bridge different communication media like Ethernet, WLAN, serial communication and 2.4GHz radio communication. For the differentiation of the nodes, every node has its own vNet address. [15]

vNet frame structure

The vNet protocol consist of a six-byte long header and a variable payload. The size of the payload depends on implementation. In the Souliss framework, the payload has a size of maximum six bytes. [15]

Abbildung in dieser Leseprobe nicht enthalten

Figure 2: vNet Frame Structure [15]

If the data is transmitted over Ethernet or WLAN, the length contains an additional byte.

Abbildung in dieser Leseprobe nicht enthalten

Figure 3: vNet Frame Structure over UDP/IPv4 [15]

The vNet transportation protocol includes the MaCaco data protocol.

I n Souliss MaCaco frames are transported over vNet using 0x17 as vNet port.” [15]

MaCaco is a data protocol, which requires less resources and it is event based. It is optimised for microcontrollers with only a few bytes of RAM. The frames are transported over a peer-to-peer structure. The information in a data frame is parsed by the receiving node and the node is performing the desired function. [15]

MaCaco frame structure

Abbildung in dieser Leseprobe nicht enthalten

Figure 4: MaCaco frame structure [13]

A MaCaco frame has header with the size of 5 bytes and a variable payload. A request frame contains only the header and the answer frame includes a payload part. [13]

The Functional Code describes the tasks, which should be done by the node.

An extract of Functional Codes, which are implemented in the Souliss framework:

- Read request (0x01 for digital values, 0x02 for analog values)
- Read answer (0x11 for digital values, 0x12 for analog values)
- Ping request (0x08)
- Ping answer (0x18)
- Force request (0x33)

The force request is used to write data to a node

The Put in is an identification code for the frame and it is used to parse the request frame with the corresponding answer frame. The node which is sending a request frame, has to define an identification code. The node which is sending an answer frame, send back that value.

The Start Offset indicates the first slot from which data is read out or written on.

The Number Of indicates the number of bytes which should be read or written.


Abbildung in dieser Leseprobe nicht enthalten

Figure 5: MaCaco Example “Ping request”

Abbildung in dieser Leseprobe nicht enthalten

Figure 6: MaCaco Example “Ping answer”

Abbildung in dieser Leseprobe nicht enthalten

Figure 7: MaCaco Example “Read digital request”

Abbildung in dieser Leseprobe nicht enthalten

Figure 8: MaCaco Example “Read digital answer”[13]

MaCaco supports three types of data flow:

- Polling

A node initiates a communication with a request frame and it will receive an answer frame.

- Pushing

A node initiates a communication with a force request frame and it will not receive an answer frame.

- Subscribing

A node initiates a communication with a subscribe request frame and it is waiting for the required information.[13]

Supported network architectures

Abbildung in dieser Leseprobe nicht enthalten

Figure 9: Single Network [14]

Abbildung in dieser Leseprobe nicht enthalten

Figure 10: Peer to Peer Network [14]

Abbildung in dieser Leseprobe nicht enthalten

Figure 11: Routed Network [14]

3 Smart Home Framework Comparison

The software platform “MySensors” is an open source solution for smart home applications. It was developed by the “MySensors” community and it is subject to continuous development. This framework is similar to Souliss. “MySensors” is developed for the “Arduino” hardware platform and only for a wireless communication between the nodes. In contrast to “MySensors”, “Souliss” supports the communication media Ethernet, WLAN and a 2.4GHz radio communication. A network contains an “Arduino” board, a wireless module, sensors and actuators. The supported wireless modules are the “RFM69”, “nRF24L01+” and the ESP8266EX. The modules “RFM69” are “nRF24L01+” are RF wireless modules, which are connected via the SPI bus to the microcontroller. The ESP8266EX is a microcontroller with a built-in WLAN functionality. In comparison to “Souliss”, “MySensors” components form a tree network topology. “Souliss” nodes are able to communicate with each other without a gateway. “MySensors” sensor and actuators communicate only with the gateway and the repeater-sensor. The task of the repeater-sensor is to transmit the data from the sensor or actuator to the gateway. This is necessary when the sensor or actuator is far away to the gateway. [7][8]

Abbildung in dieser Leseprobe nicht enthalten

Figure 12: MySensors network topology [7]

A “Souliss” gateway node which uses Ethernet or WLAN, can communicate with the “Souliss” mobile application. This functionality is not available on a “MySensors” gateway without any additional hard- and software. A gateway which combines the radio communication and the Ethernet communication is needed. This gateway is called “Controller” and it translates the messages between the radio network and the Ethernet network. These controllers can be integrated in smart home software solutions which provide remote access with a mobile application for example openHAB. [8][10]

Abbildung in dieser Leseprobe nicht enthalten

Table 3: Comparison between Souliss and MySensors

4 openHAB

“openHAB” is an open source software solution for home automation systems. This software is platform independent and can run on every operating system on which a Java Virtual Machine is available. In openHAB there is powerful rule engine included. With this rule engine it is possible to schedule actions and define dependences between actuator, sensors and interactions. In addition, openHAB is extensible and it is possible to integrate this software into other systems with the provided APIs. Extensions are called “bindings” and they can be included irrespective of the used operating system. The available bindings are listed and described on the openHAB homepage. There are also examples given which describe the correct integration and configuration. openHAB has integrated a web interface to visualize the configured actuator, sensors and actions. Moreover, there is an application for mobile operating systems like the Android platform and IOS available. The Souliss community has developed an extension for openHAB which allows to integrate Souliss nodes into openHAB. [9][10]


The openHAB configuration is split up into configuration files. It is important that all the configuration files except the general configuration must have the same filename. It is possible to change the settings during the runtime. The configuration files are parsed periodically and the modifications are applied by the openHAB core. [10]

- General configuration
- .\configurations\openhab.cfg

The general configuration includes the openHAB system configuration and the binding configuration. The IP address of the Souliss gateway node, the USER_INDEX and the NODE_INDEX have to be registered in the Souliss section of the openHAB configuration. It is important that the USER_INDEX and the NODE_INDEX must be clearly distinguished from the mobile application configuration.[10]


Excerpt out of 41 pages


The implementation of an infrared transmitter and receiver function in the Souliss framework
University of Applied Sciences Technikum Vienna  (Elektronik)
Catalog Number
ISBN (eBook)
ISBN (Book)
Souliss, Arduino, Infrarot, Heimautomatisierung, WLAN
Quote paper
Patrick Marchhart (Author), 2016, The implementation of an infrared transmitter and receiver function in the Souliss framework, Munich, GRIN Verlag,


  • No comments yet.
Read the ebook
Title: The implementation of an infrared transmitter and receiver function in the Souliss framework

Upload papers

Your term paper / thesis:

- Publication as eBook and book
- High royalties for the sales
- Completely free - with ISBN
- It only takes five minutes
- Every paper finds readers

Publish now - it's free