It is a simple project to capture the barometric pressure and temperature using Infineon's DPS 422. It becomes clumsy to track the pressure and temperature over a period of time. This is where analytics comes in picture, the insight on the change in the pressure and temperature over a period of time can help in detecting faults and perform predictive maintenance.
The attraction for making this project is the usage of industrial grade pressure sensor of Infineon and get the insight from the measurements using Amazon QuickSight.
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Hardware
This is an absolute barometric pressure sensor. It is an industrial grade sensor with relative accuracy ±0.06 hPa. And with temperature accuracy of ±0.5°C.
My IoT adapters are gateways to external hardware solutions like Arduino and Raspberry PI, which are popular IoT hardware platforms. All this enables the fastest evaluation and development of IoT system.
XMC4700 Microcontroller evaluation kit ; Hardware compatbile with 3.3V and 5V Arduino™ Shields
NodeMCU is an open source IoT platform. It includes firmware which runs on the ESP8266WiFi SoC from Espressif Systems, and hardware which is based on the ESP-12 module.
Step 2: Solution Architecture
Amazon webservices provides the MQTT service to connect the devices to the cloud. The MQTT model essentially works on the principle of publish-subscribe. The device which is the DPS310 sensor in this case, acts as a publisher that publishes the pressure and temperature to the AWS IOT core service which acts as a subscriber. The message received is forwarded to the Amazon Kinesis Delivery Stream using the AWS IoT core rule set. The Delivery Stream is configured to deliver the message to the Amazon Redshift cluster. Amazon Redshift is the data warehousing service provided by the AWS. The data received i.e, pressure and temperature along with the timestamp is added to the cluster table. Now, Amazon QuickSight the business intelligence tool provided by AWS comes into picture which converts the data in redshift cluster into visual representation to get insight out of the data.
Step 3: Software
Source Code for NodeMCU ESP8266 can be found here:
Step 4: AWS IOT Core Configuration
- Create the thing on the AWS IOT core.
- Create the certificate and attach it to the thing created.
- Create the new policy and attach it to the thing.
- Now create a rule.
- Choose Send a message to an Amazon Kinesis Firehose stream.
Step 5: Kinesis Firehose Delivery Stream Configuration
- Click on Create delivery streams
- Select source as Direct PUT or other sources
- Disable the record transformation and record format conversion.
- Select destination as Amazon Redshift.
- Fill in the cluster details.
- As the message from the DPS is to be generated in the JSON format, the copy command should be changed accordingly. In the COPY options box, enter JSON ‘auto’. Also, as we are going to use GZIP compression the same need to be mentioned in options box.
- Enable the S3 compression as GZIP inorder to reduce the transfer time(Optional)
- Review the Firehose delivery and click on Create Delivery Stream
Step 6: Amazon Redshift Configuration
- Start with the cluster identifier, database name, master user and password.
- Select Node type as dc2.large, clustertype as multinode if you wish to incorporate separate compute nodes. Mention the number of compute nodes if multinode cluster type selected.
- Continue and then launch the cluster.
- Go to Query editor and create the table dps_info.
Security Group Inbound Rule for Redshift
- By default the redshift restricts inbound connections through VPC security group.
- Add the inbound rule for the redshift to allow Redshift to connect to other services such as QuickSight.
Step 7: Amazon QuickSight
- From the services list, select Amazon QuickSight. If you are first time user, QuickSight is free for use for 60 days and chargeable thereafter.
- After successfully setup of the account, click on new analysis from the dashboard.
- Give the name to your analysis.
- Select Redshift data source from the given list.
- Choose the spice database for storing the data. This is the in memory database provided by the QuickSight.
- You can additionally choose to schedule the refresh of the data into the SPICE.
- Add the required fields for analysis.
- Publish the dashboard from the share option. Give required access to other users to view the dashboard.