Arduino Temperature Controller

Digital Temperature Controller using arduino, here we are using arduino as main controller, this temperature controller controls the temperature of any heating device with given set points, It also displays state of the device either on or off and current temperature.

What you will learn?
  1. How to connect keys and LCD to arduino?
  2. How to take key input?
  3. How to Read Temperature sensor LM35?
  4. Controlling device as per set point.
Components Required
  1. Arduino Uno
  2. 16×2 LCD Display
  3. keys
  4. Relay
  5. 1K Resistors Qty. 3
  6. BC548
  7. LEDs
  8. LM35 Temperature Sensor

Arduino Temperature Controller Circuit

Circuit is constructed using Arduino Uno and LM35 temperature sensor and other components. We are using 16×2 LCD to display current temperature and set points. LM35 gives analog output proportional to the temperature which is given to Arduino analog input A0. Which is then compared with set points if it is more than set point, It means the temperature is more so we turn off the heating element such as heater which is connected to relay output. If temperature is less we turn on the relay (heater). We are displaying status of heater on off on the LED and LCD also. Two tactile switches are used to set the temperature set point.

Arduino Temperature Controller Circuits
Temperature Controller Circuits

Temperature Controller Arduino Code

                Program is constructed using one library “LiquidCrystal”. Program have different modules, Setup, Loop. In setup we initialize all the IO connections and LCD, Keypad. In main loop we are taking set point inputs and constantly measure current temperature and compare it with set points. If it is more than set point turn off heater, else turn on heater. You can add some hysteresis.

Conclusion

This code demonstrates how to construct digital temperature controller using arduino.

We have used combination of LCD and Temperature sensor LM35 to make simple temperature controller using Arduino. Apply temperature to LM35 sensor more than set point  it will turn on the relay (Heater). if it is less it will turn off the relay.

4 thoughts on “Arduino Temperature Controller

  1. Hi!
    If we use a LCD shield with the tipical buttons… is possible to use the buttons for change the setpoint? Something like:

    int x;
    x = analogRead (0);
    if (x 0)
    {
    SetPoint–;
    }
    }
    else if (x < 200) {
    {
    if(SetPoint<150)
    {
    SetPoint++;
    }
    }

    Thanks!
    Alex.

    1. Here is the hysteresis code

      //Check Temperature is in limit
      if((Temperature -5)> SetPoint)
      {
      digitalWrite(RELAY,LOW); //Turn off heater
      digitalWrite(LED_RED,LOW);
      digitalWrite(LED_GREEN,HIGH); //Turn on Green LED
      }
      if((Temperature +5)< SetPoint) { digitalWrite(RELAY,HIGH); //Turn on heater digitalWrite(LED_GREEN,LOW); digitalWrite(LED_RED,HIGH); //Turn on RED LED }

Leave a Reply

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