Design and Development of an Electronic Controller for Accurate Temperature Management for Storage of Biological and Chemical Samples in Healthcare

: This paper presents the design and development of an electronic controller for accurate temperature management for the storage of biological and chemical samples in healthcare applications. In the introduction, some important application aspects related to the use of temperature control devices in healthcare are discussed. Keeping these aspects in mind, a brief overview of some related works is presented. The findings are then translated to specific requirements for an electronic controller, which is to be used in a temperature control device. These requirements made necessary the development of a custom controller, as no readily available solutions could be obtained. The paper proceeds with the design of a suitable architecture and discusses some of the design choices. Then, some implementation details are presented and the prototype controller, together with its user interface, is illustrated. Experiments are conducted and several points for improvement are identified. Overall, the main task of keeping accurate, traceable temperature at all times is accomplished successfully, and the electronic controller proves to be a viable solution that conforms to the identified requirements. Future versions will improve the speed of the temperature adaptation and include better user interface and wireless connectivity for remote monitoring and control.


Introduction
Healthcare applications often require the storage of various types of biological or chemical samples in carefully controlled conditions.Some examples include the storage of various blood components (e.g., red blood cells, leucocytes, platelets, and plasma) [1][2][3], vaccines [4][5][6], serums [7,8], etc.This storage capability is a prerequisite for the successful functioning of medical care facilities that often need on-site samples and handling protocols for the treatment of emergency patients [9].Other facilities such as blood banks, transfusion centers, and biobanks cannot operate without carefully setting and executing policies for the large-scale storage of the accumulated blood and cell samples [10][11][12].From a technical viewpoint, this needs specialized devices that are capable of achieving and maintaining a desired temperature level with a very high degree of accuracy, reliability, and traceability [13,14].As a rule, medical care facilities set appropriate policies and standards for the operation of these devices within the framework imposed by government regulatory agencies, but they do not have the necessary technical expertise to design and develop the devices themselves [15][16][17].This task falls on specialists from other fields such as mechanical and electrical engineering and computer science [18,19].
A typical device for temperature control in healthcare has to take several application aspects into consideration.First, a highly accurate bidirectional temperature control is needed; the device must be capable of both cooling and heating.There are several approaches suitable for this purpose.One possible approach is to use one or more thermo-electric cooling (TEC) elements [20].These elements can reverse the direction of the heat flow by using an H-bridge electronic circuit similar to the one for motor control applications.This elegant solution has two important drawbacks: it consumes relatively high amounts of energy, and it does not scale well for larger temperature-controlled spaces.Especially for larger devices, it needs an additional thermal balancing solution-e.g., a heat sink and one or more fans-to maintain the desired temperature inside the device [21].This lowers the efficiency and raises the complexity of the device.A second possible approach is to combine one or more conventional electric heaters and a refrigeration system that uses a compressor and a refrigerant agent.This solution is more efficient for larger storage spaces and has good scaling potential [22].It can maintain a wide range of temperatures, but the downside is the higher complexity and cost of the system.
A second application aspect related to the first one is that the temperature profile for storage of the samples should be flexible.It should ideally be programmable or selectable by the end user and it should cover a relatively large range of temperatures.This is necessary because the storage of different types of samples requires different temperatures and different speeds of change in these temperatures [23,24].
A third important application aspect is that the device must be designed and built according to a high reliability standard, which takes into consideration a certain degree of volatility of the environment around it [25].In addition to using high quality materials, this means that the device must also have reliable self-monitoring and, if possible, self-healing capabilities.It must log its condition along with any past or present faults on a regular basis and report the information to an outside observer or system [26].For this purpose, some form of an auxiliary backup uninterruptible power supply (UPS) is also expected.
A fourth application aspect is related to the cleaning, maintenance and servicing of the device, which must be as easy and undemanding as possible [27].Last but not least, the device should be safe to operate in the expected environmental conditions and any risks of fire, explosion, or dangerous battery leakage must be minimized [28].
The general application aspects that pertain to temperature control devices in healthcare are major determinants in the design and development of the proposed electronic controller.The purpose of our work is to create an electronic design that considers the aspects outlined above at a relatively low economic cost.The end goal is to enable the creation of reliable temperature control devices that are not too expensive, which should make them accessible to a large number of healthcare institutions.
The next several paragraphs of this paper present a brief overview of some related works.A number of authors provide guidance on the storage parameters of blood and its components.In [29], the authors discuss the impact of different storage temperatures on red blood cells.Experiments are conducted with blood storage at three different temperatures (2 • C, 4 • C, and 6 • C) and the results are summarized.An older study [30] discusses the effects of rapidly cooling down blood samples to temperatures in the range of 20-24 • C immediately after collecting them.The samples are then stored at this temperature range for up to 24 h.Another study [31] examines the effects of three vastly different storage temperatures-room temperature of 24 • C, low temperature of 4 • C, and freezer temperature of −80 • C-on the DNA and RNA of blood samples.The storage duration varies from 24 h up to 15 days.The results of some experiments with raising blood storage temperatures to 28 • C for several hours are presented in [32].The duration of the experiments encompasses 7 weeks, and the normal storage temperature is 4 • C. The effects of the storage of various blood, plasma, and serum samples at room temperature for different time periods are examined in [33].The authors of [34] discuss the impact of different temperatures and storage durations on calprotectin measurements of blood samples.The examined temperatures are 4 • C, 20 • C, and 37 • C, and the storage duration is up to 2 h.Another study concerning the storage conditions suitable for animal blood collection is published in [35].Microbiological studies may also require storing samples at predefined storage conditions, e.g., at specific temperature and humidity values, as stated in [36].
The impact of blood storage on the metabolism of red blood cells is discussed in [37].Both short-term and long-term storage durations are discussed.In [38], another study on the influence of storage durations and temperatures on blood samples is presented.The storage time is up to 24 h at 4 • C and room temperature.The storage of platelet concentrate is the topic of [39].The authors discuss some typical problems during storage and describe proper storage procedures including temperatures as well as quality estimation techniques.In another study on the topic of platelets [40], the authors give some advice about the improvement in platelet quality for transfusion purposes during storage.In [41], some storage parameters are mentioned that concern human platelet lysate used for cell-based therapeutics.Experiments with plasma-derived blood products may also require storage at specific temperatures for different time periods [42].The authors of [43] discuss the impact of temperature control on blood quality and summarize research findings related to the impact of time during which no temperature control is applied to blood samples.
The multitude of medical studies examining blood properties point to a need for storage devices with flexible and accurate temperature control, ideally with a digitally adjustable temperature profile over time.
From a technological point of view, one important topic concerning devices for temperature control in healthcare is their inclusion in larger infrastructures and healthcare processes.One overview of digital services and network-related technologies used in healthcare is given in [44].The authors of [45] propose a system based on a blockchain for storing information about the collection, transportation, and disposal of blood.Blood transactions between medical institutions are supported and information security and privacy aspects are carefully considered.Another similar blockchain system based on the architecture of Hyperledger Fabric is proposed in [46].The focus is on business-to-business (B2B) transactions between medical institutions with the goal of minimizing the time needed to ensure the blood supply for patients.In [47], the authors focus on the traceability and reliable logging of storage temperatures of vaccines throughout the logistics process.The use of a blockchain is proposed to ensure the integrity of the data.Another proposition for the use of blockchains to trace the blood supply as part of supply chain management for blood supply hubs is made in [48].
The integration of various devices for patient monitoring into a smart healthcare monitoring system is discussed in [49].Remote data access through a web server is provided for medical personnel.The authors of [50] propose a new web-based system that employs IoT sensors for the monitoring of inventories related to blood storage.The structure and typical procedures of a blood bank are presented, optimal storage temperatures are discussed, and steps for process optimizations by means of the proposed system are suggested.
The use of microfluidic chips for performing single red blood cell analysis is discussed in [51].The use of such sensors can complement the functionality of temperature control devices and enhance their usefulness to end users.In [52], some preparation methods for the analysis of biological samples via chromatography, spectrometry, and electrochemistry are presented.A sensor for non-invasive measurement of blood glucose is discussed in [53].It is compared with alternative methods for monitoring, such as Raman and near-infrared spectroscopy.A review on the same topic is published in [54].Various types of biosensors are described, and multiple monitoring technologies are presented.
In [55], the use of temperature monitoring devices is discussed with the idea to gather statistics and provide traceability regarding blood samples.The author of [56] provides an overview of some important approaches and technical devices for blood storage.Some guidelines related to time durations and temperature ranges are also summarized.In [57], the authors analyze the impact of plastic and glass materials that have contact with the stored blood samples along with the impact of the storage time and temperature of the samples.The authors of [58] compare the quality of blood samples gathered by two specific blood collection devices and stored at three different temperatures.Another blood collection device is analyzed in [59], which emphasizes again that blood collection tubes are an indispensable part of blood storage and transportation processes.The impact of blood collection tubes and blood storage time on the success rate of blood sample analysis is discussed in [60].The authors focus on tumor cell discovery.In [61], some technological trends and insights related to blood storage are presented from the viewpoint of a technological solution provider.A broad overview of some terminology, facts, and best practices pertaining to clinical blood collection and storage is given in [62].The importance of temperature control during the transportation of blood and more specifically red blood cell solutions for transfusion purposes is underlined again in [63].
Some new collection and sampling technologies pertaining to blood are discussed in [64].The focus of the study is on blood microsampling technologies, devices, and applications.The impact of the storage temperature is also discussed.In [65], the authors discuss the dried blood spot technology for biological analysis of blood samples.The impact of the storage temperature and humidity during the sample preparation is discussed at length.
Another overview of blood storage and blood banks is given in [66].Some typical procedures and regulations are outlined along with details about storage durations and temperatures.Some suggestions for improvement are also made.Another set of procedures and regulations related to blood storage using a specific set of devices and information services is presented in [67].In [68], some additional important aspects related to blood collection, transportation, and processing are described.The authors of [69] discuss the use of passive thermal indicators for the monitoring of blood samples outside of devices with active temperature regulation.The optimization of the thermal performance of medical storage devices based on TEC elements is the topic of [70].The authors discuss both the heating and the cooling performance.
In summary, the brief overview of the related works leads to the conclusion that the design and development of a device for temperature control in healthcare is a relatively complex undertaking that should involve specialists from different scientific fields, e.g., medical experts, mechanical and electronic engineers, and computer programmers.The paper focuses on one part of the device-the electronic controller-and presents some details related to the process of its design and development.The next section identifies and analyzes the requirements for the device electronics and the firmware.Then, the overall architecture of the electronic controller is created and its implementation, in the form of two printed circuit boards (PCBs), is discussed.Finally, some experimental results are presented, which serve as a successful proof-of-concept that the design of the controller conforms to the requirements and is capable of functioning without issues for extended periods of time.

