IOT

How to build Digital Twin using Eclipse Ditto?

Digital Twins technology brings the exact replica in digital format of a process, a product, or a service. Basically, it takes real-world data about a physical object or system as inputs and produces outputs in the form of predictions or simulations of how that physical object or system will be affected by those inputs.

Some of the most common use cases across the industry are given below:

  1. Visualization of products in use, by real users, in real-time
  2. Troubleshooting far away equipment
  3. Managing complexities and linkage within systems-of-systems
  4. Connecting disparate systems and promoting traceability

What makes up Digital Twins?

Sensors are the heart of any measurement, control, and diagnostic device. Device telemetry is collected using the smart sensors available on the hardware/software environment and then used to create the digital twin model of the physical equipment.

All of the data is then aggregated and compiled to generate actionable information. The digital twin model is then continuously updated to mirror the current state of the physical thing. It can then be used to effectively model, monitor, and manage devices from a remote location. It also enables continuous intelligence & estimated time for the next needed maintenance, which the maintenance system can use to schedule at the optimal time.

Image – Elements of Digital Twin
  1. Physical equipment is the actual equipment that we are interested in creating a twin for.
  2. Twin Model – Comprises of a hierarchy of systems, sub-assemblies, and components that describe the twin and its characteristics enriched by asset, operational, historical, and context data.
  3. Knowledge – Data sources that feed the twin with operational settings, domain expertise, historical data, and industry best practices.
  4. Analytics – Model gets empowered by physics-based models, statistical models, and machine learning/AI models to help describe, predict, and prescribe the behavior (current and future) of the asset, system, or process.

We can see in detail how to build digital twins in the next section.

How to build Digital Twin?

In this section, we are going to look at how to build a digital twin model of an Intel NUC kit so that we can:

  1. Predict whether it may fail in the near future.
  2. Estimate the remaining useful life.
Image – Digital Twin of Intel NUC Kit

Some of the parameters that determine the health of the Intel NUC Kit are (this forms the basis for building digital twins):

  1. State of the CPU can be monitored via analyzing:
      • CPU Core Sensors
      • Mainboard Sensors
  2. System-wide CPU utilization
  3. Hard Drives Temperature
  4. SSD wear level, host reads/writes, by SSD Hard Drive Sensors
  5. Disk usage statistics
  6. Disk I/O statistics
  7. Fan controllers
  8. Total physical memory (exclusive swap).
  9. Connection States

For building a digital twin of the Intel NUC kit, we are going to leverage the Eclipse Ditto framework that enables us to work with, and manage, the state of digital twins.

Image – Ditto Framework to build Digital Twin

Following are the key capabilities of the Ditto Framework:

  1. Provides capabilities (APIs) to interact with digital twins.
    • Live Channel architecture – routes a command/message towards an actual device.
    • Twin channel connects to the digital representation of a Thing and its state and properties can be read and updated.
  1. Ensures that access to twins can only be done by authorized parties.
  2. Allows to not only interact with single twins but also with populations of many of them.
  3. Integrates into other back-end infrastructure (like messaging systems, brokers)
  4. Based on Docker, Client SDK’s are available for Java/Python.

Step #1. Definition of Twin model – Things and Features

The first step is to define things and features. Things are generic entities and can be used to depict multiple features belonging to a thing. For example, physical devices like the lawnmower, a sensor. In the below example, we are going to treat the entire Intel NUC Kit as a Thing.

Feature is used to manage all data and functionality of a thing that can also be grouped based on technical context. In the below example, we have CPU, Memory, etc.,

Image – Things & Features

Step #2. Use the Ditto client SDK to pull the sensor values and publish them to eclipse ditto.

Once we have defined Things/Features, we can now use any of the client SDK (ex. Python) to pull the respective sensor values and publish them to Eclipse Ditto.

Before that use pre-built images of Ditto and start the server. You can also choose from several options to deploy Ditto.

Image – CPU Core Sensors – Sample values
Image – HDD Temperature Sensors – Sample values
Image – SSD S.M.A.R.T Sensors – Sample values
Image – Intel NUC Board from Sensors- Detect

