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.
- Parts
- ₹3,060
- Build
- 12 weeks
- Board
- Arduino Uno
- Objectives
- 6
Block diagram
- ThermocoupleMeasures the chamber temperature
- Set-point keysSet the target
- Arduino UnoRuns PID
- Solid state relaySwitches the heater
- Heater chamberThe process to control
- LCDShows set point, temperature and output
- Data loggerStores timestamped readings for analysis+
- Cloud dashboardStores readings, plots trends and sends alerts+
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.
- To log timestamped data and analyse it to support the conclusions with evidence.
- To publish readings over MQTT and show them on a live dashboard with threshold alerts.
Parts and specifications
- Arduino Uno R3 (CH340 clone)ATmega328P 16 MHz, 32 KB flash, 2 KB SRAM, 5 V logic, 6 analog inputs (10-bit), 6 PWM pins₹450Buy
- MAX6675 with K-type thermocouple0 to 1024 °C, 0.25 °C resolution, cold-junction compensated, SPI₹350Buy
- SSR-40DA solid state relay3 to 32 V DC input, 24 to 380 V AC 40 A output (derate to 10 A without a heatsink), zero-cross switching₹450Buy
- 16×2 LCD with I²C backpackHD44780, PCF8574 at 0x27 or 0x3F, 5 V, contrast trimmer on the back₹220Buy
- 100 W incandescent bulb in a metal box (heater)₹350
- SSR heatsink₹150
- Closed box, fuse and MCB₹450
- DS3231 RTC moduleTemperature-compensated, ±2 ppm (about 1 minute a year), I²C 0x68, CR2032 backup₹150Buy
Total about ₹3,060 at typical online prices. Tap a part for its pinout and datasheet notes.
Design calculations
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.
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).
During warm-up the output saturates at 100%; clamp the integral so it does not overshoot when the set point is reached.
MAX6675 converts every 220 ms; run PID every 500 ms, much faster than the chamber's time constant (minutes).
Pin map
| Signal | Pin or connection |
|---|---|
| MAX6675 SCK / CS / SO | D13 / D10 / D12 |
| SSR input + | D6 (time-proportional output) |
| Buttons up / down / mode | D2 / D3 / D4 |
| LCD | A4 / A5 |
Firmware outline
- Read temperature every 500 ms; filter with a short moving average.
- PID with derivative on measurement (not error) to avoid kicks when the set point changes.
- Clamp output 0 to 100% and the integral term (anti-windup).
- Drive the SSR in a 2 s time-proportional window.
- Log time, set point, temperature and output as CSV for the step-response plots.
- Over-temperature cut-out independent of PID.
Test plan
| Test | Expected result |
|---|---|
| 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 |
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.
Make it yours
One or two upgrades for a mini project, two to four for a major one.
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.