Materials and Methods
This section translates some of the important application aspects for temperature control devices that were identified in the introduction into requirements for the electronic controller.After that, it elaborates on the creation of the controller architecture and its implementation.

Requirements Identification and Analysis
As an important part of the temperature control device, the electronic controller is directly responsible for taking care of the application aspects outlined in the introduction.The first application aspect is related to bidirectional temperature control.It must have a high degree of accuracy, which goes beyond the usual temperature tolerances of negative temperature coefficient (NTC) thermistors.Temperature sensors must be chosen carefully, and their accurate calibration is a requirement.
Controlling temperature typically involves powerful aggregates, e.g., TEC elements, electric heaters, compressors, and others.Some of them may work at lower voltages, e.g., TEC elements, but others work best at mains voltages, e.g., electric heaters and compressors.In order to handle mains voltages (typically between 110 V and 240 V AC), the electronic controller must employ some form of electric isolation and it must provide ways to deal with voltage spikes when powerful inductive loads are turned off.The topic is well researched [71,72], and in this case, there are two possible solutions: classic relays or solid-state relays (SSRs) based on triodes for alternating current (TRIACs).In both cases, the implementation must consider the presence of mains voltages on the PCB [73].This generally leads to a larger PCB size with sufficient spacing between regulated low voltages and mains voltages.Classic relays are electromechanical devices that cannot switch too quickly but are cheap and do not generate any excessive heat at large output currents.SSRs are electronic devices without any moving parts, but they have the major disadvantage of dissipating excessive power at high currents due to the non-zero P-N junction voltages (1.6 V-1.8 V), which leads to a requirement for a properly sized heat sink.An advantage of classic relays is their flexibility.They can have both normally open and normally closed contacts, which are useful in certain use cases, such as remote alarm triggering.In addition, there are no leakage currents in the off state and there is no required minimum output voltage.As temperature control is a relatively slow process, it is not expected for the device to even approach the guaranteed minimum number of mechanical relay operations by most manufacturers, which is in the vicinity of several million [74].This makes classic relays more suitable for this use case, which in turn makes the electronic controller simpler and more predictable in the operation of its power outputs.As multiple outputs are needed to control the bidirectional temperature control, this translates realistically to a requirement for a suitably sized separate and relatively heavy PCB with power relays.This PCB handles all high-voltage outputs and also caters to some other needs of the electronic controller, such as raising external remote alarms at voltage levels that are not known in advance during the design time.
The need to support flexible temperature profiles that are configurable by the end user translates to several important requirements for the electronic controller.First and foremost, it must be equipped with a digital microcontroller (MCU).Otherwise, the need for flexible adjustment of the temperature profiles would require too many electronics, which would be impractical.Second, the controller must be equipped with some form of a user interface (UI) with which it can be configured during run-time by authorized end users.It is worth mentioning at this point that medical environments are somewhat peculiar when it comes to operating UIs, e.g., resistive touchscreens are preferred to capacitive ones, as the latter cannot be operated easily with gloves [75].From an electronics point of view, the UI is often implemented as a PCB with an attached liquid crystal display (LCD) or an organic light-emitting diode (OLED) display, optional light-emitting diodes (LEDs), and tactile buttons mounted on the top or side panel of the device.A protective colored plastic shield is placed in front of the PCB.This shield has transparent sections, which provide visibility for the display and the LEDs, and opaque sections that provide text descriptions or graphics for the buttons and other hints for the user.The shield should be durable and easy to clean with typical chemicals, such as bleach solutions [76].This type of UI design points towards a requirement for a relatively small and light PCB operating at low voltages so that no danger is posed to the end user if the front plastic shield becomes damaged or liquids are spilled on it.
The third application aspect related to high reliability has multiple implications, as well.First, the power supply must be of high quality, and, in the ideal case, it should be certified for medical applications.Second, a backup UPS is also needed in case the mains voltage is interrupted or the power supply fails.This will keep the electronic controller running so that it can provide information to end users and raise remote alarms.The electronic controller needs to monitor the backup UPS and keep its battery in shape at all times.Third, a logging system must be devised to keep constant track of the temperature and possibly other parameters of the stored samples.A suitable system for interacting with the logs and printing information out, e.g., via a thermal printer, must be devised as part of the electronics and the UI.Any faults must be recorded and communicated to end users in a suitable manner.
The fourth application aspect leads to expectations for easy assembly and maintenance of the electronics inside the device.Safety concerns, economic cost, and sustainability considerations at this point make the use of lead-acid batteries for the backup UPS prefer-able to lithium batteries [77].A subdivision of the electronics into multiple PCB is also a good idea, which modularizes the solution and makes the identification of defects and the swapping of components easier.
The requirements summarized above made necessary the development of a custom electronic controller, as no readily available solutions could be obtained.Additional factors such as the optimization of the economic cost of manufacturing and assembling the solution had also to be considered at each design stage.
The next section presents the overall architecture of the electronic controller along with some deliberate design choices that result from the identified requirements.

