Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/ /
Atlas Architecture Center
/ / /

Build an IoT Data Hub for Smart Manufacturing

Use cases: IoT, Analytics

Industries: Manufacturing and Mobility

Products and tools: MongoDB Atlas, MongoDB Time Series Collections, MongoDB Atlas Charts, MongoDB Connector for BI

Partners: Microsoft Azure

Modern factories rely on multiple machines and widgets that each produce data and coordinate with one another to manage complex manufacturing processes. Manufacturers must understand how these systems operate to troubleshoot errors and drive operational efficiency.

To help manufacturers build smarter applications, this solution shows how MongoDB Atlas can simplify an IoT landscape by taking data from disparate edge devices and using it to power applications.

You can extend the principles of this solution to other industries, such as:

  • Automotive: You can develop efficient factories and manage complex inventories to maximize car production.

  • Telecommunications: You can use IoT to offer more competitive services through mobile and connected devices.

  • Healthcare: You can deliver essential healthcare services both within medical institutions and on personal devices.

Many manufacturing environments have unique systems running their own proprietary software with a relational database. However, as data volume grows and data structures become more sophisticated, relational databases become harder to manage and their architecture becomes more complicated. This makes it difficult to transfer data between different systems and connect to newer applications.

Reference Architecture Without MongoDB

Figure 1. Reference architecture without MongoDB

MongoDB simplifies data management with its flexible document model, allowing you to organize data to fit your application requirements. It also offers you an expressive query API to retrieve data the way you want.

Reference Architecture With MongoDB

Figure 2. Reference architecture with MongoDB

Sensors in a factory can stream time series data for multiple machines, capturing the following data points:

  • Product Type

  • Air Temperature (K)

  • Process Temperature (K)

  • Rotational Speed (rpm)

  • Torque (Nm)

  • Tool Wear (min)

With MongoDB and its flexible document model, you can use a single time series collection to store all incoming sensor data. For example, you can store sensor data as follows:

{
"device_id": 1,
"sensor_id": 12345,
"start_date": ISODate("2023-01-31T10:00:00.000Z"),
"end_date": ISODate("2023-01-31T10:59:59.000Z"),
"measurements": [
{
"timestamp": ISODate("2023-01-31T10:00:00.000Z"),
"temperature": 298.1
"speed": 1551
"torque": 42.8
"failure": “No failure”
},
{
"timestamp": ISODate("2023-01-31T10:01:00.000Z"),
"temperature": 302.4
"speed": 1410
"torque": 65.7
"failure": “Power failure”
},
...
{
"timestamp": ISODate("2023-01-31T10:42:00.000Z"),
"temperature": 298.8
"speed": 1455
"torque": 41.3
"failure": “Tool wear failure”
}
],
"transaction_count": 4223,
"avg_temperature": 300.7
}

You can then use the MongoDB aggregation framework to easily query time series data. For example, you can group documents by the sensor date and return aggregate results, such as the average.

Solution Overview

Figure 3. Solution overview

This solution shows how to build a smart manufacturing hub using MongoDB Atlas and Azure IoT Edge. In this use case, simulated sensors send data from CNC machines to Azure IoT Hub. The data is then filtered and sent to MongoDB Atlas, where data consumers, such as analysts using MongoDB Charts, can access and use it.

To replicate this workflow, the solution uses sensor data to train a machine learning model that predicts the cause of a machine failure. You can implement this solution by following the instructions in the GitHub repository, which guides you through these steps.

1

You can use MongoDB as a feature store to train ML models. Once models are trained, you can convert the binaries and store them in another MongoDB collection for analysis. Use this notebook to train your ML model, and once your models are trained, use this model to make predictions with Azure functions.

2

Use Azure IoT Hub to connect, monitor, provision, and configure IoT devices. Use this link to set up IoT Hub in your Azure account, and when you’re ready, register a new device.

3

Use this web app to simulate data flow to Azure IoT and generate sample data.

4

Once data is in Azure IoT Hub, you can send it to Stream Analytics for filtering and then push it into MongoDB. Follow these instructions to set up a Stream Analytics job, and then add IoT Hub as an input for that job.

5

Now that data is in Stream Analytics, you can push it to a time series collection in MongoDB Atlas using this function. This data serves multiple use cases and data consumers. You can also run your machine learning model to get failure inferences using this function.

6

In MongoDB Atlas, you can make it available to users. For example, you can use Atlas Charts to create visualizations for BI teams.

  • Develop IoT applications: Collect relevant IoT data in MongoDB Atlas, and use it to train machine learning models and run business applications.

  • Scale IoT data: As a document-based database, MongoDB efficiently manages the large volumes of data generated by IoT applications.

  • Handle diverse data types: MongoDB’s flexible document model handles different data structures, allowing you to store data from multiple IoT devices and ML models in a single database.

  • Diana Annie Jenosh, MongoDB

  • Utsav Talwar, MongoDB

  • Dr. Humza Akhtar, MongoDB

  • App-Driven Intelligence with IoT data

  • Automotive Diagnostics Using Atlas Vector Search

  • Real-Time Audio-Based AI Diagnostics

Back

Transforming the Driver Experience

On this page