# PID applications on arduino to control the temperature of the heat exchanger plant.

Arduino library for PID controller algorithm has been made and can be applied with ease. By using the arduino PID library can be applied to various fields of control systems, here applied to regulate the temperature of the heat exchanger plant.

Plant made using nylon with 600 Watt electric heater. To know the LM35 temperature sensor plant used as it has been posted here. While signal conditioners circuit for temperature sensor has been posted here as well.

As an actuator, I use a method of switching pwm IGBT components. The pwm switching circuit I have described in posting here. As a controller, I’m using a microcontroller ATmega328 with Noano Arduino bootloader.

## PID library

Library for Arduino PID can be downloaded here. After you download folder PID_v1 put in the folder “libraries” where the Arduino installed.

To test the response of the PID used a simple program as follows:

#include

//Define Variables we'll be connecting to
double Setpoint, Input, Output;
int pwmOutput = 9;
int feedBackPin = A0;
int ComputeOk;

//Specify the links and initial tuning parameters
PID myPID(&Input, &Output, &Setpoint,1.25,4,0.5, DIRECT);

void setup()
{
//initialize the variables we're linked to
Setpoint = 500;

//turn the PID on
myPID.SetMode(AUTOMATIC);
Serial.begin(115200);
}

void loop()
{
myPID.Compute();

analogWrite(pwmOutput,Output);

double curErr = Setpoint-Input;
Serial.print(curErr);
Serial.print(" - ");
Serial.println(Output);
delay(50);

}



Last updated by at .

## About Bambang Siswoyo

I am a college lecturer since 1988 at UB (University of Brawijaya) in the electronics department. My experience: Applications of Microprocessor system, Applications of Control System, Applications of Field Programmable Gate Array, Computer Programming in computer instrumentations. My hobby: Music especially playing the saxophone, hiking and exploring the countryside.
This entry was posted in Arduino, Control system applications and tagged . Bookmark the permalink.