Introduction: Visualizing Barometric Pressure and Temperature Using Infineon XMC4700 RelaxKit, Infineon DPS422 and AWS.

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.

Step 1: Hardware

S2GO PRESSURE DPS422:

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 ADAPTER:

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 Relax Kit:

XMC4700 Microcontroller evaluation kit ; Hardware compatbile with 3.3V and 5V Arduino™ Shields

NodeMCU ESP8266:

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

  1. Create the thing on the AWS IOT core.
  2. Create the certificate and attach it to the thing created.
  3. Create the new policy and attach it to the thing.
  4. Now create a rule.
  5. Choose Send a message to an Amazon Kinesis Firehose stream.

Step 5: Kinesis Firehose Delivery Stream Configuration

  1. Click on Create delivery streams
  2. Select source as Direct PUT or other sources
  3. Disable the record transformation and record format conversion.
  4. Select destination as Amazon Redshift.
  5. Fill in the cluster details.
  6. 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.
  7. Enable the S3 compression as GZIP inorder to reduce the transfer time(Optional)
  8. Review the Firehose delivery and click on Create Delivery Stream

Step 6: Amazon Redshift Configuration

  1. Start with the cluster identifier, database name, master user and password.
  2. 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.
  3. Continue and then launch the cluster.
  4. Go to Query editor and create the table dps_info.

Security Group Inbound Rule for Redshift

  1. By default the redshift restricts inbound connections through VPC security group.
  2. Add the inbound rule for the redshift to allow Redshift to connect to other services such as QuickSight.

Step 7: Amazon QuickSight

  1. From the services list, select Amazon QuickSight. If you are first time user, QuickSight is free for use for 60 days and chargeable thereafter.
  2. After successfully setup of the account, click on new analysis from the dashboard.
  3. Give the name to your analysis.
  4. Select Redshift data source from the given list.
  5. Choose the spice database for storing the data. This is the in memory database provided by the QuickSight.
  6. You can additionally choose to schedule the refresh of the data into the SPICE.
  7. Add the required fields for analysis.
  8. Publish the dashboard from the share option. Give required access to other users to view the dashboard.

Step 8: Published Dashboard