Over a million developers have joined DZone.

Crowdsourced IoT Data: Accessing The Things Network With Eclipse Scout

A tutorial on using Eclipse Scout and The Things Network to measure noise levels.

· IoT Zone

Access the survey results 'State of Industrial Internet Application Development' to learn about latest challenges, trends and opportunities with Industrial IoT, brought to you in partnership with GE Digital.

The Things Network (TTN) is an open source project that aims at a global crowdsourced Internet of Things data network. In this blog post we describe a complete TTN show case to create real-time noise maps using the TTN in Zurich using a backend application based on Eclipse Scout and the MQTT Paho library

TTN: A Brief Introduction

After a highly successful campaign on Kickstarter last year, the project is now implementing the necessary infrastructure, designing and producing the promised hardware and spreading the word, for example at Eclipsecon next week.

The major benefits of the project are its distributed open source approach, the low price of the components, the range of  several kilometers for gateways, and the low power consumption of the involved LoRa technology for the “fog” part of the system.

The diagram below provides an overview over the setup including the noise measuring nodes and the TTN Gateways (the “fog”) on the left side, the TTN Cloud in frastructure in the middle and the backend application on the right side.

Overview of the complete setup

The described setup is currently using the somewhat simpler TTN prototype infrastructure. This setup is available since last year as well as instructions on how to set up your own gateway and your own nodes.

For the goal of this post the relevant aspects are the nodes on the left side that connect to one or more TTN gateways and the application on the right side that connects to a TTN handler service.

Low Cost Nodes for Measuring Noise

The goal was to assemble 40 complete nodes for less than €40. As a basis of the component selection we were using Teensy TTN node described in TTN Wiki. Due to additional taxes and some minor “mishaps” during production we ended up at €44 per node instead.

As shown below, the final node contains a microphone (1), a Teensy LC (2), a RFM95 LoRa module (3), an antenna with a company flag (4) as well as a battery box (5) inlcuding 3 AA batteries.

Node including Teensy LC (Arduino compatible) and LoRa transmitter

After being switched on, the node starts to measure differences in air pressure levels over short time windows that roughly correspond to the current noise level. Every two minutes the node then transmits the largest measured noise level and the “amount” of noise accumulated over the two minute period.

When the node is located within the range of a receiving TTN gateway, the data package is then forwarded to the TTN prototype setup.

The source code of the noise measuring node is available on Github.

The Scout Backend Application and a MQTT Paho Client

As the TTN prototype setup also includes a MQTT interface it is straight forward to implement applications that can response near real time to incoming TTN packets.

To implement an end-to-end TTN showcase, a backend application was implemented to display the data packets sent by the TTN noise nodes. The implementation of the user interface is based on Eclipse Scout, and for the communication with the MQTT broker, the Paho Java Client Library is used.

The screenshot below shows the transmitted noise levels with its corresponding time stamps. Noise levels of 10 or more indicate a train

Noise level data as transmitted by nodes

By assigning coordinates to noise nodes, the Scout application can also show the noise levels on a real-time map. The picures below shows two situations with four noise nodes distributed at the outside of the BSI office in Zurich. During a time window with trains passing higher noise levels were measured by nodes that sit closer to the railway tracks (left image) than during a time window without any passing trains (right image).

Noise levels rendered on Open Streetmap

As in the case of the noise measuring nodes, the source code of the Scout TTN application is available on Github. In addition, the application is also available as a Docker image on Docker Hub and deployed as a live instance.

The IoT Zone is brought to you in partnership with GE Digital.  Discover how IoT developers are using Predix to disrupt traditional industrial development models.

open source,java,iot,eclipse

Published at DZone with permission of Matthias Zimmermann. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}