AWS provides many services in its IoT stack.
One of the services related to digital twin is IoT TwinMaker. In this article we will walk through the following:
- Usage of TwinMaker
- Connecting to various data sources
— Static data on S3
— On DynamoDB
—Static data on Timeseries DB
— IoT Sitewise data -> Through Streams - Architecture for integration
- Visualisation on Grafana
- Conclusion
Before diving into the TwinMaker service let’s look into what is a digital twin.
Digital Twin: as the name suggests digital twin is a twin of a real world device in a virtual world. This means that the virtual(digital) twin should:
- behave in the same way as the real world device
- it can be used for monitoring
- operate the real world device and
- can be used for predictive analysis (tweak the input parameters to predict the future behaviour)
Salient features of IoT TwinMaker when compared to IoT Sitewise:
- IoT TwinMaker is a service specifically designed to cater digital twin applications and related use cases.
- TwinMaker provides integration with multiple data sources through Lambda. (More on this further).
- Detailed visualization using Grafana where we can upload and view 3D model of the industrial setup and specific devices.
IoT TwinMaker terminologies:
- Entities- These are similar to real world devices. For each device, there must be one entity created on TwinMaker.
- ComponentType — This is more of a Class of a component. There can be two types of ComponentTypes:
— User-defined — These are generally created by users, where the componentTypes are specific to their usecases.
— Pre-defined — These are AWS defined for standard services. E.g. com.amazon.iotsitewise.connector. - Component — If ComponentType is a Class, Components are the objects that are created of a given ComponentType.
- Scene — This is the 3D model of a device, industrial setup. A Scene can be as broad as an entire industrial floor to a very simple real-world device of that of a small motor or blade.
- Tags — The data point to denote on a scene where the changing data can be checked is called as a Tag.
- Resource — A resource is kind of an artifact that would be used within the Digital twin ecosystem. This can be a JSON file, 3D image etc.
- Connectors — It is a medium to provide your data source as input.
The relationship between the above terms is shown below in an ER diagram.
After understanding the basics of Digital Twin and the terminologies of AWS IoT TwinMaker, let’s jump to some of the integration and architectures that involves IoT TwinMaker to realize real world scenarios.
Data flow
As per my understanding and PoC on TwinMaker, I found that the data is fetched on Grafana dashboard only when queried. This means, whenever there is a graph plotted w.r.t. a workspace, only then there is a query made to DataReader Lambda. This is when the logic within Lambda is executed. This means that:
- The data source need not be a stream of data.
- Also, the response of the queries from Grafana will be bound to the limitations of Lambda. (6MB maximum response payload and 15 mins max timeout).
Integration architectures
This article is about using IoT Twinmaker using different data sources. As mentioned above, the source of data need to be connected via connectors. Below are the different type of data sources that can be used with IoT TwinMaker:
- Static data on S3
- Data on DynamoDB
- Static data on Timeseries DB
- Data flowing from RaspberryPi (simulating hardware device) to Amazon Timestream DB
Integration of IoT Sitewise and IoT Twinmaker.
- Another important implementation will be using IoT Sitewise by passing the data through streams:
Visualization on Grafana
Grafana is an open source tool for metrics and logs visualization. During my PoCs I used open source Grafana. However, AWS provides managed Grafana services. Note that both the variants integrates very well with IoT TwinMaker.
Conclusion
AWS IoT TwinMaker offers a comprehensive end to end platform to realize the Digital Twin concepts. It facilitates and integrates seamlessly with other AWS and open source services.
- Let’s connect on LinkedIn. If you felt the above article informational and useful, please do mention and share.
- Click on the ‘follow’ button at the top of the article
References
- AWS IoT TwinMaker homepage: https://aws.amazon.com/iot-twinmaker/
- Industry 4.0 with TwinMaker: https://medium.com/industrial-digital-transformation-industry-4-0/aws-iot-TwinMaker -7027a558c9d8
- Excellent read: https://medium.com/globant/building-digital-twins-with-aws-iot-twinmaker-f2bb69c71a1d
- DataConnectors — https://docs.aws.amazon.com/iot-twinmaker/latest/guide/data-connector-interfaces.html
- TimestreamDB integration — https://catalog.us-east-1.prod.workshops.aws/workshops/c9cd344a-0d0b-42cb-8734-09667433f89c/en-US/1-introduction
- Timeseries data connectors — https://docs.aws.amazon.com/iot-twinmaker/latest/guide/time-series-data-connectors.html
- Integration with RaspberryPi using IoT Core- https://aws.amazon.com/blogs/iot/build-a-digital-twin-of-your-iot-device-and-monitor-real-time-sensor-data-using-aws-iot-twinmaker-part-1-of-2/
- DynamoDB integration — https://aws.amazon.com/blogs/iot/own-data-source-aws-iot-twinmaker/
- IoT Sitewise integration — https://catalog.us-east-1.prod.workshops.aws/workshops/4b8a4050-893e-40f3-9788-8256025024b4/en-US/introduction/getting-started