Hexabitz Thermopile Sensor is a great tool to measure the temperature of objects without physical contact and can be used in industrial process control, robots or household.
In this project, we used Hexabitz Thermopile Sensor Module (H09R9) to measure the water temperature in the heater and display it to the user, who can determine the desired temperature through an Android app. For this purpose, we used Hexabitz Bluetooth Module (H23R1) and Hexabitz SPDT Mechanical DC Relay Module (H0FR1).
We give you step by step instructions from the conception to the implementation of the project :
1. Planning the array and assembling the hardware:
First, we prepare the project parts and plan our array design by aligning the three modules side by side. Then we solder the modules together using Hexabitz Fixture.
After creating the topology for the three modules and setting their configurations, we add the topology for each module. See this link for help in creating a topology file.
First
, we defined our temperature sensor variable in the main.c file of the Thermopile Sensor (H09R9) module:
Then we initialized this variable in the user task function as BOS variable to share its value with other modules. To do this, we use the following API from the BOS factsheet:
And in the repeated closed loop, we made sure that MC periodically checks the temperature value of the sensor using the API from H09R9 factsheet and sends it to the Bluetooth module (H23R1) using the API from the BOS factsheet:
Second
, in the main.c file of the Bluetooth module (H23R1), we defined the variable for the temperature sensor with the same name and as a public variable so that it can be changed by the thermopile sensor module (H09R9), and then defined the other variables used in the code.
In the user task function, we initialized the Bluetooth properties to be discoverable and set the Bluetooth name using the APIs from the Bluetooth module (H23R1) factsheet:
Then we initialized the variable for the temperature sensor as BOS variable, as we had done in the code of the module Thermopile Sensor (H09R9).
In the repeated closed loop, the MC stores the received message in an array using the API from the H23R1 factsheet :
Then it checks if the message is a command to switch the relay ON or OFF, then it checks if the message is a command to get the sensor temperature, and if so, it converts the variable value and sends the result to the Android app using the API from the H23R1 factsheet :
Then it checks if the message contains the desired temperature value, and if so, it converts the value and stores it. Then it sends a message to the SPDT mechanical relay module DC (H0FR1) to switch the relay ON or OFF, depending on whether the user has changed the switch in the Android app, and based on the comparison result between the sensor temperature and the desired temperature.
Below you can see the application screen where there is a button that, when clicked, will automatically pair the Android phone with the specific MAC address of the Bluetooth module specified in the Android application code. Pairing with this address must be done in advance.
The ON / OFF switch sends a Bluetooth message from the Android phone to the Bluetooth module. Below the switch, the current operating status of the heater is displayed. Below that, the app shows the user the desired temperature, which can be changed with the thumb switch, and finally the value of the temperature detected by the thermosensor.
The following video shows the final results of our project, enjoy watching!
Comments