Distance Demo Architecture

Distance Demo Overview
Milesight EM400-TLD (NB) → MQTT → Node-RED → InfluxDB → Flask

Overview

This demo has been put together to show how using IoT sensors we can remotely monitor distance measurements and related telemetry remotely.

In this demo we gather distance data from the Milesight EM400 sensor and send it over the air using the EE cellular network and across the internet to a server where it is captured and stored in InfluxDB. A Flask web dashboard then queries the latest values and historical data to provide customers with full remote monitoring, diagnostics, and alerting should there be an issue.

Data Flow

  1. Milesight EM400 publishes distance and device telemetry (NB-IoT).
  2. The device sends data over the EE cellular network to the internet.
  3. MQTT receives the messages on the server.
  4. Node-RED subscribes to the relevant topic(s), decodes payloads, and extracts fields.
  5. InfluxDB 1.x stores points in database distancedemo (measurement: em400).
  6. Flask queries latest + historical data and displays it on the Distance dashboard.

MQTT

Topic: em400/#
Payload: Distance readings and telemetry (decoded and mapped into fields by Node-RED).

InfluxDB Schema

Database: distancedemo
Measurement: em400
Fields:
  • distance_mm (integer/float) — distance measurement in millimetres
  • temperature_c (float) — temperature in °C
  • battery (float/int) — battery level/voltage (as provided by decoder)
  • position_code (int) — 0 = Normal, 1 = Tilt