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:


//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
  Input = analogRead(feedBackPin);
  Setpoint = 500;

  //turn the PID on

void loop()
  Input = analogRead(feedBackPin);

  double curErr = Setpoint-Input;
  Serial.print(" - ");


Last updated by at .

Avatar of Bambang Siswoyo

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.

Leave a Reply

Your email address will not be published. Required fields are marked *



You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>