Skip to main content

Real time temperature controller system using Arduino

Real time temperature controller system using
Arduino


Abstract
            The documented application discusses common features of temperature control with Arduino and pid implementation. A temperature controller is a device that controls the temperature of a system or process.
            It is basically done by measuring the current temperature (process variable), comparing that value against a desired temperature value (set point) and generating an output to change the system or process such that the current temperature matches to the desired temperature. 

Introduction
            The main objective is to implement or Build low cost, compatible, portable and user friendly control system intended for control temperature using the Arduino prototyping platform. Arduino has become a popular open source single-board microcontroller among electronic hobbyists, and it is gaining acceptance as a quick prototyping tool for engineering and educational projects also[6].
            About RTOS: Real-time systems are computer systems that monitor, respond to, or control an external environment. This environment is connected to the computer system through sensors, actuators, and other input-output interfaces. It may consist of physical or biological objects of any form and structure. Often humans are part of the connected external world, but a wide range of other natural and artificial objects, as well as animals, are also possible.
            The computer system must meet various timing and other constraints that are imposed on it by the real-time behavior of the external world to which it is interfaced. Hence comes the name real time. Another name for many of these systems is reactive systems, because their primary purpose is to respond to or react to signals from their environment. A real-time computer system may be a component of a larger system in which it is embedded; reasonably, such a computer component is called an embedded system.
            Applications and examples of real-time systems are ubiquitous and proliferating, appearing as part of our commercial, government, military, medical, educational, and cultural infrastructures[5]. Included are
         vehicle systems for automobiles, subways, aircraft, railways, and ships
         traffic control for highways, airspace, railway tracks, and shipping lanes
         process control for power plants, chemical plants, and consumer products such as soft drinks and beer
         medical systems for radiation therapy, patient monitoring, and defibrillation
         military uses such as firing weapons, tracking, and command and control
         manufacturing systems with robots
         telephone, radio, and satellite communications
         computer games
         multimedia systems that provide text, graphic, audio, and video interfaces
         household systems for monitoring and controlling appliances building managers that control such entities as heat, lights, doors, and elevators

 The embedded system meets the following requirements[7]:
         Suitable for educational purpose
          Low cost: The components are affordable.
          Easy to assembly due to the constitution of the modules.
          Able to run on different platforms: the overall system can operate in different operating systems.
          Open hardware and open source: This means that the hardware and the software used has a public access. Anyone can use it and improve it.
         Suitable for control applications
         Bidirectional: It is possible for data to be transmitted in both directions via USB serial communication.
         Wired / Wireless connection
         Autonomous or dependent system.


            A computer, using a control application done in IDE, controls all the system by cable. This control application display all the data obtained from the acquisition system.
In this project various sensors like temperature sensor, Light Dependant Resistors (LDR), Analog POT/ servo motor valve are used and  control action can also be done simultaneously like DC motor control using Pulse Width Modulation as demonstrated further[6].


Fig-1 this Arduino microcontroller


Main objectives:
         Build a low cost, compatible, portable and user friendly temperature controller.
We are using Arduino microcontroller as embedded system because it is-
          8-bit Atmel AVR microcontroller ,
          user friendly,
          easy to use,
          inexpensive,
         open source and small size.

Requirements of system
            Fundamental requirements of a temperature controller are that, it must measure the current temperature, execute a control algorithm or program to generate required output
            Measuring temperature is done by temperature sensor which will be connected to the ardiuno microcontroller (Embedded system). This is compared with reference  temperature(set temperature),will control on and off states of  heater as per requirement.
           
Applications :
         Water heaters
         Steam boilers
         car engine
         oven or food industries for proper baking.
         air conditioners for maintaining proper temperature of room.
         Temperature control of oil in hydraulic systems.
         Temperature control in heat exchanger.

            We have selected the application of temperature control in oven for proper baking. Because slight change in temperature causes change in taste and appearence of the product. To maintain taste and appearence, we need precise temperature controller.
             Finally we are building low cost, compatible, portable and user friendly temperature controller using an embedded system (Arduino microcontroller).

PID controller:
            A programmable controller based on a closed loop control structure has been developed. Using the controller, the necessary referenced heating profile for various materials used in infrared (IR) applications could be followed (Altera, 1999).
            The controller developed in this paper is able to accurately trail a heating profile. The results confirm this programmable control model to be of benefit to and a valuable tool in temperature regulation closed loop proportional integral derivative (PID) controller that satisfies the requirement of providing a stable regulated temperature control. PID (Proportional, Integral, Derivative) control is a widely-used method to achieve and maintain a process set point. The process itself can vary widely, ranging from temperature control in thousand gallon vats of tomato soup to speed control in miniature electric motors to position control of an inkjet printer head, and on and on.
            Observation: Still in m many systems old basic On-Off control is used other than PId control. And there are some tools and devices are coming in markets which are based on PID control but they are costly.PID is most efficient controller over ON-Off control system.

Methodology
           
            Main concept is based on Arduino microcontroller (embedded system). This idea includes taking temperature as input from various temperature sensors from inside the oven. Temperatures are fed to the Arduino microcontroller in terms of voltage. The microcontroller with burned code of pid, which will send the positive or negative signals to driver or servo motor (for controlling the flow of gas/ current depends on heating mechanism). The process is controled in real time.


Controlled variables

Oven
                                                         

Fig-2 Application process control system block diagram,shows the block diagram of temperature control system. In this, various temperature sensors are connected to the Arduino micro-controller. These sensor are reading temperature in the oven. Depending on the condition, the controller will control the driver to On or Off heating.
What is PID (Proportional Integral Derivative)?
           
            From Wikipedia: "A PID controller calculates an 'error' value as the difference between a measured [Input] and a desired set-point. The controller attempts to minimize the error by adjusting [an Output]."
