Control of airflow in ventilation systems using embedded systems on microcontrollers

  • Felipe O. S. Gama
  • José K. E. da C. Martins
  • Tiago F. de Miranda
  • Willy M. de F. Tomé
  • Sérgio N. Silva
  • Marcelo A. C. FernandesEmail author
Technical Paper


This paper describes the development of a proportional-integral-derivative (PID) controller for regulation of the airflow in a ventilation system. The flow was adjusted by controlling the speed of the fan installed in the system. The PID control algorithm was developed for an embedded system in an Atmega 2560 microcontroller contained in an Arduino Mega development kit, where the airflow rate was detected by a Hall-effect sensor that generated a pulsed signal at a frequency proportional to the speed of the fan. Simulation results were used to parameterize the control algorithm, minimizing the benchtop development time. Full details of the procedure are presented in order to assist future PID proposals involving embedded systems in microcontrollers.



The authors wishes to acknowledge the financial support of the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (CAPES) for their financial support.


  1. Arduino (2013) Arduino mega 2560. Accessed 23 Mar 2019
  2. American Society of Heating, Refrigerating and Air-Conditioning Engineers (2005) ASHRAE handbook: fundamentals. American Society of Heating, Refrigerating, and Air-Conditioning Engineers. ISSN: 1523–7230Google Scholar
  3. Atmel (2013) ATmega 2560. Accessed 23 Mar 2019
  4. Bekiroglu E (2008) Microcontroller-based full control of ultrasonic motor with frequency and voltage adjusting. Sens Actuators A 141(1):151–159. CrossRefGoogle Scholar
  5. Hai-feng Z, Ai-ling Z, Jun H (2011) Design of fumigation temperature control system based on single-chip microcontroller. Procedia Eng 15:246–250. CEIS 2011CrossRefGoogle Scholar
  6. Hamza MF, Zhiyung JL, Zimit AY, Danjuma S, Rohadi E, Andini S, Herawan T (2018) Pid based design and development of a mobile robot using microcontroller. In: Gervasi O, Murgante B, Misra S, Stankova E, Torre CM, Rocha AMA, Taniar D, Apduhan BO, Tarantino E, Ryu Y (eds) Computational science and its applications—ICCSA 2018. Springer International Publishing, Cham, pp 699–716CrossRefGoogle Scholar
  7. Hernandez-Perez J, Ebert Giral-Salas J, Morales-Caporal R, Ordonez-Flores R, Morales-Flores M (2013) Speed and current control of a permanent-magnet dc servo motor using a real-time microcontroller. Electrical engineering, computing science and automatic control (CCE), In: 2013 10th International conference on, pp 369–374,
  8. Johnson JC, George SJ (2018) Design of microcontroller based pid algorithm for current control and automating the capacity test of class 1 power supplies used in nuclear applications. In: 2018 international conference on power, signals, control and computation (EPSCICON), pp 1–5,
  9. Koçak E, Bayir R (2009) Project and group based learning and competition based evaluation in lesson of microcontroller applications. Procedia Soc Behav Sci 1(1):1513–1518. world Conference on Educational Sciences: New Trends and Issues in Educational SciencesCrossRefGoogle Scholar
  10. Lee K, Kim Y (2018) Design and analysis of digital pid controller in mcu and fpga. In: 2018 International SoC design conference (ISOCC), IEEE, pp 261–262Google Scholar
  11. Mathworks (2016) Matlab/Simulink. Accessed 23 Mar 2019
  12. Mazidi MA, Mazidi JG, McKinlay RD (2012) The 8051 Microcontroller: a systems approach. Pearson. ISBN: 9780135080443Google Scholar
  13. Mohamed NMA, Abdalaziz AAA, Ahmed AA, Ahmed AAA (2017) Implementation of a pid control system on microcontroller (dc motor case study). In: 2017 international conference on communication, control, computing and electronics engineering (ICCCCEE), pp 1–5,
  14. Mondal R, Mukhopadhyay A, Basak D (2013) Embedded system of DC motor closed loop speed control based on 8051 microcontroller. Procedia Technol 10(0):840–848. first International Conference on Computational Intelligence: Modeling Techniques and Applications (CIMTA) 2013CrossRefGoogle Scholar
  15. Nithyasree M, Kandasamy K (2012) A generic PID controller based on ARM processor. Procedia Eng 38(0):1044–1049. International conference on modelling optimization and computingCrossRefGoogle Scholar
  16. Ogata K (2001) Modern control engineering, 4th edn. Prentice Hall PTR, Upper Saddle RiverzbMATHGoogle Scholar
  17. Parikh P, Sheth S, Vasani R, Gohil JK (2018) Implementing fuzzy logic controller and pid controller to a dc encoder motor - “a case of an automated guided vehicle”. Procedia Manufacturing 20:219–226,,URL, 2nd international conference on materials, manufacturing and design engineering (iCMMD2017), 11-12 (December 2017) MIT Aurangabad. Maharashtra, INDIA
  18. Proteus (2016) Proteus VSM. Accessed 23 Mar 2019
  19. Pérez MEA, Romero JCT, Ramírez JHP (2016) System design and implementation to control an industrial process through a microcontroller and lab view. In: 2016 international conference on mechatronics, electronics and automotive engineering (ICMEAE), pp 90–95,
  20. Qun QF, Xue-Dong J, Shi-qing Z (2011) Design of stepping motor control system based on AT89C51 microcontroller. Procedia Eng 15:2276–2280. CEIS 2011CrossRefGoogle Scholar
  21. Sen Gupta G, Mukhopadhyay S, Moi-Tin C (2006) A project based approach to teach mixed-signal embedded microcontroller for dc motor control. In: Electronic design, test and applications, 2006. DELTA 2006. Third IEEE international workshop on, pp 6 pp.–,
  22. Xu H, King K, Jani Y (2007) High performance dc chopper speed and current control of universal motors using a microcontroller. In: Industry Applications Conference, 2007. In: 42nd IAS annual meeting. Conference record of the 2007 IEEE, pp 701–705,
  23. Youness H, Moness M, Khaled M (2014) Mpsocs and multicore microcontrollers for embedded pid control: a detailed study. IEEE Trans Industrial Inform 10(4):2122–2134. CrossRefGoogle Scholar

Copyright information

© Springer-Verlag GmbH Germany, part of Springer Nature 2019

Authors and Affiliations

  1. 1.Department of Computer Engineering and AutomationFederal University of Rio Grande do Norte (UFRN)NatalBrazil

Personalised recommendations