Overall Architecture and Design Choices
This section presents the overall architecture of the electronic controller and the motivation for some of the design choices.As mentioned in the previous section, the requirements analysis led to the subdivision of the electronics into two PCBs: a highvoltage power PCB and a low-voltage main PCB.Each PCB comprises several distinct functional blocks, such as the two relay blocks of the power PCB and the MCU, and the UI blocks of the main PCB (Figure 1).The PCBs are connected to each other with a control connection in the form of a multicore cable for the relays and a power supply connection for powering the main PCB from the power PCB.A multitude of external devices are also connected to one or both PCBs, e.g., the power supply, a UPS battery, multiple sensors, a thermal printer, and an optional platelet agitator.and possibly other parameters of the stored samples.A suitable system for interacting with the logs and printing information out, e.g., via a thermal printer, must be devised as part of the electronics and the UI.Any faults must be recorded and communicated to end users in a suitable manner.
The fourth application aspect leads to expectations for easy assembly and maintenance of the electronics inside the device.Safety concerns, economic cost, and sustainability considerations at this point make the use of lead-acid batteries for the backup UPS preferable to lithium batteries [77].A subdivision of the electronics into multiple PCB is also a good idea, which modularizes the solution and makes the identification of defects and the swapping of components easier.
The requirements summarized above made necessary the development of a custom electronic controller, as no readily available solutions could be obtained.Additional factors such as the optimization of the economic cost of manufacturing and assembling the solution had also to be considered at each design stage.
The next section presents the overall architecture of the electronic controller along with some deliberate design choices that result from the identified requirements.

