⚠️ High-Voltage Warning
This project operates directly from mains AC voltage (110–240 VAC).
- Electrically Live Heatsink: The heatsink attached to the Triac is NOT isolated; it is at mains potential. Touching it while powered can be fatal.
- Fire Risk: This device generates temperatures up to > 300C.
- Liability: This project is for educational purposes only. You assume all responsibility for construction and operation.
The Problem: 400W vs. 30 Grams
I needed a compact hot plate for SMD reflow work. I settled on a standard 400W PTC/Resistive heating element and a small custom aluminum plate. However, once assembled, I ran into a massive physics problem.
The aluminum plate only weighs about 30 grams. When you dump 400W of energy into such a small thermal mass, the temperature rise is explosive.
I spent weeks attempting to tune a standard PID controller. The issue was thermal lag: by the time the thermistor (mounted 20mm away from the heater core) registered a temperature change, the heater had already injected enough energy to overshoot the target by 25°C or more.
The system was too fast for the sensor, and standard PID derivatives couldn't predict the inertia well enough.
The Solution: "Smart Pulse & Coast"
I abandoned PID entirely and wrote a custom control algorithm specifically for high-power, low-mass systems with sensor lag.
How it Works
Instead of continuously modulating power, the STM32 fires the heater in fixed-window pulses synchronized to AC zero-crossings. Immediately after a pulse, the system enters a forced "Coast" phase.
During the Coast phase:
- The heater is guaranteed OFF.
- The firmware watches the temperature continue to rise (due to thermal inertia).
- It records the true peak temperature.
- It only calculates the next move once the temperature stabilizes or begins to fall.
The Zoning Logic
The pulse width is dynamic, based on how far the current temperature is from the setpoint:
- Zone 1 (Far < 70%): 2000ms Pulse. (Rapid catch-up)
- Zone 2 (Mid 70–85%): 500ms Pulse. (Approach)
- Zone 3 (Near > 85%): 250ms Pulse. (Fine-tuning)
This "wait-and-see" approach eliminates overshoot effectively because it respects the physical time it takes for heat to travel from the element to the sensor.
Hardware Architecture
1. The Controller
The brain is an STM32F103C8T6. I chose it for the mature HAL support, 12-bit ADCs, and 72MHz clock speed, which allows for a cooperative multitasking loop that handles the UI, ADC filtering, and safety logic without blocking.
2. Zero-Cross Switching (Not Phase Angle)
I specifically avoided Phase-Angle control (dimming). For a resistive heater, chopping the sine wave creates massive EMI and audible noise.
Instead, I used a MOC3063 Zero-Cross Optocoupler driving a BTA16 Triac. The firmware uses Time-Proportional Control with a 250ms window. The heater is always turned on or off exactly when the AC voltage crosses zero volts. This drastically reduces electrical stress and noise.
3. Safety Features
- Thermal Runaway Protection: If the heater is powered but temp doesn't rise, the system shuts down (sensor fell off).
- Frozen Sensor Detection: If the ADC value is suspiciously constant (shorted/open), the system halts.
- Hardware Fusing: A 3.15A Slow-Blow fuse protects against Triac shorts.
- Active Cooling: A 5V fan with software-PWM provides forced cooldowns after reflow is complete.
Mechanical Design & Enclosure
The enclosure is 3D printed in ASA (Acrylonitrile Styrene Acrylate).
Why not PLA? PLA softens at ~60°C. Given the proximity to the heater, a PLA case would warp and fail dangerously. ASA withstands UV and higher temperatures, remaining dimensionally stable.
Embedded Nuts For longevity, I designed the print to pause at layer 155, allowing me to insert M4 steel nuts into the walls of the print. This means the heater is bolted into metal threads, not plastic, ensuring the mount doesn't loosen over dozens of heat cycles.
Firmware Structure
The firmware is written in...
Read more »
Daniel
coool,
but why Electrically Live Heatsink: ??
Sounds a bit dangerous alltogether. Especially with an open case like that