vaibhav sharma

Thermal Analysis of Heat Exchanger Using Azure IoT Hub

Heat exchanger considers one of the most common types of exchangers widely used in industrial processes. This exchanger consists of a vessel with different sizes contains a number of tubes inside. The rate of transferred heat depends on several factors such as feed temperature and humidity, shell diameter, a number of tubes, tube geometry, baffle spacing, and cutting spacing. So temperature analysis becomes very important in order to maintain the correct temperature in tubes and diagnose the faults in it. Correct measures taken can increase the fault tolerance of the device.

Wireless sensor networks have been installed in many industrial applications like structural monitoring of civil infrastructure, vibration analysis of hydro turbines, etc. and have done remarkably well in irradicating many of the industrial complications.

In this Instructable we will be going through wireless temperature and humidity sensors and their advantages in the thermal analysis of heat exchangers. So here we will be demonstrating the following:

  • Wireless temperature and humidity sensors.
  • Temperature analysis using these sensors.
  • Gathering and analysing the data using wireless gateway device.
  • Publishing and subscribing to sensor data using Azure.

Hardware and Software Specifications

Software Specification Hardware Specification

IoT Long Range Wireless Temperature Humidity Sensor

These are industrial grade long range temperature and humidity sensors with a sensor resolution of ±1.7%RH ±0.6° C. Powered by just 2 AA batteries (included) with an operational lifetime of 500, 000 wireless transmissions, you can expect to achieve up to 10 years of battery life depending on environmental conditions and the transmission interval can be chosen by you. Optionally, this sensor may be externally powered. These sensors have 2 mile range with on-board antenna. The range can be boasted up to 28 miles using mesh networking architecture.

Getting the Temperature and Humidity Values

We are getting following values from the wireless temperature and humidity sensors:

  • Temperature in Celcius
  • Temperature in Fahrenheit
  • Relative humidity
  • Battery usage

These data is then visualized and analyzed in Azure IoT hub. To get Started with setting up of Azure IoT Hub, Go through this tutorial. The following procedure is to be followed in order to send the values Azure IoT hub.

Azure IoT hub follows MQTT protocol in order to publish and subscribe the data.

  • Azure functions is another important feature provided by azure portal. Using Azure functions, we can write a piece of code or function in cloud. In this project we are parsing the JSON containing raw sensor data and getting the real temperature and Humidity values from it using Azure function. To set up Azure function follow this tutorial.
  • We will get the real temperature and humidity data using parsed JSON raw data

Analyzing Data in PowerBi

We are using Power BI to visualize the data. It provides interactive ways to analyze data. This data can be interpreted in the form of Line charts, Bar graphs, Pie charts etc. Start by creating an account in Power Bi and sign in into your account. In the last post, we had set up Power Bi and sent data to Power Bi using stream analytics job. In this post, we are using Azure function to send the sensor data to power Bi. To set up Power Bi read this blog.

There are four methods to send the data to Power Bi:

  • Directly streaming the data to Power Bi from IoT hub.
  • Using API to send data to Power Bi.
  • Using web-hook functions
  • Using PubNub.

Here in our case we are using Power BI API and sending a HTTP response to Power BI from azure function. There are different graphs, line charts, Pi charts etc. listed in the Visualization panel. We can create the chart by selecting any of the graphs from the Visualization panel.

We can also export the data as an excel sheet or in CSV format. Which in later stages can be used for data analytics.

Azure Function Code for PowerBI

Parse all the JSON objects from the JSON, and get the real values of temperature, humidity, and others. Here the product is a Product class object where we are storing the parsed values.

  • Now create a variable to store a connection string of Power Bi
  • Create an instance of HTTP client
  • We need to send JSON to power Bi. So, Serialize the Json using model class object.
  • Send the converted JSON to power bi as an HTTP request.

Data Visualization in Power BI

Here we are visualizing our sensor data at different dates and time. We can see the percentage change in Humidity, Temperature and Battery Usage during different days with there values respectively.

Azure Email Hosting for Wireless Temperature Sensor Using SendGrid

Software as a service(Saas application) provides another amazing feature called SendGrid. In Microsoft Azure, SendGrid support swiftly delivers Email notifications to different Users.

The setup for Send Grid is described in this blog.

Here We will be describing the code for sending email notification using Azure function.

Notification Outcomes

  • An automated email notification will be delivered to the user each time the temperature crosses the 30 degrees mark.
  • Send Grid delivers the Email Notification to the same subject every time. We don’t have to scroll down in the inbox in search of the last delivered message. Just search for the Temperature Alert!!! and you will get the list of messages.

Overall Code

The firmware of this setup can be found in this GitHub repository.

Originally published at

Full Stack IoT developer working on effective Wireless Sensor Network