## 4 The Implementation of the Proposed System
### IoT Section for Temperature and Power Failure Monitoring  
Using Internet of Things technologies, the blood bag storage refrigerators (eight refrigerators for the four blood groups with factors of RH\({}^{+}\), RH\({}^{-}\)) were connected to eight temperature sensors (DHT-11) for maintaining and monitoring the blood bag temperature 24/7 within the acceptable temperature range (4 to 6 \({}^{\circ}\)C).  
The acceptable temperature limit for storage depended on the product type (whole blood, red blood cells, platelets, plasma, cryoprecipitate, antibodies, white blood cells, and blood substitutes). In this study, the whole blood product type was chosen to implement the test.  
7. The temperature sensor reads every ten seconds, about six readings per minute, and sends these values continuously via the ESP8266 microcontroller as a gateway using Internet technology;
8. The system sends the data (temperature values) via ESP8266 in two ways:  
Figure 10: The overview of the entire proposed system.  
* For local storing, the data are sent to the computer device by the PLX-DAQ tool to view and store the values via Excel sheets, so the administrator can view them at any time;
* For online storing, the data are sent to and stored in the cloud in real time;
* The ideal temperature value range is 4 to 6 \({}^{\circ}\)C;
- The acceptable temperature value range is 2 to 8 \({}^{\circ}\)C;
- Outside of the acceptable temperature value range is lower than 2 \({}^{\circ}\)C or higher than 8 \({}^{\circ}\)C.  
Temperature values (data) outside the assigned range predict problems such as the following: electrical faults, refrigerator malfunctions, the refrigerator door not closing correctly, etc.; the values are then sent to the cloud, and a warning is sent by the Blynk app to the administrator via email on their mobile phone. In addition, these values are sent to the computer device (for the Excel sheet) via PLX-DAQ tool and stored locally in the database. If 15 min pass and the issue is not solved, the system resends the alert several times more until the problem is solved;
* All data are sent, saved, and retrieved via the database of the proposed system;
* The admin can interact with all data through the Web app dashboard.  
Figure 11 below shows the connection of the temperature sensor with the refrigerator that supplies the O+ blood group. The link could be one sensor unit connected with one refrigerator or eight sensor units connected with eight refrigerators.  
Figure 12a,b shows how the monitoring process of the blood bag refrigerators was achieved via the Blynk app. Blynk was used due to the ease of development of the smartphone application, so it was used for model setup and configuration and real-time monitoring [54].  
In (a), the temperature degree within an acceptable range (5 \({}^{\circ}\)C) is shown, whereas (b) shows the warning message received on the mobile phone if the blood temperature is outside of the ideal or acceptable ranges.  
To ensure that the IoT devices worked during power failure, a backup Panasonic NCR18650B 3.6 V lithium-ion battery was used. It is a rechargeable battery with a high energy density, long stable power, and long run time and is ideal for portable devices. Both the power supply and the backup power supply were left outside the blood cooling device.  
Figure 11: The connected temperature sensor inside the blood bag refrigerator.