So, user tell the PID what to measure (the "Input",) Where you want that measurement to be (the "Set-point",) and the variable to adjust that can make that happen (the "Output".) The PID then adjusts the output trying to make the input equal the set-point. And there are 3 Tuning Parameters (or "Tunings"): Kp (Proportional Controller), Ki (Integral Controller) & Kd (Derivative Controller). Adjusting these values will change the way the output is adjusted. Fast? Slow? All of these can be achieved depending on the values of Kp, Ki, and Kd [1].
And our real time embedded target architecture is Arduino microcontroller.

Arduino Data Acquisition System (DAQ)
           
            The basic role of data acquisition system is to collect all the analog signals output by different sensors and convert them with ADC/DAC converter into the signals that can be read by a system/computer and then send them to the computer, display or print  the manipulated data in so as to achieve the monitoring of certain physical parameters, some of the data is also to be used by computer control system to control certain physical parameters in the process[6]. 

            Arduino’s are also called as small computers with a number of analog and digital Input/output pins ports. One can write programs for them in IDE and send them through USB to the device. The Arduino analog inputs are  only 10-bit and the sampling rate is roughly 100 samples per second. Keep in mind that the Arduino only cost $30 compared to other systems. That resolution and sample rate is also more than adequate for monitoring and controlling a lot of experiments. You can also use the Arduino as a remote data logger and controller with the help of wireless/Bluetooth/ SD card readers shields, and all sorts of other innovative things. Considering small scale applications where accuracy and high speed is not so important, industrial scale DAQ’s with high price tag is not necessary. But instead a low cost micro-controller like Atmel 328 (Arduino Uno) is enough to meet the requirement.

Comparison of normal on-off control and PID control
On-Off
Fig -(a)

            An on-off controller is the simplest form of control. The output from the temperature controller or heat controller is either on or off, with no middle state. This controller switches off the heating only when the temperature crosses the set point or required temperature. Heating process will get on when the temperature is below the required set-point. To maintain the temperature this on-off process of heating continues. This control is used where a precise control is not necessary[8].

PID
Fig -(b)
            This controller is combination of proportional control, integral control and differential control, which helps the unit automatically compensate for changes in the system. These adjustments, integral and derivative, are expressed in time-based units; they are also referred to by their reciprocals, RESET and RATE, respectively. The proportional, integral and derivative terms must be individually adjusted or "tuned" to a particular system using trial and error. It provides the most accurate and stable control of the three controller types, it is mostly used in those which react quickly to changes in the energy added to the process. It is recommended in systems where the load changes often and the controller is expected to compensate automatically due to frequent changes in setpoint, the amount of energy available, or the mass to be controlled[8].

Fig-4 Response graphs (a) On-Off control (b) PID control.
Response graphs of two systems with different controller. Above diagrams we can see that On-Off control system is fluctuating and is not stable where as other side we can see that, PID control system is non fluctuating with less overshoot and get stability after some time interval of time.
Arduino as a Real time Embedded system.


Interfacing temperature sensor with Arduino microcontroller

            The Arduino guide and pin diagram/configuration helps us easily to interface Temperature sensor with Arduino microcontroller. With this Temperature sensor we can acquire data from the surrounding Environment. Once the information is in Arduino a sketch for the Arduino microcontroller acts as an I/O(input/output) engine that interfaces with temperature sensor through a serial connection. This helps you quickly move information from Arduino pins to Driver/actuator/controller without adjusting the communication, synchronization, or even a single line of C code.
Using the common Open, Read/Write, Close convention in IDE, we can access the digital, analog, pulse-width modulated, I2C, and SPI signals of the Arduino microcontroller.



Experimentation:
Materials required: 1) temperature sensor
         Arduino microcontroller
         Bulb as heating element
         Fan





Basic setup of experiment









The above fig shows the schematic diagram of connections. In which a temperature sensor is connected to analog input of the ardiuno microcontroller. Exhaust Fan and heating element is connected to output of the ardinno microcontroller.

Results :


Conclusion:
          the temprature is consistantely controlled by using arduino interrupt

References:
           Beauregard, B. (2013). PIDLibrary. Retrieved from Arduino Playground:     http://playground.arduino.cc/Code/PIDLibrary 
          Colville, M. (n.d.). Process Control with a Microcontroller:http://en.wikipedia.org/wiki/Arduino
          Arduino PID Researchhttp://www.csulb.edu/~hill/ee444/Lectures/PID%20Control.pdf
          PX-series digital temperature controller
          EMBEDDED SYSTEMS IN REAL TIME APPLICATIONS, DESIGN & ARCHITECTURE August 2005 |       BY A. L. SUSEELA, V. LALITH KUMAR
           Naveenkumar R, Dr Prasad KrishnaLow Cost Data Acquisition and Control using Arduino Prototyping Platform and LabVIEW, International Journal of Science and Research (IJSR), India Online ISSN: 2319‐7064,2013
          http://arduino.cc/en/Guide/Introduction, PID Control: A brief introduction and guide, using Arduino.(SWR 26 Sep 2011)
          M Adonis,Department of Electrical Engineering, Cape Peninsula University of Technology M T E Khan, Centre for Distributed Power and Electronic Systems, Faculty of Engineering,Cape Peninsula University of Technology, Analysis of the efficacy of a simplified infrared energy management system.



Comments

Popular posts from this blog

CAN INTERVIEW QUESTIONS

Qualifiers and Modifier in C

RTOS Real time operating system interview questions

CAN INTERVIEW QUESTIONS 2

What is UDS protocol

Memory mapping in c

TOP IOT PLATFORMS