The Ditto Protocol defines a JSON-based text protocol for communicating with digital twins and the actual physical devices they mirror. Below is a sample JSON format that is being used to represent the thing (here its Intel NUC Kit)

Each thing has a unique thingId and set of features that we discussed in the earlier section. We can also have attributes that describe the thing in more detail.

Also, we can find access control lists on who can perform read/write or use administer permissions.

{
    "thingId": "org.eclipse.ditto.example:demothing",
    "acl": {
        "ditto": {
            "READ": true,
            "WRITE": true,
            "ADMINISTRATE": true
        }
    },
    "attributes": {
        "manufacturer": "Demo Manfacturer",
        "hostname": "Demohost"
    },
    "features": {
        "TemperatureSensor": {
            "properties": {
                "temperatureValue": 20.5,
                "lastUpdate": "2019-10-16 15:07:31.436733",
                "samplingRate": 1
            }
        }, ….. 
        }      
    }
}

The features section holds the current temperature value of the Temperature Sensor.

Image – Things/Attributes/Features

Ditto has hosted a sandbox server that may be used by anyone to try out Ditto without starting it locally.

Step#3. Use prebuilt Ditto APIs to Retrieve & Modify the state of the Thing/Feature/Attribute.

Once we have the data about features/attributes from the sensors we can use Ditto APIs to retrieve or modify the state of Thing/Feature/Attribute. All the states and properties can be read, updated, and collated.

There is also an option to route a command/message towards an actual device.

Image – Example Web Application that is built to view/modify sensor values.

Congrats! we have successfully built Digital Twin using Ditto!

More examples can be located here.

Step #4. Build ML model based on Digital Twin to predict failure.

Now we have the time-series data available and stored in our Digital Twin Server, our next step is to build an ML model based on the data collected to predict failure based on core attributes such as CPU, Memory, Disk Space, connection state, or the performance of external interfacing systems.

We can use any of the ML algorithms to build a model that can predict failures based on the attributes.

Looking forward

Businesses are moving towards developing a predictive maintenance model using digital twins that optimizes the maintenance cycle with the advances in IoT space, extending the life of the part by reducing unplanned maintenance and labor costs. By using digital twins and the predictive maintenance strategy, companies gain cost savings and strategic advantages in the industry.

Like this post? Don’t forget to share it!

Additional Resources :

Summary
Article Name
How to build Digital Twin using Eclipse Ditto?
Description
Businesses are moving towards developing a predictive maintenance model using digital twins that optimizes the maintenance cycle with the advances in IoT space, extending the life of the part by reducing unplanned maintenance and labor costs. By using digital twins and the predictive maintenance strategy, companies gain cost savings and strategic advantages in the industry.
Author
Publisher Name
Upnxtblog
Publisher Logo
Karthik

Allo! My name is Karthik,experienced IT professional.Upnxtblog covers key technology trends that impacts technology industry.This includes Cloud computing,Blockchain,Machine learning & AI,Best mobile apps, Best tools/open source libs etc.,I hope you would love it and you can be sure that each post is fantastic and will be worth your time.

Share
Published by
Karthik

Recent Posts

Finding the Right Time to Build Your Software Instead of Buy

There are few things as valuable to a business as well-designed software. Organizations today rely…

1 week ago

Innovators in Crypto: Prominent AI-Powered Coins

The cryptocurrency industry is being reshaped by the fusion of blockchain technology and artificial intelligence…

3 weeks ago

Top AI Design Tools Every Graphic Designer Should Use in 2024

Introduction Artificial Intelligence (AI) has also found its relevance in graphic design and is quickly…

2 months ago

Transforming Industries: The Integration of AI and Blockchain

Imagine a world where the brilliance of Artificial Intelligence (AI) meets the unbreakable security of…

2 months ago

How Can I Use Automation to Streamline My Digital Marketing Efforts?

In today’s fast-paced digital landscape, automation is not just a luxury but a necessity for…

2 months ago

Top 5 AI Technologies Transforming the Casino Gaming Landscape in 2025

The world of casino gaming has leveraged the emerging technology advancements to create immersive and…

3 months ago

This website uses cookies.