ESP32-based high precision TEC controller for laser diode holography

Under construction

Left: PWM controller board with ESP32-S3 Supermini board attached on the lower right. Right: Control board attached as shield.


Overview

Hardware design

Controller Board

Software

Measurements

Download

Version History


Overview

This is an evolution of our Arduino based TEC controller, now based on the more powerful and smaller ESP32-S3 Supermini board, which is cheap and easy to get from Aliexpress. While we emphasize the new features below, we will also simply copy-paste text from that page when it fits here. For more background on laser diode holography see here. The advantage as compared to an analog circuit is broad automatic adaptability with regard to control loop (PID) parameters, easy remote control, protection features, completely getting rid of potentiometer/trimpot drift, and dual (heating and cooling) drive capability using a bi-directional PWM H-bridge. This version is smaller than the Arduino board and ought to fit into laser heads. It's maximal TEC current is about 2A, depending on heat sinking. My plan later is to make an update for the laser diode (LD) driver later too, either on a separate board or on an enlarged board that hosts both TEC and LD controllers.

To be clear: the primary purpose of this controller is to temperature stabilize laser diodes for holography. The intended heat loads involve laser diodes with up to about 500mA drive. This requires stability to about 1mK = 1/1000 degrees C, tied to a specific kind of thermal load, for a relatively narrow temperature range. Also, tuning does not need ultrafine steps, it is more important that a given temperature is kept stable for extended periods of time. This allows to use a rotary encoder which provides much higher stability than using any kind of potentiometer. So explicitly, the controller is not optimized for ultra-fine scanning over temperature (like for spectroscopy), but when utilizing external digital control, it can perform small steps in the mK range too.

So here are the specifications:

- "ESP32-S3 Supermini" module attaches to PCB, makes soldering easier.
- full H-bridge for bi-directional TEC drive
- 12V unipolar supply
- up to +/-2A current; intended Peltier sizes about 10x10mm to 20x20mm
- standard 10k Thermistor for sensing
- setpoint range about 10-15 degrees C, modifiable by choosing different resistors
- temperature stability ~ 1mK for hours if undisturbed
- noise level < 1mK
- PWM ripple about xxx mV_pp at 50:50 duty cycle //to be measured
- precision current control/monitoring via dedicated sense circuitry
- auto turnoff for open/shorted thermistor, temperature out of range, and H-bridge overtemp
- digitally configurable are: temperature, TEC current limit
- "autotuning" PID control loop configuration, including "regulator windup" prevention
- remote control via USB serial terminal, or LabVIEW.
    The configuration can be stored in EEPROM and once set up, the controller can also run without external connection.
    However the intended mode of operation is to use it with the
- separate SH1106 type 1.3'' 128x64 OLED display board with push buttons and rotary encoder
- ready interface for companion laser diode driver, with programmable laser current, current limit.


Notes about the hardware design


Control Board

 


Software

Initially I thought that would require a simple rewriting of the code for my previous Arduino Uno board. However, the business with timers, interrupts and MCPWM module of the ESP32-S3 is completely different, and I have spent months (hobby time) to sort it out and optimize it. However, as mentioned above, 16bit resolution of the PWM unit does not work well beyond 120khz so that the expected reduction in filter size as compared to the Arduino Uno running at 63khz PWM speed was not as dramatic as expected. The mechanism to achieve 16bit resolution for an Arduino Uno by oversampling as was explained in detail here (essentially by folding extra bits into the time domain), and we follow the same strategy for the ESP32.

Now here some more specific points of the software:


Measurements

Under construction

This demonstrates temperature stability for an extended period of time. To the left, we see an independent temperature measurement by an external 6 digit Rigol 3068 DMM, attached to a separate nearby thermistor on the laser diode mount. Noise is less then 0.5mK. In the middle we see the temperature as seen by the ESP32, it does not drift because the setpoint and the ADC refer to the same reference voltage. On the right the TEC current is plotted. Measurements were performed every 10sec.

This LabVIEW interface shows short term stability:

Autotuning mode samples the response under alternating current changes and computes from this the optimal configuration of the PID regulator loop:

To be continued.


Downloads

Under construction


Version history

Current: Vers. 0.9 -- May 2026

Return to home page