Overall Architecture and Design Choices
This section presents the overall architecture of the electronic controller and the motivation for some of the design choices.As mentioned in the previous section, the requirements analysis led to the subdivision of the electronics into two PCBs: a high-voltage power PCB and a low-voltage main PCB.Each PCB comprises several distinct functional blocks, such as the two relay blocks of the power PCB and the MCU, and the UI blocks of the main PCB (Figure 1).The PCBs are connected to each other with a control connection in the form of a multicore cable for the relays and a power supply connection for powering the main PCB from the power PCB.A multitude of external devices are also connected to one or both PCBs, e.g., the power supply, a UPS battery, multiple sensors, a thermal printer, and an optional platelet agitator.The power PCB contains one relay block housing six smaller relays that handle up to 16 A of current and one relay block housing one larger relay that handles up to 30 A of The power PCB contains one relay block housing six smaller relays that handle up to 16 A of current and one relay block housing one larger relay that handles up to 30 A of current.The larger relay is intended for an electric heater, which is usually the biggest power consumer in a temperature control device.The six smaller relays can operate TEC elements, compressors, fans, and illumination lights.They can also raise external remote alarms and connect or disconnect external devices, such as a platelet agitator.The power supply filtering block is connected directly to the power supply.It filters the input voltage, protects the electronics from transient voltages, and contains a safety fuse.The block is also responsible for providing power to activate each of the seven relays.
The power supply is a standard commercially available unit that converts the mains voltage to 15 V DC, implements several important protection mechanisms, and is certified for medical applications.
The main PCB is more complex and contains a total of six functional blocks.The voltage block takes its 15 V input voltage from the power PCB and converts it to 5 V and 3.3 V.This block provides some additional filtering and degree of protection, e.g., against accidental voltage polarity reversal.It powers the remaining functional blocks, any attached sensors, and the thermal printer.
The sensor block provides power and signal filtering for all connected sensors.Both digital and analog sensors for measuring temperature and humidity are supported.Digital sensors are preferred for this application but, if need be, NTC thermistors can also be used.Up to three sensors can be connected for doing measurements in different parts of the internal storage chamber.Up to two additional on/off switches that function as simple binary sensors can be connected for detecting open doors or compartments.
The external device communication block is responsible for sending and receiving information via the serial interface of the thermal printer and for monitoring the status of the optional platelet agitator.The block includes optocouplers and voltage level translators for interacting with the devices.An additional RS-232 communication interface is also provided for future extension, e.g., adding a GPRS/3G modem for Internet connectivity.
The MCU block contains the firmware of the electronics controller.It is based on a 32-bit Cortex-M3 MCU, which monitors and controls the activities of the other functional blocks.Additional elements include two quartz crystals, a small battery for keeping the real-time clock (RTC), and a serial-wire debug (SWD) interface.If future functionality extensions need more computational resources, the MCU can be upgraded relatively easily to a more powerful Cortex-M4 or Cortex-M7 MCU with enhanced abilities to execute floating-point calculations and perform data encryption.
The UI block includes an LCD or an OLED display, several LEDs of different colors, several tactile buttons, and a buzzer for acoustic feedback and alarm sounding.Several specialized integrated circuits (IC), such as a shift register and a priority encoder, are also present.The purpose of the UI block is to deliver information and notifications to end users and accept user feedback via the buttons.
The UPS block is responsible for monitoring and charging a deep-cycle lead-acid UPS battery.This battery is used as a backup power source in case the main power supply fails or is switched off.The UPS block contains electronic elements for current measurement and control, while the battery charging strategy is determined by the MCU block in real time.
The UPS battery is connected to both PCBs.It can power all relay coils of the power PCB and all electronics of the main PCB including the UI as well as the sensors and the thermal printer.
The thermal printer is a standard commercially available unit similar to the units used in fiscal printers.Its goal is to print daily and weekly reports about the storage conditions.Any abnormal sensor values or events such as power supply failure or platelet agitator alarms are noted down.Both text and graphics can be printed.
The platelet agitator is an external device that may be placed in the storage chamber of the temperature control device to shake the samples.It has its own alarm output that may be connected to the electronic controller for monitoring and logging purposes.
The next paper section will present the implementation of the discussed architecture and provide some additional details about each functional block.

