Control systems engineering is a very interesting engineering disciplines. It requires proper tools to teach it effectively, one of the tools is experimental setups. They are needed to understand and apply different control strategies and to connect theory with application. However, such setups might not be easy to reach for a number of reasons such as their relatively high prices. Hardware in the Loop (HIL) is a way to replace an experimental setup to be studied with an equivalent hardware, such as a PC or a microcontroller. In this paper a microcontroller is used to replace two different physical systems. In addition to simulating the systems, another microcontroller is also used to replace the control loop, i.e. the summing node and the controller. The simulation of the systems and the whole control loop on the microcontroller was carried out using difference equation method and Ordinary Differential Equations method whenever it is applicable. The interface between the two microcontrollers was established using serial communication protocol and ESP NOW. The performance of the control system is compared with MATLAB and showed very high accuracy. The simulation was run in real time, with a sample time of 10ms