We know that it is important to monitor and control the temperature in the operating rooms. The temperature in the operating rooms is often between 18 and 24 degrees Celsius, and the humidity does not exceed 65%.
Maintaining these values is important to keep the operating bed environment sterile so that bacteria and microbes cannot colonize or multiply.
This sterile environment is ensured in our project in particular through the use of air conditioning, medical filters and ventilation systems.
The room pressure is higher than the atmospheric pressure outside the operating room to ensure complete safety of sterilization in the operating room during the surgery.
It is also important to know the intensity of the room lighting, and this is done by a LED RGB, if it is red, the light intensity is high, and if it is green, the light intensity is medium, if it is yellow, the light intensity is low.
Tools used in this projectWe'll list the tools and modules used in this project:
1) Temperature, Humidity, Light, Color, Sound and Motion Sensor Hub (H0AR9x)
Sensor Hub Digital temperature and humidity sensor, Ambient Light and RGB color sensor, sound sensor (MEMS microphone), motion detector (proximity IR sensor) [1].
2) RGB LED (H01R0x)
H01R0x is a smart RGB LED module [2].
3) 6 Digit Seven Segment (H3BR6x)
H3BR6x is a 6 digit seven segment interface module [3].
4) User Tools Kit:
This kit includes the tools that are essential for programming, debugging, and powering Hexabitz modules.
- FTDI USB to UART Serial cable:
The 4-pin USB 2.0 to UART serial cable is an indispensable tool for Hexabitz development! It incorporates FTDI’s USB to UART interface [4].
- Hexabitz BitzClamp:
Hexabitz BitzClamp is a modified Kelvin current clamp soldered to two 2.56 mm-pitch male jumper wires [5].
- STLINK-V3MODS Programmer (H40Rx):
H40Rx is a programmer module which contains STLINK-V3MODS stand-alone debugging and programming mini probe for STM32 microcontrollers (Hexabitz modules and other MCUs) [6].
- E-Z-Hook Programming Kit:
Instead of soldering SMD connectors there, you could use a nice off-the-shelf E-Z-Hook kit that we assembled for you [7].
We'll mention step-by-step instructions from designing to implementing 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.
2. Writing codes with STM32CubeIDE software:
Let's first create the topology for the three modules (H0AR9
, H3BR6
,H01R0
) and set their configurations, then add the same topology for all modules. See this link for help in creating a topology file.
#define __N 3 // Number of array modules
// Array modules
#define _mod1 1<<3
#define _mod2 2<<3
#define _mod3 3<<3
// Topology
static uint16_t array[__N ][7] ={
{_H0AR9, 0, 0, _mod2 | P1, _mod3 | P6, 0, 0}, // Module 1
{_H3BR6,_mod1 | P3, 0, 0, 0, 0, 0}, // Module 2
{_H01R0,0, 0, 0, 0, 0,_mod1 | P4}, // Module 3
};
// Configurations for duplex serial ports
#if ( _module == 1 )
#define H0AR9 1
#define _P1pol_normal 1
#define _P2pol_normal 1
#define _P3pol_normal 1
#define _P4pol_normal 1
#define _P5pol_normal 1
#define _P6pol_normal 1
#endif
#if ( _module == 2 )
#define H3BR6 1
#define _P1pol_reversed 1
#define _P2pol_normal 1
#define _P3pol_normal 1
#define _P4pol_normal 1
#define _P5pol_normal 1
#define _P6pol_normal 1
#endif
#if ( _module == 3 )
#define H01R0 1
#define _P1pol_normal 1
#define _P2pol_normal 1
#define _P3pol_normal 1
#define _P4pol_normal 1
#define _P5pol_normal 1
#define _P6pol_reversed 1
#endif
Now, let's enable the topology by uncommenting its #include directive in project.h file inside all modules.
#include "topology.h"
- H0AR9 Firmware main.c code:
This module (H0AR9) measures temperature and humidity in operating rooms.It sends a message to the module (H3BR6) to display them, it also measures light intensity and sends a message to the module RGB LED (H01R0) to turn it on.
First, we define our variables:
float temperature;
float humidity;
float NumberF;
uint16_t Number;
uint16_t red,green,blue,lumens,time,start,end;
Second, inside the userTask function, we write our code:
/* User Task */
void UserTask(void *argument){
// put your code here, to run repeatedly.
while(1){
time+=start-end;
start=HAL_GetTick();
SampleColor(&red, &green, &blue);
lumens=red+green+blue;
Number=lumens;
if(time<3000)
{
SampleTemperature(&temperature);
NumberF=temperature;
memcpy(&messageParams[0], &NumberF, 4);
messageParams[4] = 2;
messageParams[5] = 'c';
messageParams[6]=1;
SendMessageToModule(2,CODE_H3BR6_SevenDisplayQuantities,7);
}
if(lumens<=200)
{
messageParams[0] = 0;
messageParams[1] = YELLOW;
messageParams[2] = 30;
SendMessageToModule(3, CODE_H01R0_COLOR, 3);
}
if(lumens>200&&lumens<500)
{
messageParams[0] = 0;
messageParams[1] = GREEN;
messageParams[2] = 60;
SendMessageToModule(3, CODE_H01R0_COLOR, 3);
}
if(lumens>=500)
{
messageParams[0] = 0;
messageParams[1] = RED;
messageParams[2] = 100;
SendMessageToModule(3, CODE_H01R0_COLOR, 3);
}
if(time>3000&&time<6000){
SampleHumidity(&humidity);
Number=humidity;
NumberF=humidity;
memcpy(&messageParams[0], &NumberF, 4);
messageParams[4] = 2;
messageParams[5] = 'h';
messageParams[6]=1;
SendMessageToModule(2,CODE_H3BR6_SevenDisplayQuantities,7);
}
if(time>6000)
{
time=0;
}
end=HAL_GetTick();
}
}
/*-----------------------------------------------------------*/
To determine the illuminance, we used the following API from the H0AR9 factsheet [H0AR9x Factsheet – Hexabitz ], as shown in Figure (9).
To determine the temperature value, we used the following API from the H0AR9 factsheet [H0AR9x Factsheet – Hexabitz ], as shown in Figure(10).
To determine the moisture value, we used the following API from the H0AR9 factsheet [ H0AR9x Factsheet – Hexabitz ], as shown in Figure (11).
To illuminate the RGB LED in any color, we used the following message from the H01R0 factsheet [H01R0x Factsheet – Hexabitz ], as shown in Figure (12).
To display values with units on a seven-segment, we used the following message from the H3BR6 factsheet [H3BR6x Factsheet – HexabitzH3BR6x Factsheet – Hexabitz ], as shown in Figure (13).
Once we have written our codes, we download them for each module using the programmer.
ResultsHere are the results of our project. Enjoy watching!
[1]: Temperature, Humidity, Light, Color, Sound and Motion Sensor Hub (H0AR9x) – Hexabitz
[2]: RGB LED (H01R0x) – Hexabitz
[3]: 6 Digit Seven Segment (H3BR6x) – Hexabitz
[4]: 4-Pin USB-Serial Prototype Cable – Hexabitz
[5]: Hexabitz BitzClamp – Hexabitz
Comments