Implementation
The implementation of the electronic controller includes the actual creation and manufacturing of the power PCB and the main PCB.First, PCB schematics are created that describe the individual electronic components and the connections between them.Next, the PCBs are routed, i.e., the components are placed at specific locations of the PCB and the electrical traces between them are drawn.Finally, the PCB production files, called Gerber files, and the positions of the components on each PCB are exported and sent to the manufacturing facility for production and assembly.The steps of the PCB design process outlined above are performed by means of the open-source electronic CAD software KiCad [78].The KiCad schematics of the power PCB are shown in Figure 2.
The implementation of the electronic controller includes the actual creation and manufacturing of the power PCB and the main PCB.First, PCB schematics are created that describe the individual electronic components and the connections between them.Next the PCBs are routed, i.e., the components are placed at specific locations of the PCB and the electrical traces between them are drawn.Finally, the PCB production files, called Gerber files, and the positions of the components on each PCB are exported and sent to the manufacturing facility for production and assembly.The steps of the PCB design process outlined above are performed by means of the open-source electronic CAD software KiCad [78].The KiCad schematics of the power PCB are shown in Figure 2. Six of the relays (RL1, RL2, RL4-RL7) have the same topology and are equipped with a protection BAT54C Schottky diode at the relay coil and an RC snubber and a fuse at the output.The last, more powerful relay (RL3) is controlled via a PNP transistor (Q3), as the current through the relay coil is larger.The power supply filtering block contains a fuse (F6), a transient voltage suppressor (TVS) diode (D8), a metal-oxide-semiconductor fieldeffect transistor (MOSFET) for reverse polarity protection (Q1), and several electrolytic and ceramic filtering capacitors (C10, C11 and C13).It also contains a 7812 linear voltage regulator (U1), which provides 12 V DC for the relay coils.If the mains power supply fails the relay coils are powered from the UPS battery.A multicore cable is attached to connector P11 and connects the relay coils to the main PCB.An indicator LED (D11) lights up when the PCB is powered on.A KiCad rendering of the routed power PCB is shown in Figure 3. Six of the relays (RL1, RL2, RL4-RL7) have the same topology and are equipped with a protection BAT54C Schottky diode at the relay coil and an RC snubber and a fuse at the output.The last, more powerful relay (RL3) is controlled via a PNP transistor (Q3), as the current through the relay coil is larger.The power supply filtering block contains a fuse (F6), a transient voltage suppressor (TVS) diode (D8), a metal-oxide-semiconductor field-effect transistor (MOSFET) for reverse polarity protection (Q1), and several electrolytic and ceramic filtering capacitors (C10, C11 and C13).It also contains a 7812 linear voltage regulator (U1), which provides 12 V DC for the relay coils.If the mains power supply fails, the relay coils are powered from the UPS battery.A multicore cable is attached to connector P11 and connects the relay coils to the main PCB.An indicator LED (D11) lights up when the PCB is powered on.A KiCad rendering of the routed power PCB is shown in Figure 3.
The low-voltage power supply filtering block and the control elements for the relay coils are situated in the middle part of the PCB.The relays are situated near the top and bottom edges of the PCB.The large track clearances are a consequence of the fact that they control actuators such as electric heaters or compressors that are connected to the mains voltage.
The schematics of the UI block and part of the external device communication block of the main PCB are shown in Figure 4.
The low-voltage power supply filtering block and the control elements for the relay coils are situated in the middle part of the PCB.The relays are situated near the top and bottom edges of the PCB.The large track clearances are a consequence of the fact that they control actuators such as electric heaters or compressors that are connected to the main voltage.The thermal printer is powered from the main board with 5 V DC.Its power supply can be switched on and off by the MCU via MOSFETs Q2 and Q3.The serial communica tion with the printer uses TX, RX, and CTS signals.Voltage level translators U3 and U4 take care of the signal level conversions.
Figure 5 shows a photo of the already manufactured main PCB.The connectors fo the sensors, the switches, the power supply, the thermal printer, and the optional platele agitator alarm, as well as the RTC battery, are situated near the board edges for easie assembly and maintenance.The alarm buzzer is located near the top right corner of the board.The LCD/OLED display is connected to connector P1.It is controlled by the MCU via a 74HCT595 shift register (U1), which also translates the 3.3 V signals from the MCU to 5 V signals for the display.Red (D2), yellow (D3), and green (D4) LEDs are also present to inform end users quickly of the general operating state of the temperature control device.They are controlled by the MCU via MOSFETs (Q4-Q6).Seven tactile buttons are connected to a 74HC148 priority encoder (U2).The encoder passes the index of a pressed button to the MCU, thus reducing the number of needed MCU inputs.A piezoelectric or electromagnetic buzzer (PZ1) is used for acoustic feedback.It is controlled by the MCU via a MOSFET (Q1).
The thermal printer is powered from the main board with 5 V DC.Its power supply can be switched on and off by the MCU via MOSFETs Q2 and Q3.The serial communication with the printer uses TX, RX, and CTS signals.Voltage level translators U3 and U4 take care of the signal level conversions.
Figure 5 shows a photo of the already manufactured main PCB.The connectors for the sensors, the switches, the power supply, the thermal printer, and the optional platelet agitator alarm, as well as the RTC battery, are situated near the board edges for easier assembly and maintenance.The alarm buzzer is located near the top right corner of the board.Because the main PCB also plays the role of a physical support for the tactile buttons and the LCD/OLED display that are attached directly to the back of the board, multiple mounting holes for screws are provisioned to attach the PCB to the top or side panel of the temperature control device.Multiple optocouplers near the top left corner of the PCB are used to provide electrical separation of the signals between the main PCB and the power PCB and the platelet agitator.
In comparison to the main PCB, the power PCB is usually mounted in an insulated enclosure near the back of the temperature control device, where the power aggregates (electric heater, compressor, etc.) are usually situated.Because the main PCB also plays the role of a physical support for the tactile buttons and the LCD/OLED display that are attached directly to the back of the board, multiple mounting holes for screws are provisioned to attach the PCB to the top or side panel of the temperature control device.Multiple optocouplers near the top left corner of the PCB are used to provide electrical separation of the signals between the main PCB and the power PCB and the platelet agitator.
In comparison to the main PCB, the power PCB is usually mounted in an insulated enclosure near the back of the temperature control device, where the power aggregates (electric heater, compressor, etc.) are usually situated.
The SMT172 digital sensors that are chosen for temperature measurement come precalibrated from the factory and have a maximum temperature deviation of 0.1 • C.This makes them a very good match for this use case, but their price is noticeably higher than the price of standard NTC thermistors.
If necessary, the electronics controller can be monitored and updated from an external machine.This could be accomplished either via the RS-232 interface (the black box-shaped IDC 10-pin connector located to the left of the RTC battery) or via the SWD interface (the white connector near the lower right corner of the PCB).
The reverse side of the PCB is shown in Figure 6.It contains a 20 × 4 blue OLED display and seven tactile buttons, which are carefully arranged in a physical pattern that is suitable for the UI of the temperature control device.The pads for soldering the three LEDs are located directly to the left of the OLED screen.The SMT172 digital sensors that are chosen for temperature measurement come pre calibrated from the factory and have a maximum temperature deviation of 0.1 °C.This makes them a very good match for this use case, but their price is noticeably higher than the price of standard NTC thermistors.
If necessary, the electronics controller can be monitored and updated from an exter nal machine.This could be accomplished either via the RS-232 interface (the black box shaped IDC 10-pin connector located to the left of the RTC battery) or via the SWD inter face (the white connector near the lower right corner of the PCB).
The reverse side of the PCB is shown in Figure 6.It contains a 20 × 4 blue OLED display and seven tactile buttons, which are carefully arranged in a physical pattern tha is suitable for the UI of the temperature control device.The pads for soldering the three LEDs are located directly to the left of the OLED screen.A protective colored plastic shield is placed in front of the UI elements.It contains text and graphical information describing the UI functions (Figure 7).The center of the shield and the status labels on the left side make use of transparent plastics (the light blue color elements of Figure 7) to enable end users to see the OLED display and the LEDs located behind the plastic shield.The seven circular icons at the bottom correspond to the location of the tactile buttons and make up the UI controls.The UI controls serve two purposes.First, they provide means for navigation through the controller menus.When a menu item is selected by the "OK" button, the value of the selected setting can be adjusted with the arrows.Second, they immediately launch controller actions such as printing the most recent device logs, switching on the illumination light of the device (if such a light is present), or raising an alarm.
The main PCB is assembled together with the protective plastic shield as a single module.This facilitates the adjustment of the distance between the plastic shield and the A protective colored plastic shield is placed in front of the UI elements.It contains text and graphical information describing the UI functions (Figure 7).The center of the shield and the status labels on the left side make use of transparent plastics (the light blue color elements of Figure 7) to enable end users to see the OLED display and the LEDs located behind the plastic shield.The seven circular icons at the bottom correspond to the location of the tactile buttons and make up the UI controls.The UI controls serve two purposes.First, they provide means for navigation through the controller menus.When a menu item is selected by the "OK" button, the value of the selected setting can be adjusted with the arrows.Second, they immediately launch controller actions such as printing the most recent device logs, switching on the illumination light of the device (if such a light is present), or raising an alarm.
Computation 2024, 12, x FOR PEER REVIEW 12 of 1 are connected to each other with power supply cables and a multicore data cable for the relay control that are prepared in advance.The next section summarizes some experimental results obtained from testing the electronic controller in combination with a prototype temperature control device.

