Decentralized Intelligence, Cyber Physical Systems, Smart Home and Smart Factory - the Internet of Things is on everybody’s lips. IoT thereby does not necessarily imply the connection of devices using the Internet protocol. Whenever cables interfere and WLAN is not practicable, other radio standards have to be used. To evaluate this, Würth Elektronik now offers a comfortable way by means of a radio application design kit for the Raspberry Pi.
Whether as a de luxe evaluation board or even as a direct application: with the AMBER-PI-Kit and a Raspberry Pi, developers have the opportunity to easily develop and test energy-saving sub-GHz radio solutions. The Raspberry Pi already offers the integrated wireless technologies WLAN and Bluetooth for limited-range networking. Würth Elektronik with the AMBER PI now offers a simple possibility to equip the Raspberry Pi with long-range radio communication. The design kit contains the hardware and the necessary software to enhance the Raspberry PI. The plug-in board is suitable for all Raspberry Pi models with a 40-pin IO header. The AMBER PI is equipped with the Tarvos-III radio module, which provides radio communication in the 868 MHz frequency band. It also has two SPI and two I2C interfaces to connect the included sensors or other electronic components.
Energy-saving radio module
The Tarvos-III radio module is the main component for radio communication and is addressed via the UART interface of the Raspberry Pi. It is characterized by its low power consumption of 26 mA at 14 dBm transmission power and only 0.2 µA in sleep mode, which is especially important for battery-powered applications. The Tarvos-III has a radio transmission range of over 2000 m. In addition, it has a long range mode, which allows a range of up to 10 km. However, even at short distances which could be covered with Wi-Fi or Bluetooth, the 868 MHz band offers a number of advantages: It can handle interference better because there is less radio communication in this frequency band, and on the other hand, there are fewer barriers to radio quality and range due to the lower frequency.
In order to maintain the flexibility and adaptability of the Raspberry Pi despite the plug-in board, the pins of the AMBER PI are interconnected with the pins of the Raspberry Pi. This allows additional plug-in boards to be connected to the pins of the I²C and SPI interfaces. Three plug-in boards with sensors are supplied with the evaluation board. These are used to measure temperature, air pressure, relative humidity and motion. In addition to the sensors, a plug-in board for the SPI interface is also included in the package. This enables you to develop your own prototypes, experiment with your own circuits or connect additional sensors.
In addition to the AMBER PI as an add-on board for the Raspberry Pi, the Tarvos-III Plug USB stick is part of the delivery to serve as remote station. AMBER PI and Tarvos-III Plug are ready for use and can communicate with each other out of the box.
In the firmware of the Tarvos-III the WE-ProWare stack is integrated, which allows us to use the command mode of the Tarvos-III. Via the UART interface, the host - in this case the Raspberry Pi - can send predefined commands to the radio module either to configure it, or initiate the transmission of radio messages. The module in turn responds with a confirmation to indicate to the host that the command has been executed. In addition, the Tarvos-III can also transmit independently, for example if a radio message has been received.
Regardless of the type of command, the protocol always has the same structure:
The command always begins with the start signal, a byte with the value 0x02 to indicate the beginning of a message. This is followed by the command byte, which describes the type of command. A length byte then follows, which determines the number of subsequent data bytes. The command is concluded with a checksum to verify the correct transmission between host and module. For example, to send a message via radio (command byte 0x00) with the content "Hello" (i.e. 0x48 0x65 0x6C 0x6C 0x6F in hexadecimal notation), the following command string is transmitted:
After successfully transmission of the message, the module responds with the following frame. A payload with byte 0x00 indicates the successful execution of the request. If an error occurs during the radio transmission of the telegram, the payload contains the byte 0x01:
Software Development Kit
The AMBER PI Software Development Kit (SDK) is provided as source code in C. It contains the drivers for the delivered hardware (Tarvos-III, Tarvos-III plug and sensors) and implements the described command interface of the WE-ProWare stack. Simple functions assemble a command, send it to the module via the UART interface and interpret the response. The return value of the type Boolean, indicates whether the command was successfully executed by the module or not. To send a message, the corresponding function can simply be called along with the payload and its length:
To kick-off with your own project the SDK contains an example application. This application periodically reads the connected sensors and then transmits the sensor values via radio to the supplied receiver stick. The sample application can be used and adapted as a basis for your own projects and needs.
With the AMBER PI Kit, as a complete package consisting of hardware and software, a simple method is offered to equip the Raspberry Pi with radio communication in the sub-1GHz spectrum. By focusing on simplicity of use and flexibility of equipment, a variety of projects with different requirements can be implemented. Typical applications would be remote monitoring and radio control, the replacement of serial cable connections or sensor networks in industrial automation.
The author of this article is Selina Schuler, software developer at Würth Elektronik eiSos GmbH & Co. KG. The reposting of this article is done with permission.
For More Information
|Amber Pi Expansion Board||868MHZ Tarvos-III Radio Module||915MHZ Telesto-II Radio Module|