PID temperature controller for a heater

Ovens, incubators, plastic welders and labs all need a steady temperature, and on/off thermostats overshoot. A PID controller with a thermocouple and a solid state relay is a core control engineering project.

Arduino UnoMini or Major projectEIE, EEE, ECE, MECH
UNOTHERMOCOON28.1°CFeatured
Parts
₹3,060
Build
12 weeks
Board
Arduino Uno
Objectives
6
The heater runs on mains and gets hot: use a closed metal box, a fuse and an MCB, a thermal fuse inside, and have your guide check it.

Block diagram

Inputs
  • THERMOCO
    ThermocoupleMeasures the chamber temperature
  • Set-point keysSet the target
Controller
  • UNO
    Arduino UnoRuns PID
Outputs
  • ON
    Solid state relaySwitches the heater
  • HEATER
    Heater chamberThe process to control
  • 23.4°CLCD
    LCDShows set point, temperature and output
  • DATA
    Data loggerStores timestamped readings for analysis+
  • CLOUD
    Cloud dashboardStores readings, plots trends and sends alerts+

Objectives

  1. To measure chamber temperature with a K-type thermocouple.
  2. To control it with time-proportional PID through an SSR.
  3. To tune the controller (Ziegler-Nichols, then by hand) and report rise time, overshoot and steady-state error.
  4. To compare PID with on/off control on the same chamber.
  5. To log timestamped data and analyse it to support the conclusions with evidence.
  6. To publish readings over MQTT and show them on a live dashboard with threshold alerts.

Parts and specifications

Total about ₹3,060 at typical online prices. Tap a part for its pinout and datasheet notes.

Design calculations

Time-proportional output

With a 2 s window, a PID output of 35% turns the SSR on for 0.7 s of every 2 s. The zero-cross SSR switches at the next zero crossing, so resolution is 10 ms.

Ziegler-Nichols (ultimate gain)

Raise Kp with Ki = Kd = 0 until steady oscillation: Ku = 8, period Tu = 60 s. Then Kp = 0.6 Ku = 4.8, Ti = Tu/2 = 30 s, Td = Tu/8 = 7.5 s (Ki = Kp/Ti = 0.16, Kd = Kp × Td = 36).

Integral windup

During warm-up the output saturates at 100%; clamp the integral so it does not overshoot when the set point is reached.

Sample time

MAX6675 converts every 220 ms; run PID every 500 ms, much faster than the chamber's time constant (minutes).

Pin map

SignalPin or connection
MAX6675 SCK / CS / SOD13 / D10 / D12
SSR input +D6 (time-proportional output)
Buttons up / down / modeD2 / D3 / D4
LCDA4 / A5

Firmware outline

  1. Read temperature every 500 ms; filter with a short moving average.
  2. PID with derivative on measurement (not error) to avoid kicks when the set point changes.
  3. Clamp output 0 to 100% and the integral term (anti-windup).
  4. Drive the SSR in a 2 s time-proportional window.
  5. Log time, set point, temperature and output as CSV for the step-response plots.
  6. Over-temperature cut-out independent of PID.

Test plan

TestExpected result
Step from room to 60 °C, on/off controlOvershoot and oscillation recorded
Same step with PIDRise time, overshoot < 2 °C, steady error < 0.5 °C
Door opened for 10 sRecovery time
Thermocouple unpluggedHeater off, error shown

These rows start your results table when you plan the project.

Viva practice

Say your answer out loud first, then check. The first 2 answers are free; Maker opens all 5.

1. Why does on/off control overshoot?
2. What does the derivative term do here?
3. What is integral windup?
4. Why an SSR?
5. How does a thermocouple work?

Make it yours

One or two upgrades for a mini project, two to four for a major one.

Build these first

Datasheets and sources to cite

  • Maxim MAX6675 datasheet
  • Ziegler and Nichols, Optimum settings for automatic controllers (1942)
  • Åström and Hägglund, PID Controllers

About this project

How much does the pid temperature controller for a heater project cost?

About ₹2,450 for the parts in the base list: Arduino Uno R3 (CH340 clone), MAX6675 with K-type thermocouple, SSR-40DA solid state relay, 16×2 LCD with I²C backpack, Push button 12 mm × 3, 100 W incandescent bulb in a metal box (heater), SSR heatsink, Closed box, fuse and MCB.

How long does it take?

About 8 weeks for the base project, built on an Arduino Uno. Each upgrade adds time.

Which branches is it suitable for?

Instrumentation, Electrical and Electronics, Electronics and Communication, Mechanical / Mechatronics, as a mini or major project.

Which pins and design calculations does it use?

MAX6675 SCK / CS / SO on D13 / D10 / D12; SSR input + on D6 (time-proportional output); Buttons up / down / mode on D2 / D3 / D4. Worked calculations on this page: time-proportional output, ziegler-nichols (ultimate gain), integral windup, sample time.

How do I test it?

Step from room to 60 °C, on/off control: Overshoot and oscillation recorded. Same step with PID: Rise time, overshoot < 2 °C, steady error < 0.5 °C. Door opened for 10 s: Recovery time. Thermocouple unplugged: Heater off, error shown.

What are the objectives?

To measure chamber temperature with a K-type thermocouple. To control it with time-proportional PID through an SSR. To tune the controller (Ziegler-Nichols, then by hand) and report rise time, overshoot and steady-state error. To compare PID with on/off control on the same chamber.