Free Unlock your 1‑hour consultancy—schedule your session today! »

· Eduardo Vieira · Industrial Automation  · 6 min read

ThingsBoard: The Complete IoT Platform for Industrial Automation

Explore ThingsBoard's powerful IoT platform features and learn how to set up your first IoT project with this comprehensive guide.

Explore ThingsBoard's powerful IoT platform features and learn how to set up your first IoT project with this comprehensive guide.

ThingsBoard: The Complete IoT Platform for Industrial Automation

What is ThingsBoard?

ThingsBoard is an open-source IoT platform designed for data collection, processing, visualization, and device management. It enables businesses to develop, deploy, and scale IoT solutions in multiple industry domains, including industrial automation, smart energy, fleet tracking, and smart agriculture.

At its core, ThingsBoard provides a robust infrastructure for connecting devices, collecting and analyzing telemetry data, visualizing insights through customizable dashboards, and managing devices across their entire lifecycle.

Key Features of ThingsBoard

Device Connectivity

ThingsBoard supports multiple protocols for device connectivity:

  • MQTT - lightweight messaging protocol ideal for constrained devices
  • CoAP - web transfer protocol designed for machine-to-machine applications
  • HTTP - standard web protocol for data transfer
  • LwM2M - lightweight protocol designed for IoT device management

This multi-protocol support makes it a versatile choice for industrial environments with diverse device ecosystems.

Powerful Rule Engine

The Rule Engine is one of ThingsBoard’s most powerful features. It allows you to:

  • Configure data processing workflows
  • Set up alerts and notifications based on device data
  • Transform and filter incoming data
  • Trigger actions when specific conditions are met

The visual flow-based design makes it accessible even without extensive programming knowledge, which is invaluable for industrial automation projects where quick implementation is essential.

Real-Time Data Visualization

ThingsBoard excels at turning device data into actionable insights through:

  • Customizable dashboards with 30+ widgets
  • Real-time data visualization
  • Historical data analysis
  • Mobile-friendly responsive design

For industrial applications, these visualization capabilities provide crucial monitoring and analysis tools that help identify patterns, predict maintenance needs, and optimize operations.

Device Management

The platform offers comprehensive device management features:

  • Device provisioning and authentication
  • Firmware and software updates
  • Device grouping and attribute management
  • Secure access control

Industrial systems with numerous devices benefit significantly from these centralized management capabilities, reducing maintenance overhead and improving operational efficiency.

ThingsBoard Architecture

ThingsBoard employs a scalable microservices architecture that consists of several key components:

  1. Transport Components - Handle device connectivity via various protocols
  2. Core Services - Manage entities like devices, dashboards, and users
  3. Rule Engine - Processes device messages and triggers configurable actions
  4. Database - Stores entity data and time-series telemetry
  5. Web UI - Provides a user-friendly interface for platform management

The platform uses an Actor model for high-performance concurrent processing of messages, making it suitable for industrial environments with thousands of connected devices.

Getting Started with ThingsBoard

Let’s create a simple project to demonstrate how to use ThingsBoard for monitoring a temperature sensor - a common industrial automation scenario.

Step 1: Setting Up ThingsBoard

You can use ThingsBoard in several ways:

  • Cloud Service - Use the managed ThingsBoard Cloud service
  • Local Installation - Install on your own server
  • Docker Deployment - Quick setup using Docker containers

For this example, let’s use Docker for quick deployment:

# Create data and logs directories
mkdir -p ~/.mytb-data && sudo chown -R 799:799 ~/.mytb-data
mkdir -p ~/.mytb-logs && sudo chown -R 799:799 ~/.mytb-logs

# Run ThingsBoard container
docker run -it -p 8080:9090 -p 7070:7070 -p 1883:1883 -p 5683-5688:5683-5688/udp \
  -v ~/.mytb-data:/data -v ~/.mytb-logs:/var/log/thingsboard \
  --name mytb --restart always thingsboard/tb-postgres

Once the container is running, you can access the ThingsBoard web interface at http://localhost:8080 using default credentials (email: [email protected], password: tenant).

Step 2: Provisioning a Device

  1. Log in to the ThingsBoard UI
  2. Navigate to “Devices” under the “Entities” section
  3. Click the ”+” button and select “Add new device”
  4. Name your device (e.g., “Temperature Sensor 1”)
  5. Click “Add” to create the device

After creating the device, you’ll need to obtain its access credentials:

  1. Open the device details page
  2. Navigate to the “Device Credentials” tab
  3. Copy the “Access Token” for use in your device code

Step 3: Connecting a Device

Now let’s create a simple Python script that simulates a temperature sensor and sends data to ThingsBoard:

import time
import random
import requests
import json

