Main Content

SEEED Wio Terminal LoRa MQTT Gateway using Arduino IDE

Transform your Wio Terminal into a Matrix LoRa MQTT Gateway. Transmit received LoRa messages to a MQTT Broker and act as SensorNode too.

In today’s article, we are going to build a Matrix LoRa MQTT Gateway with your Wio Terminal ! This project sets up Wio Terminal as a LoRa gateway, but also it acts as a own SensorNode via the MQTT protocol too.

To demonstrate the function and features of this gateway you can build a small SensorNode with a Seeed Xiao and some Grove actors and sensors.

Wio Terminal
The Wio Terminal is a SAMD51-based microcontroller with Wireless Connectivity supported by Realtek RTL8720DN that’s compatible with Arduino and MicroPython. It runs at 120MHz (Boost up to 200MHz), 4MB External Flash and 192KB RAM. It supports both Bluetooth and Wi-Fi providing backbone for IoT projects. The Wio Terminal itself is equipped with a 2.4” LCD Screen, onboard IMU(LIS3DHTR), Microphone, Buzzer, microSD card slot, Light sensor, and Infrared Emitter(IR 940nm). On top of that, it also has two multifunctional Grove ports for Grove Ecosystem and 40 Raspberry pi compatible pin GPIO for more add-ons. More info in SeeedStudio page.

LoRa is a Long-Range radio technology developed by Semtech.
Here is a definition from Semtech’s LoRa FAQ:

LoRa (Long Range) is a modulation technique that provides significantly longer range than competing technologies. The modulation is based on spread-spectrum techniques and a variation of chirp spread spectrum (CSS) with integrated forward error correction (FEC). LoRa significantly improves the receiver sensitivity and as with other spread‐spectrum modulation techniques, uses the entire channel bandwidth to broadcast a signal, making it robust to channel noise and insensitive to frequency offsets caused from the use of low cost crystals. LoRa can demodulate signals 19.5dB below the noise floor while most frequency shift keying systems (FSK) need a signal power of 8-10dB above the noise floor to demodulate properly. The LoRa modulation is the physical layer (PHY), which can be utilized with different protocols and in different network architecture – Mesh, Star, point to point, etcetera.

Features of this project
Wio Terminal acts as a LoRa MQTT Gateway and MQTT SensorNode. All messages received (JSON) via LoRa will be send to your MQTT broker. With tools like Node-Red, InfluxDB and Grafana - you can visualize, react, transform this data later.

The inbuild sensors - light and sound - and the external connected DHT11 are used to establish beside your gateway - a full functional MQTT SensorNode. With help of the sound sensor your are able to wake up the screen saver too.

The user programmable buttons are used as:
Button 1 > send sensor data to your MQTT broker
[>] Message:{“node”: “LoRa_MQTT_Gateway”,”H”:44,”T”:22,”N”:1,”L”:0}
Button 2 > display SensorNode Data
Button 3 > screen saver on/off

You can configure all setups in config_lora.txt on your SD card.
We provide a UF2 file if you prefer easy flashing and no coding and compiling.

The XIAO SensorNode demonstrates the use case of your Wio Terminal.”

Link to article