Table of contents
Updated - February 3, 2026
A modern wood-burning stove usually has an integrated combustion control. If you still have a wood-burning stove without this automatic system, you can build your own control system in combination with Smarthome (Raspberry Pi).
Even if it is not yet possible to automate the loading of the wood, apart from pellet stoves, automation achieves a more even combustion, constant temperatures and a lower wood consumption of up to 30 % with greater efficiency.
If you don't „dare“ right away, I can tell you that I once felt the same way. But if you take a closer look at the subject and the possibilities offered by RaspberryMatic on a Raspberry Pi, for example, you'll soon be convinced that you can „do it“!
And as so often in life: it's better together! Let's tackle it!
Theory
What we can see with the naked eye from the flame pattern and flame color is taken over here by a high-temperature sensor screwed into the flue gas pipe about 20 cm above the combustion chamber.
Depending on the temperature to be maintained of around 200 °C, it uses a simple program on the Raspberry Pi to open and close the supply air flap, which previously had to be done manually - if you were looking at the oven ...
In principle, a simple mechanism. The mechanism, in the truest sense of the word, is realized here via a linear drive that is moved by a stepper motor. Depending on the actual temperature value compared with the setpoint value, the stepper motor receives the information as to whether it should increase or decrease the supply air if the temperature is too low. Accordingly, the (manual) actuating lever of the supply air damper, which is mechanically coupled to the linear slide, is moved forwards or backwards and the damper is opened or closed.
Since RaspberryMatic does not offer the possibility to address a stepper motor directly, we make do with an ESP32-IDF, a small computer that offers the connection of a stepper motor controller and can thus take over the control of the same.
Communication between the RaspberryMatic and ESP32-IDF takes place via WLAN, which is already integrated on the ESP32-IDF. The ESP32-IDF is programmed in C++, Arduino IDE and is included in this article for easy transfer after changing a few parameters.
The program for recording the temperature and positioning of the linear stepper motor is also provided for easy transfer.
Shopping List
- Raspberry Pi 4 Model B Set with housing, fan, power supply unit - approx. 95 euros
- SD card 16 GB (for RaspberryMatic installation) - approx. 10,- Euro
- RaspberryMatic (Download) - free of charge
(with Raspberry Pi Baker (Mac) or Raspberry Pi Imager (Windows) Copy to SD card;
Create variables Burning_status (Type String); Burning_flap_actual (Type Number); Burn_off_flap_desired (Type Number); ISD-ID der drei Variablen ermitteln und im Code unter VAR_STATUS, VAR_IST und VAR_SOLL eintragen (Ermitteln der ISE-ID -> „http://IP_RaspberrPi:8181/rega.exe?x=dom.GetObject(%22Variablen_Name%22).ID()“ – das Result can be found in the penultimate output line, e.g. „19827“) - ESP32 Development Board (e.g. ESP32 DevKit V1) - approx. 12,- Euro
Arduino IDE 2.x Download (Mac) (Windows) - CL86Y Stepper motor driver (or TB6600)*
- NEMA 17 stepper motor (200 steps/rev)* - Set approx. 80,- Euro
- Linear drive 100 mm, 150 mm suitable for above mentioned stepper motor type approx. 50,- Euro
- 2x limit switch (mechanical) - approx. 4,- Euro
- 48V DC power supply unit (for motor 12A) - approx. 39,- Euro
- Power supply unit 5V DC (for ESP32, e.g. USB) - approx. 7,- Euro
- ELV PT1000 high temperature sensor 4-wire Art. No. 258570 - approx. 24,- Euro
- ELV platinum temperature sensor interface - Art. No. 162126 - approx. 45,- Euro
- Brass pipe fitting M10 x 6 mm for the PT1000 temperature sensor - approx. 4,- Euro
For a total of around 370 euros, this is a fully-fledged and also very inexpensive alternative to a retrofit kit - if one is available for the stove at all - which usually costs between 750 and 1,500 euros!
Preparations
The installation of RaspberryMatic on the SD card for the Raspberry Pi 4 B is here described in detail, including housing installation if no kit has been purchased.
ESP32 - Setup
macOS
Step 1: Install Arduino IDE
- Download:
- Go to: https://www.arduino.cc/en/software
- Download „Arduino IDE 2.x“ for macOS
- Choose
.dmgfor Intel or.dmgfor Apple Silicon (M1/M2/M3)
- Installation:
.dmgOpen file- Drag the Arduino IDE into the programs folder
- Start Arduino IDE
Install ESP32 Board Support
- Open Arduino IDE
- Open Board Manager:
- Menu:
Arduino IDE→Settings(orCmd + ,) - Enter the URLs under „Additional boards manager URLs“:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json- click on
OK
- Menu:
- Install ESP32 boards:
- Click on the board icon on the left (or in the Menu bar
Tools→Board→Boards Manager) - Search for:
esp32 - Install: „esp32 by Espressif Systems“ (Version 2.0.17 or newer)
- Wait until installation is complete (may take 5-10 minutes)
- Click on the board icon on the left (or in the Menu bar
USB driver (up to OS 10.14)
If ESP32 is not recognized:
- Download: https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers
- File:
macOS_VCP_Driver.zipdownload - Install and restart Mac
For CH340 chip:
- Download: https://github.com/adrianmihalko/ch340g-ch34g-ch34x-mac-os-x-driver
- Install and restart Mac
Connecting the ESP32
- Connect ESP32 via USB
- Check port:
- Arduino IDE Menu bar:
Tools→port - Select port similar to:
/dev/cu.usbserial-0001or/dev/cu.SLAB_USBtoUARTor/dev/cu.wchusbserial*
- Arduino IDE Menu bar:
Select board
- Arduino IDE:
- Menu bar
Tools→Board→esp32→ „ESP32 Dev Module“
- Menu bar
- Settings:
- Upload Speed: 115200
- Flash Frequency: 80MHz
- Flash Mode: QIO
- Flash Size: 4MB (32Mb)
- Partition Scheme: Default 4MB with spiffs
Test upload
- Open sample code:
- Menu bar
File→Examples→01.basics→Blink
- Menu bar
- Upload code:
- Click on the upload button (→)
- Wait until „Connecting...“ appears
- If „Connecting...“ hangs: Press and hold the BOOT button on the ESP32
- Success:
- „Hard resetting via RTS pin...“ = Upload successful!
- LED on the ESP32 should flash
WINDOWS
Install Arduino IDE
- Download:
- Go to: https://www.arduino.cc/en/software
- Download „Arduino IDE 2.x“ for Windows
- Choose
.exeInstaller
- Installation:
- Run installer (as administrator)
- Leave all options activated
- Complete the installation
Install ESP32 Board Support
- Open Arduino IDE
- Configure Board Manager:
- Menu bar
File→PreferencesEnter the URLs under „Additional boards manager URLs“:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json- click on
OK
- Menu bar
- Install ESP32 boards:
- Menu bar
Tools→Board→Boards Manager - Search:
esp32 - Install: „esp32 by Espressif Systems“ (Version 2.0.17+)
- Wait until installation is finished
- Menu bar
Install USB driver
Windows often does NOT recognize ESP32 automatically!
For CP2102/CP2104 chip (most common):
- Download:
- https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers
- File:
CP210x_Universal_Windows_Driver.zip
- Installation:
- Unpack ZIP
CP210xVCPInstaller_x64.exeRun as administrator- Complete the installation
- Restart Windows
For CH340/CH341 chip:
- Download:
- Installation:
- Unpack ZIP
CH341SER.EXERun as administrator- Click on „INSTALL“
- Restart Windows
Find out the chip type:
- Connecting the ESP32
- Open the Device Manager:
Windows + X→Device Manager - Connections (COM & LPT) unfold
- Search for:
- „Silicon Labs CP210x...“ = CP2102
- „USB-SERIAL CH340“ = CH340
- „SLAB_USBtoUART“ = CP2102
Connect ESP32 & check port
- Connect ESP32 via USB
- Find out the port:
- Menu bar
Tools→port - Choose: COM3, COM4, COM5 etc.
- (number varies depending on the system)
- Menu bar
No port visible? → Driver not installed or wrong driver!
Select board
- Select board:
Menu barTools→Board→esp32→ „ESP32 Dev Module“
- Upload settings:
- Upload Speed: 115200
- Flash Frequency: 80MHz
- Flash Mode: QIO
- Flash Size: 4MB (32Mb)
- Partition Scheme: Default 4MB with spiffs
Test upload
- Load example:
- Menu bar
File→Examples→01.basics→Blink
- Menu bar
- Upload:
- Click the upload button (→)
- With „Connecting...“ possibly. BOOT button hold on the ESP32
- Success:
- „Hard resetting...“ = ✅ Upload successful!
Libraries for combustion control
Automatically included (ESP32 Core):
- WiFi.h
- HTTPClient.h
- WebServer.h
- Preferences.h
- esp_task_wdt.h
Troubleshooting
Problem: „Port not found“
Mac:
# Open terminal and check:
ls /dev/cu.*
# Should show:
/dev/cu.usbserial-XXXX
/dev/cu.SLAB_USBtoUART
Windows:
- Open Device Manager
- Check connections (COM & LPT)
- Reinstall driver
- Restart Windows
„Connecting...“ hangs
Solution:
- BOOT button Press and hold on the ESP32
- Then click the upload button
- Hold the BOOT button until „Writing...“ appears
- Release button
Alternative:
- Press the EN button briefly (reset)
- Then try uploading again
„Compilation error“
Common causes:
- Wrong board selected
- ESP32 Board Support not installed
- Syntax error in the code
Solution:
- Check the board again:
ESP32 Dev Module - Open Board Manager → reinstall esp32
Upload works, but serial monitor is empty
Solution:
- Check baud rate:
- Code:
Serial.begin(115200); - Serial Monitor: Also 115200 set
- Code:
- Check port:
- Correct COM port selected?
- Press the EN button:
- Reset after upload
Checklist before the first upload
- [ ] Arduino IDE installed
- [ ] ESP32 Board Support installed (Version 2.0.17+)
- [ ] USB driver installed (Windows!)
- [ ] ESP32 connected via USB
- [ ] Port visible in Arduino IDE
- [ ] Board: „ESP32 Dev Module“ selected
- [ ] Upload Speed: 115200
- [ ] Flash Size: 4MB
- [ ] Serial monitor baud rate: 115200
- [ ] Router NTP release
NTP release
Some routers are configured by default without NTP sharing, which means that requests via NTP port 123 are not forwarded, with the result that no data can be requested from the addressed NTP server.
A corresponding rule must therefore be defined:

Learning resources
Official documentation:
- ESP32 Arduino: https://docs.espressif.com/projects/arduino-esp32/
- Arduino reference: https://www.arduino.cc/reference/en/
Upload code
- Open file:
- The Text content of this file into the empty(!) Arduino IDE window
- Customize WiFi:
const char* WIFI_SSID = "DEIN_WIFI"; const char* WIFI_PASSWORD = "DEIN_PASSWORT"; - Enter XML-API token:
const char* XML_API_TOKEN = "DEIN_TOKEN_HIER";
The XML API add-on must be installed in RaspberryMatic. You can then change the settings of the XML API add-on by clicking on tokenregister.cgi a token can be generated. The token is valid for all future GUI logins and consists of a 16-digit sequence of upper and lower case letters. It must be inserted in the ESP32 code at the appropriate position. - Upload:
- Verify (✓) → Check code
- Upload (→) → Upload to ESP32
- Open Serial Monitor:
Tools→Serial Monitor- Baud rate: 115200 (is displayed under the menu TOOLS - Upload Speed: .... discontinued)
- Watch output!
Installation
After successful setup:
- Testing the WiFi connection
- Upload burn-off control code
- Connect motor & limit switch
- Generate RaspberryMatic token
- Test system
ESP32 Code
The required code is fully commented and therefore comprehensible and customizable if necessary. (Download)
ESP32 GUI
In the GUI, this can be set manually and continuously for test purposes to determine the dependency of exhaust gas temperature on damper opening.
The flame pattern is observed and the visually „suitable“ percentage value of the damper opening is adjusted at the relevant time. The temperature value read from RaspberryMatic at that time is assigned to the set percentage value of the damper opening as the starting value for the change. The to temperature value results from the next visually „necessary“ correction of the damper opening.
If, for example, 150°C was identified as the starting point (from ...) for opening to 80% and 200°C as the value for reduction to 45%, then the constellation shown under the first OTHER IF function results in the program „Burn-off control - Temperature control“ as illustrated.

„Test mode“ is displayed if no peripherals have yet been connected to the ESP32 and the variable "const bool TEST_MODE =" still on „true“ stands.
Change to „false.false“ cancels the test mode and initializes the reference run of the connected motor to determine the start and end positions defined by the limit switches.
Live logging

Diagnostics

Automated error handling
Intercepting possible error states is essential for continuous, trouble-free operation. For this reason, the code is provided with the following routines to detect errors and rectify them using suitable measures:
- Treatment of stack overflow
- Brownout detection
- Division by ZERO
- Limit switch emergency shutdown
- HTTP Error Handling
- HTTP Exception Handling
- Integer overflow check
- Memory monitoring
- millis() Overflow
- Motor alarm detection
- Preferences Recovery
- Position constraints
- Protection against very long blocking operations
- Telnet Client Management
- Telnet NULL pointer
- Thread safety
- Token validation
- Watchdog timer
- WiFi Auto-Reconnect
RaspberryMatic - Programs
Burn-off control
Program
IF system status Burnup_Damper_Setpoint in the value range of 0 and less than 101 (percent)
THEN SCRIPT ... IMMEDIATELY
! ESP32 IP address (CUSTOMIZE HERE!)
string esp32_ip = "IP_Adresse_ESP32_eingeben";
! Get current value of the system variable
var sollwert = dom.GetObject("Abbrand_Klappe_Soll").Value();
! Build URL for ESP32 callback
string url = "http://" # esp32_ip # "/setSoll?value=" # sollwert;
! Call ESP32
string cmd = "wget -q -O /dev/null '" # url # "'";
system.Exec(cmd);
! Log output (optional, for debugging)
WriteLine("Burnup: Send " # setpoint # "% to ESP32 " # esp32_ip);
Burn-off control - Temperature control
Program
IF device selection "PT1000_temperature_sensor_flue_gas" FOR ACTUAL temperature from ... to ...
THEN System status Burn-off_Damper_Setpoint IMMEDIATELY xxx*
OTHERWISE IF ...
Here, the top two lines with different temperature ranges and percentage values are each continuously supplemented by an OTHER IF function until all required ranges are covered.
* „xxx“ is the desired percentage value of the flap opening.

Linear actuator & limit switch assembly
Depending on the space available below the flap mechanism, the linear drive equipped with the motor is mounted underneath. A „fork“ is attached to the carriage, which is moved forwards or backwards by the spindle, into which the manually operated mechanism engages.
The „lever“ is usually designed so that it can be moved slightly up and down. The length of the „forks“ is adjusted accordingly so that the lever can still be moved out of this manually and pushed fully OPEN.
On the one hand, this serves to generate a maximum draught when adding fuel if the electronic control is not yet fully regulated to 100%.
On the other hand, the purely mechanical operating option is still available, e.g. in the event of a power supply failure.