# ThingsBoard settings
THINGSBOARD_HOST = 'localhost'
THINGSBOARD_PORT = 8080
ACCESS_TOKEN = 'YOUR_DEVICE_ACCESS_TOKEN'  # Replace with your device token

# Endpoint for HTTP API
TELEMETRY_ENDPOINT = f'http://{THINGSBOARD_HOST}:{THINGSBOARD_PORT}/api/v1/{ACCESS_TOKEN}/telemetry'

# Function to generate random temperature data
def generate_temperature():
    return round(random.uniform(20, 30), 2)  # Random temperature between 20-30°C

# Main loop to send data
while True:
    # Generate sensor data
    temperature = generate_temperature()
    
    # Prepare payload
    payload = {
        'temperature': temperature,
        'timestamp': int(time.time() * 1000)  # Current time in milliseconds
    }
    
    # Send data to ThingsBoard
    try:
        response = requests.post(TELEMETRY_ENDPOINT, json=payload)
        print(f"Data sent successfully: Temperature = {temperature}°C")
        print(f"Response: {response.status_code}")
    except Exception as e:
        print(f"Failed to send data: {e}")
    
    # Wait 5 seconds before sending next data point
    time.sleep(5)

Run this script on your computer or edge device to start sending temperature data to ThingsBoard.

Step 4: Creating a Dashboard

  1. Navigate to “Dashboards” in the ThingsBoard UI
  2. Click the ”+” button to create a new dashboard
  3. Name it “Temperature Monitoring”
  4. Click “Add” to create the dashboard

Let’s add visualizations to our dashboard:

  1. Add a Time Series Chart:

    • Click “Entity Aliases” at the bottom right
    • Create a new alias pointing to your device
    • Add a new widget by clicking the ”+” button
    • Select “Charts” → “Time series chart”
    • Configure it to display temperature data
    • Save the widget
  2. Add a Gauge Widget:

    • Click the ”+” button again
    • Select “Gauges” → “Radial gauge”
    • Configure it to show the latest temperature value
    • Save the widget
  3. Add an Alarm Widget:

    • Click the ”+” button
    • Select “Alarm widgets” → “Alarms table”
    • Configure it to show alarms for your device
    • Save the widget

Step 5: Setting Up Alarms

  1. Navigate to “Rule Chains” under “Rule Engine”
  2. Open the “Root Rule Chain”
  3. Add a “JS Filter” node to check for high temperature
  4. Add the following script to the filter:
return msg.temperature > 28;
  1. Connect this node to a “Create Alarm” node
  2. Configure the alarm node with:
    • Alarm type: “High Temperature”
    • Alarm severity: “Warning”
    • Alarm details: ”${temperature}°C exceeds threshold”

Save your rule chain, and it will now generate alarms when the temperature exceeds 28°C.

Industrial Applications of ThingsBoard

ThingsBoard is particularly valuable in industrial settings for:

  1. Equipment Monitoring - Track the performance and health of industrial machinery
  2. Predictive Maintenance - Analyze data patterns to predict equipment failures
  3. Energy Management - Monitor and optimize energy consumption
  4. Production Monitoring - Track production metrics and KPIs
  5. Environmental Monitoring - Monitor environmental conditions in industrial facilities

Integration with Industrial Protocols

Beyond the basic example above, ThingsBoard can integrate with industrial protocols like:

  • Modbus - Connect to PLCs and other industrial devices
  • OPC-UA - Interface with SCADA systems and industrial control systems
  • BACnet - Building automation and control networks
  • CAN bus - Vehicle and industrial automation networks

These integrations make ThingsBoard a versatile platform for industrial IoT applications.

Advanced Features for Industrial Automation

Edge Computing with ThingsBoard Edge

ThingsBoard Edge allows data processing at the edge of the network, reducing latency and bandwidth usage - critical for industrial applications where real-time processing is essential.

White-labeling and Customization

For solution providers and system integrators, ThingsBoard offers white-labeling capabilities to create branded IoT solutions for industrial clients.

Multi-tenancy

The multi-tenant architecture allows service providers to securely host multiple customers on a single ThingsBoard instance, making it ideal for industrial IoT service providers.

Conclusion

ThingsBoard provides a comprehensive platform for industrial IoT applications, combining powerful features with ease of use. Its open-source nature, combined with professional edition options, makes it suitable for projects of all sizes - from proof-of-concept to large-scale industrial deployments.

By following the getting started guide in this post, you can quickly set up a basic monitoring system and start exploring the capabilities of ThingsBoard for your industrial automation needs.

For complex industrial applications, ThingsBoard’s scalability, integration capabilities, and extensive feature set make it a compelling choice that can grow with your requirements while providing the security and reliability needed in industrial environments.

Back to Blog

Related Posts

View All Posts »