The i2c interface is a serial data bus to connect low speed devices. The data is transmitted via two wires, one being the clock line and the other being the data line. The i2c interface is based on the master-slave principle, whereby the master can push and pull messages to the slave. It is also possible to have more than one master in a system. The slave is identified by its address. Is a microcontroller as slave needed the address can be freely defined, if no other slave has this address. In the SmartFactory project, data is exchanged between the SorticRobot and the SorticRobot CommunicationHub via the i2c interface. Predefined structs are sent and received byte by byte. This enables a simple data exchange amongst linked systems.
- Tools and technologies
- Hardware
- Software
- ToDo's
- Contributors
- Changelog
- License
- Links to SmartFactory
The source code is implemented in the programming language C++. In the following, the tools for editing the project are listed.
The development environment used is Visual Studio Code with the PlatformIO extension. The development environment can be downloaded open sourced. For an installation guide look here.
Doxygen was used for documenting the source code. For using Doxygen in Visual Studio code, the Doxygen Documentation Generator extension is available.
The binary signals for the i2c communication are generated by pull-up resistors. The clock line gives a time-delayed periodic square wave signal, which defines the clock of the transmission. The data bits are transmitted by a time-delayed aperiodic square-wave signal on the data line. For a more detailed explanation here.

A logic level converter is used to transform the different voltages of the binary signals. An explanation of the Logic Level converter can be found here.

The i2c interface was implemented with preprocessor instructions for handling as master or slave in the same interface. By uncommenting "#define MASTER" the slave version can be used.
// UNCOMMIT IF SLAVE
#define MASTER
The figure below shows the data model in UML notation.
Click on the image to open doxygen-documentation.
The figure below shows the include graph
Click on the image to open doxygen-documentation.
All the ToDo's are documented in the source code with Doxygen.
V 1.0 - Release SA HS20 - Philip Zellweger
MIT License
- SmartFactory-Sortic
- SmartFactory_Box-Sortic
- SmartFactory_Vehicle-Sortic
- SmartFactory_Vehicle-Basis
- SmartFactory_SorticRoboter
- SmartFactory_SorticRoboter_CommunicationHub
- SmartFactory_MQTTCommunication for Adafruit Feather M0 Wifi
- SmartFactory_MQTTCommunication for Esp32 DevKitC
- SmartFactory_I2cCommunication
- SmartFactory_Messages