Results
This section presents some experimental results obtained after mounting the elec tronic controller in a temperature control device that uses an electric heater in combination with a compressor and a refrigerant agent to maintain the temperature in a relatively smal internal storage chamber with dimensions 50 × 40 × 50 cm.Two of the aforementioned SMT172 digital temperature sensors were mounted near the left and right sides of the chamber.Additionally, the device has two fans integrated in its back plate to provide ai circulation through the storage chamber and a lamp for illumination.The two fans are connected in parallel and are controlled by one relay of the power PCB.The illumination light is connected to another relay.The device has two front doors with double insulation Two door switches connected in series are responsible for detecting when a door is open The exact configuration of the temperature control device has some impact on the behavior of the electronic controller.At the moment, the configuration details, e.g., the role of each power PCB relay, are specified during the compilation of the firmware.Fo example, if a specific relay is designated as illumination light control, then it is switched on automatically if a door is opened or if the user presses the UI button with the "ligh bulb" icon.The relay that controls the fans is intended to be switched on constantly if the doors are closed.This helps achieve uniform temperature levels within the storage cham ber.When a door is opened, the controller automatically turns off the fans to reduce the uncontrolled temperature exchange with the outside environment.The user can option ally force the fans to turn off through the settings menu of the UI.
Figure 8 shows a report printed via the thermal printer, which contains a graphica log of the temperature changes in the storage chamber after switching on the device fo the first time and leaving it unattended for a little more than 24 h.It can be observed tha the device needed a relatively long initial settling and adjustment time.One reason fo this was that the heating and cooling subsystems were much too powerful for the smal The main PCB is assembled together with the protective plastic shield as a single module.This facilitates the adjustment of the distance between the plastic shield and the tactile buttons and enables UI testing before integrating the electronic controller into the temperature control device.The final step is to mount the whole module as a separate functional unit on the top or side panel of the device.The power PCB, in its insulated enclosure, is another module that is mounted at the back of the device.The two modules are connected to each other with power supply cables and a multicore data cable for the relay control that are prepared in advance.
The next section summarizes some experimental results obtained from testing the electronic controller in combination with a prototype temperature control device.

