A model of the heat exchange process in the heat exchanger of the cardiopulmonary bypass device is proposed which allows for automation of the process of temperature regulation in the cardiopulmonary bypass with an accuracy of ±1 °C during cardiac surgery under controlled cooling and warming of the patient’s heart and brain. The purpose of this research is to create a concept and model of the temperature control circuit using the MSC Easy5 system, the creation of mathematical models of blocks of the temperature control circuit, and the description of the principle of temperature control in the cardiopulmonary bypass circuit. The model of the temperature control loop in the heat exchanger of the heart-lung machine was created using the MSC Easy5 system with a programmable microcontroller. The microcontroller implements a specialized temperature control algorithm in the C language. The model allows the creation of a full-fledged virtual prototype of a temperature control device in a heat exchanger, and helps to conduct virtual tests of the developed device at the design stage. The model identifies control system flaws and influences decisions made before producing an official prototype of the product.