Closed-Loop Temperature Control Using MATLAB@Simulink, Real-Time Toolbox and PIC18F452 Microcontroller

  • Edin MujčićEmail author
  • Una Drakulić
  • Merisa Škrgić
Conference paper
Part of the Lecture Notes in Networks and Systems book series (LNNS, volume 3)


Today’s way of life is closely linked with technology and it would be impossible without a microcontrollers. They are represented in all spheres of life: in the automotive industry, robotics, computer systems, home appliances, etc. Also, today’s life is unthinkable without computers. The combination of computer and microcontroller provides a very great possibilities, which uses the good features of both. This chapter describes the use of a computer in combination with MATLAB@Simulink, Real-time Toolbox and PIC18F452 microcontroller for closed-loop temperature control. Control and settings for temperature are in MATLAB@Simulink and they can be very easily adjusted. Also, all the information: the refrence temperature, information from controller and the measured temperature are available at any time in MATLAB@Simulink and can be processed and stored. For real-time operation is used Real-time Toolbox. The information is sent from computer over serial port to PIC18F452 microcontroller. The PIC18F452 microcontroller receives information and processes them. Information from PIC18F452 microcontroller is amplified using a transistor that works as the switch and the thyristor which is used to turn on the heater. Turning off thyristor is automatically passing supply voltage through zero. Temperature measurement is performed using the temperature sensor LM335. Output signal from the sensor is amplified by using operational amplifier LM324 and after that sent in PIC18F452 microcontroller. The microcontroller processes information and after that send it over serial port to computer. In this way the loop of temperature control is closed using a computer and PIC18F452 microcontroller.


MATLAB@SIMULINK Real-time toolbox PIC18F452 microcontroller Temperature sensor Heater 


  1. 1.
    Matlab R (2009) Documentation. The MathworksGoogle Scholar
  2. 2.
    Gilat A (2011) MATLAB an introduction with applications, 4th edn. Wiley, New YorkGoogle Scholar
  3. 3.
    Ban Ž, Matuško J, Petrović I (2010) Primjena programskog sustava Matlab za rješavanje tehničkih problema, Graphis, ZagrebGoogle Scholar
  4. 4.
    Lent CS (2013) Learning to program with MATLAB. Wiley, New YorkGoogle Scholar
  5. 5.
    Real-Time Windows Target User’s guide: for use with real-time workshop, The Mathworks, version 2, pp 3–33Google Scholar
  6. 6.
    Dogan I (2008) Advanced PIC microcontroller projects in C. Elsevier, BurlingtonGoogle Scholar
  7. 7.
    PIC18F42X, Data Sheet, FLASH-Based 8-Bit CMOS Microcontroller, 2003Google Scholar
  8. 8.
    Chartrand L, Huang HW (2005) PIC microconteroller: an introduction to software & hardware interfacing, MankatoGoogle Scholar
  9. 9.

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  1. 1.University of BihaćBihaćBosnia and Herzegovina

Personalised recommendations