Results
This section presents some experimental results obtained after mounting the electronic controller in a temperature control device that uses an electric heater in combination with a compressor and a refrigerant agent to maintain the temperature in a relatively small internal storage chamber with dimensions 50 × 40 × 50 cm.Two of the aforementioned SMT172 digital temperature sensors were mounted near the left and right sides of the chamber.Additionally, the device has two fans integrated in its back plate to provide air circulation through the storage chamber and a lamp for illumination.The two fans are connected in parallel and are controlled by one relay of the power PCB.The illumination light is connected to another relay.The device has two front doors with double insulation.Two door switches connected in series are responsible for detecting when a door is open.
The exact configuration of the temperature control device has some impact on the behavior of the electronic controller.At the moment, the configuration details, e.g., the role of each power PCB relay, are specified during the compilation of the firmware.For example, if a specific relay is designated as illumination light control, then it is switched on automatically if a door is opened or if the user presses the UI button with the "light bulb" icon.The relay that controls the fans is intended to be switched on constantly if the doors are closed.This helps achieve uniform temperature levels within the storage chamber.When a door is opened, the controller automatically turns off the fans to reduce the uncontrolled temperature exchange with the outside environment.The user can optionally force the fans to turn off through the settings menu of the UI.
Figure 8 shows a report printed via the thermal printer, which contains a graphical log of the temperature changes in the storage chamber after switching on the device for the first time and leaving it unattended for a little more than 24 h.It can be observed that the device needed a relatively long initial settling and adjustment time.One reason for this was that the heating and cooling subsystems were much too powerful for the small dimensions of the storage chamber.Another reason was the very conservative correction made by the electronic controller; it adjusted the activation temperatures of the heater and the compressor by 0.01 • C per one activation cycle of an adjustable duration of up to several minutes.One measure that can be taken to speed up the initial settling process is to create a database of temperature control devices, which stores the dimensions of the storage chamber, the thickness and the type of the thermal isolation, and the type and the power of the heating and cooling subsystems.Then, the electronic controller can use this database to load much more optimal initial settings, which will speed up the settling time.dimensions of the storage chamber.Another reason was the very conservative correction made by the electronic controller; it adjusted the activation temperatures of the heater and the compressor by 0.01 °C per one activation cycle of an adjustable duration of up to several minutes.One measure that can be taken to speed up the initial settling process is to create a database of temperature control devices, which stores the dimensions of the storage chamber, the thickness and the type of the thermal isolation, and the type and the power of the heating and cooling subsystems.Then, the electronic controller can use this database to load much more optimal initial settings, which will speed up the settling time.Another possibility is to reduce the power of the heating and cooling subsystems.In the case of Figure 8, the temperature regulation after the initial settling time is very good, but the monetary investment in such powerful heating and cooling subsystems may not be necessary.As inferred from the report, the electronic controller has the potential to provide empirical feedback and suggestions for correction of the power of the heating and cooling subsystems of the device after an initial test run of several hours.This possible application will be examined further as part of our future work on the controller.
The alternative text form of temperature reports is shown in Figure 9.The temperature values are printed on the hour, which makes the report more compact but omits some information in comparison to the graphical form of the previous figure.The print time intervals for both report forms are adjustable by the end user and temperature reports can be printed out automatically at pre-specified times of day.Initially, all reports made use of the classic Unix time storage style [79], which keeps count of the elapsed seconds starting from 1 January 1970.Traditionally, the number of elapsed seconds is stored in a 32-bit signed integer variable.The latest possible representable date is 19 January 2038.This date is too close to the present time to be a comfortable choice.Two approaches to alleviate the situation were evaluated.The first approach is Another possibility is to reduce the power of the heating and cooling subsystems.In the case of Figure 8, the temperature regulation after the initial settling time is very good, but the monetary investment in such powerful heating and cooling subsystems may not be necessary.As inferred from the report, the electronic controller has the potential to provide empirical feedback and suggestions for correction of the power of the heating and cooling subsystems of the device after an initial test run of several hours.This possible application will be examined further as part of our future work on the controller.
The alternative text form of temperature reports is shown in Figure 9.The temperature values are printed on the hour, which makes the report more compact but omits some information in comparison to the graphical form of the previous figure.The print time intervals for both report forms are adjustable by the end user and temperature reports can be printed out automatically at pre-specified times of day.dimensions of the storage chamber.Another reason was the very conservative correction made by the electronic controller; it adjusted the activation temperatures of the heater and the compressor by 0.01 °C per one activation cycle of an adjustable duration of up to several minutes.One measure that can be taken to speed up the initial settling process is to create a database of temperature control devices, which stores the dimensions of the storage chamber, the thickness and the type of the thermal isolation, and the type and the power of the heating and cooling subsystems.Then, the electronic controller can use this database to load much more optimal initial settings, which will speed up the settling time.Another possibility is to reduce the power of the heating and cooling subsystems.In the case of Figure 8, the temperature regulation after the initial settling time is very good, but the monetary investment in such powerful heating and cooling subsystems may not be necessary.As inferred from the report, the electronic controller has the potential to provide empirical feedback and suggestions for correction of the power of the heating and cooling subsystems of the device after an initial test run of several hours.This possible application will be examined further as part of our future work on the controller.
The alternative text form of temperature reports is shown in Figure 9.The temperature values are printed on the hour, which makes the report more compact but omits some information in comparison to the graphical form of the previous figure.The print time intervals for both report forms are adjustable by the end user and temperature reports can be printed out automatically at pre-specified times of day.Initially, all reports made use of the classic Unix time storage style [79], which keeps count of the elapsed seconds starting from 1 January 1970.Traditionally, the number of elapsed seconds is stored in a 32-bit signed integer variable.The latest possible representable date is 19 January 2038.This date is too close to the present time to be a comfortable choice.Two approaches to alleviate the situation were evaluated.The first approach is straightforward: the type of the variable is changed to a 64-bit signed integer.This solves Initially, all reports made use of the classic Unix time storage style [79], which keeps count of the elapsed seconds starting from 1 January 1970.Traditionally, the number of elapsed seconds is stored in a 32-bit signed integer variable.The latest possible representable date is 19 January 2038.This date is too close to the present time to be a comfortable choice.Two approaches to alleviate the situation were evaluated.The first approach is straightforward: the type of the variable is changed to a 64-bit signed integer.This solves the problem completely but causes unnecessary overhead in all time-related calculations on the 32-bit MCU that is used in the electronic controller.The second approach is to use a 32-bit unsigned integer variable and to change the starting date to one that is closer to the present time.The downside of this approach is that no dates before the starting date can be represented by the RTC. 1 January 2016 was chosen as a starting date to give some leeway of around six (five plus one) full years in the past if need be.The latest possible representable full year is then 2151, which is far enough in the future.As no past dates are expected to be used in this application scenario, this approach was implemented in the firmware.
The UI of the electronic controller functioned as intended, but it was somewhat cumbersome to operate in practice.End users needed some initial learning time before being able to make adjustments to the controller settings.Figure 10 shows an example of the menu option for temperature adjustment.a 32-bit unsigned integer variable and to change the starting date to one that is closer to the present time.The downside of this approach is that no dates before the starting date can be represented by the RTC. 1 January 2016 was chosen as a starting date to give some leeway of around six (five plus one) full years in the past if need be.The latest possible representable full year is then 2151, which is far enough in the future.As no past dates are expected to be used in this application scenario, this approach was implemented in the firmware.
The UI of the electronic controller functioned as intended, but it was somewhat cumbersome to operate in practice.End users needed some initial learning time before being able to make adjustments to the controller settings.Figure 10 shows an example of the menu option for temperature adjustment.The blue OLED display was very pleasant to look at and it was bright enough to be read under any type of lighting.Nevertheless, there were two main issues with it, stemming from its traditional conceptual design.First, the symbols that it can show are hardcoded in predefined code tables.This is a well-known limitation of this type of display, but its impact on the user experience was underestimated and led to some peculiar UI element choices, such as the vertical arrows depicted in Figure 10.Second, the limited amount of information that the display can show at any one time proved to be an inconvenient restriction during the design of the UI.Among the consequences were the long menus that were somewhat difficult to navigate and the report logs that were difficult to read on the screen.The printed version of the report logs was much more legible.This is not an ideal situation if a quick visual inspection of the data is desired without a need for paper proof.As part of the future work on the controller, experiments will be performed with a graphical touch-based display of higher resolution, which is capable of showing arbitrary graphics.This will make the development of the UI more difficult, but end users should have an easier time and better user experience navigating it.
Another optional but very convenient functionality for the experimental phase that was quickly identified was the provision of a convenient interface for remote monitoring and management of the controller.The options that were included in the controller design and implementation at that point were a binary relay-based alarm output and an RS-232 interface that was intended for a future optional GPRS/3G modem.During the experiments, the RS-232 interface was used for remote monitoring and control by connecting a USB-transceiver and a portable computer to it, but it was not very convenient.In the future, some form of wireless connectivity for test purposes will be provided by using readily available communication technology, e.g., a Bluetooth module with a serial port profile (SPP) or an nRF24L01+ wireless module.The goal is to be able to monitor, control, and upgrade a group of nearby devices without needing any external wiring.
The backup UPS was also tested and found to be working very well.Alarms-visual, acoustic, and remote-were raised as soon as the main power supply was switched off.The UPS battery monitoring and charging functions operated as intended.The blue OLED display was very pleasant to look at and it was bright enough to be read under any type of lighting.Nevertheless, there were two main issues with it, stemming from its traditional conceptual design.First, the symbols that it can show are hard-coded in predefined code tables.This is a well-known limitation of this type of display, but its impact on the user experience was underestimated and led to some peculiar UI element choices, such as the vertical arrows depicted in Figure 10.Second, the limited amount of information that the display can show at any one time proved to be an inconvenient restriction during the design of the UI.Among the consequences were the long menus that were somewhat difficult to navigate and the report logs that were difficult to read on the screen.The printed version of the report logs was much more legible.This is not an ideal situation if a quick visual inspection of the data is desired without a need for paper proof.As part of the future work on the controller, experiments will be performed with a graphical touch-based display of higher resolution, which is capable of showing arbitrary graphics.This will make the development of the UI more difficult, but end users should have an easier time and better user experience navigating it.
Another optional but very convenient functionality for the experimental phase that was quickly identified was the provision of a convenient interface for remote monitoring and management of the controller.The options that were included in the controller design and implementation at that point were a binary relay-based alarm output and an RS-232 interface that was intended for a future optional GPRS/3G modem.During the experiments, the RS-232 interface was used for remote monitoring and control by connecting a USBtransceiver and a portable computer to it, but it was not very convenient.In the future, some form of wireless connectivity for test purposes will be provided by using readily available communication technology, e.g., a Bluetooth module with a serial port profile (SPP) or an nRF24L01+ wireless module.The goal is to be able to monitor, control, and upgrade a group of nearby devices without needing any external wiring.
The backup UPS was also tested and found to be working very well.Alarms-visual, acoustic, and remote-were raised as soon as the main power supply was switched off.The UPS battery monitoring and charging functions operated as intended.
Overall, apart from the several issues noted above, the experimental results were very satisfactory.After the initial settling time, the electronic controller regulated the temperature in the storage chamber with the expected high degree of accuracy, which is its main task.The remaining requirements outlined in the previous section regarding the flexibility, reliability, safety, assembly, and maintenance of the solution were also satisfied.
The reliability testing included constant uninterrupted operation of the temperature control device for several months.Temperature fluctuations of the environment and power outages occurred naturally.The latter were also simulated intentionally by disconnecting the device from the electrical power grid from time to time.The device doors were opened and closed at irregular intervals to simulate normal usage.An additional independent digital temperature meter was placed inside the storage chamber to compare temperatures in real time.The printed reports and the UPS battery state were monitored and analyzed carefully to pinpoint and fix any irregularities in the operation of the device.
The next section provides a discussion of the work completed so far and gives some directions about the future development of the electronic controller.

Discussion
The design, implementation, and testing of the electronic controller showed that the design decisions were suitable for the application.The organization of the electronics in two separate PCBs located in different parts of the temperature control device proved to be very convenient during the assembly and mounting phases.The relays of the power PCB are connected to relatively thick cables at the back part of the device, while the main PCB, together with the protective plastic shield, needs careful mounting on the top or side panel of the device.The implementation phase showed that KiCad-as open-source software-is not far behind commercial electronic CAD software and completely capable of being used to prepare the production files needed for this controller.
The testing phase yielded some surprising results: the use of overly powerful heating and cooling subsystems was a bit of a challenge for the very conservative initial settings of the controller.For example, the large thermal mass of the electric heater led to some significant overshooting of the temperature before being gradually corrected by the controller.The speed of this correction should be improved by setting better initial parameters depending on the temperature control device that the controller is embedded in.
Future tests should also consider the impact of placing new samples (and possibly removing old ones) of different sizes and temperatures in the storage chamber.The resulting dynamic changes in the thermal mass and temperature inside the chamber may have the potential to disrupt existing samples that are already placed in the device.
Another area for future improvement is related to the UI display.It should be upgraded to a graphical display capable of showing arbitrary symbols and figures.In this regard, a resistive touch interface may prove to be a good substitute for the tactile buttons.
Last but not least, some form of wireless connectivity (Bluetooth, nRF24L01+, etc.) will be a welcome addition during future tests and perhaps also during the real operation at end users' facilities.It will make the remote monitoring, adjustment and upgrade of multiple temperature control devices easier.Raising alarms and planning future maintenance should also be facilitated by having real-time information about the status of the devices, their uptime, and temperature response.Making log backups and storing an action history for each device may also be of use for future traceability and as proof that proper procedures regarding the samples are observed.

Figure 1 .
Figure 1.Overall architecture of the electronic controller.

Figure 1 .
Figure 1.Overall architecture of the electronic controller.

Figure 2 .
Figure 2. Schematics of the power PCB.

Figure 2 .
Figure 2. Schematics of the power PCB.

Figure 3 .
Figure 3. KiCad rendering of the routed power PCB.

Figure 4 .
Figure 4. Schematics: UI block and part of the external device comm.block of the main PCB.

Figure 4 .
Figure 4. Schematics: UI block and part of the external device comm.block of the main PCB.

Figure 4 .
Figure 4. Schematics: UI block and part of the external device comm.block of the main PCB.

Figure 5 .
Figure 5. Main PCB, populated with all electronic components and connectors.

Figure 5 .
Figure 5. Main PCB, populated with all electronic components and connectors.

Figure 6 .
Figure 6.Main PCB, reverse side, with a blue OLED display and seven tactile buttons.

Figure 6 .
Figure 6.Main PCB, reverse side, with a blue OLED display and seven tactile buttons.

Figure 7 .
Figure 7. Protective colored plastic shield with information about the UI elements.

Figure 7 .
Figure 7. Protective colored plastic shield with information about the UI elements.

Figure 8 .
Figure 8. Thermal printer report of the temperature changes in the storage chamber.

Figure 9 .
Figure 9. Thermal printer report in text form.

Figure 8 .
Figure 8. Thermal printer report of the temperature changes in the storage chamber.

Figure 8 .
Figure 8. Thermal printer report of the temperature changes in the storage chamber.

Figure 9 .
Figure 9. Thermal printer report in text form.

Figure 9 .
Figure 9. Thermal printer report in text form.

Figure 10 .
Figure 10.UI menu option for temperature adjustment.

Figure 10 .
Figure 10.UI menu option for temperature adjustment.