Soldering Iron Controller for hakko T12 tips on stm32

This is a first release of the soldering iron controller for hakko t12 tips based on stm32 micro controller. The project is a evolution of the soldering controller built on atmega328 micro controller. This time the micro controller resoures, mostly the flash memory amount, allowed to implemen graphical oled display. It was a pleasure to investigate the stm32 microcontroller and i must say that the menufacturer created a great product.


The main features of this controller are:

  • PID algorithm used to manage the supplied power. This allows to keep the required temperature very stable.
  • The controller uses ambient temperature (sensor inside the handle or in the case of the controller) to correct the tip temperature measured by a termo couple.
  • The controller supports individual calibration of the tip by four reference points, 200, 260, 330 and 400 degrees Celsius.
  • There is a calibration procedure in the controller simplifying the tip calibration process.
  • The controller uses high-frequency PWM signal to control the supplied power. The controller is working silently.
  • Accelerated rotary encoder algorithm implemented in the controller, allowing make the changes quickly.
  • The temperature can be displayed in two degrees: elsius or Fahrenheit.
  • The controller implements automatic power-off precedure in case of inactivity.

hakko T12 soldering tips

The hakko t12 coldering tips are very convenient tools: they are heating extremely fast and have a sensor inside that allows to keep the temperature very stable. It is a big pleasure to use such a amasing tool. The tips requre just three wires: plus, minus and ground. The heating element inside the tip is connected consequently with the thermo couple allowing to decreate the reqired wires. It makes the cable very flexible and light weight.

To use the t12 tips you may need to order a handle. The one i would like to recommend is a FX9501. The problem is a connector. To onect the handle to the controller you can replace the standard connector with some kind of aviation plug which can be ordered on e-bay, for exemple. GX12-5 is a good choise. The FX-9501 handle has a three-wires cable. To install the temperature sensor (thermistor) inside the handle, you may need to replace the cable with the five-wires one. But the cable has a disadvantage: it has a heavy weight so you can put the termistor inside the controller case like i did.

Connect the sensor

As i mentioned before, the tip uses two wires to heat and to check the temperature. The controller puts some power to the iron for some period then turns the power off and checks the temperature. The termo couple generates very small voltage, about several milivolts, so to check this voltage operating amplifier is implemented in the schematics. To limit imput voltage on the operating amplifier during the period when the iron is powered by 24 volts, zener diode is implemented in the schematics. You can see the sensor part of the schematics on the picture below.

The main component of the schematics is a dual channel operating amplifier, mcp602. The temperature of the iron is cheked by the first amplifier on pins 1,2,3 and the current through the iron is checked by the second amplifier on pins 5,6,7. This allows to check that the tip is connected to the controller and start the 'change tip' procedure if the tip is disconnected from the handle.

Supply the power to the iron

The power is supplied to the iron by high-frequency (40 kHz) PWM signal to make the controller silent. The mosfet has near zero resistance while it is open and about infinite resistance when it is closed. But in the intermediate state (while the mosfet is switching) the resistance become valuable and the mosfet start heating. This forum thread explains the problem in details. In short, the MOSFET has capacitance in the gate that requires time to charge or discharge. To increase the speed of the MOSFET, the three-transistor driver is implemented on bipolar transistors in the schematis.

Zener diode (18V) is used to limit Gate voltage (Vgs) of the MOSFET while it is open because the power supply voltage is higher than maximum value of mosfet vgs voltage. The diode FR104 removes the power from the iron when the MOSFET is closed. You can replace this diode with another one, but you must use fast recoverable diode.

The inductivity shown in the schematics is a tor of outer diameter about 1.5 cm wired with 20 cm long copper. This inductivity prevents flickering of the electricity while the iron is heating.

Build the controller

The complete controller schematics is show on the picture below. The controller is built on the bluepill board to simplify prototyping. You can use the pure stm32f103c8t6 micro controller if you wish to create compact variant of the controller. As you can see on the picture, the DC-DC converter is used to get 5v for the operating amplifier and to power the micro controller. In the controller the WSTECH DC-DC isolated converter is implemented. It supplies very stable power for the operating amplifier.

As to operating amplifier, I used non-expensive mcp601 IC. It is working just fine. Previously i used another operation amplifier, ad822, which is more accurate and more expensive. But recently there is non-expensive variant of this amplifier from the Chineese manufacturers that is very noisy, so i recommend the mcp601 amplifier. As you can see the schematics is far from ideal one: it uses three different voltages: 24 volt for iron power, 5 volts for operating amplifier and 3.3 volts for micro controller. It would be better to use 3.3 v capable operating amplifier, but to do so we must solve two problems: create new low noise DC-DC converter (24->3.3) and find high quality dual channel operating amplifier. Surely the amplifier should be is sop case, not dip-8.

Separate at24c32 EEPROM IC from Atmel is used to store the soldering tip calibtarion and configuration of the controller. The 2k resistors allow to communicate to the EEPROM at high speed, 400kHz. Actually, the controller implements low speed communicatin at 100 kHz for reliability.

Initializing EEPROM

The EEPROM in the controller should be initialized.During starting procedure the controller cheksthat the iron tip configuration is loaded to the EEPROM and other configuration information exists in the EEPROM. If the EEPROM is empty or misconfigured, the controler turns to the initialization menu. Here you can initialize the iron tip area and configuration area separately. At least, you need initialize the EEPROM for the very first time to write the tip information to the EEPROM. Tip configuration data is available in the source file iron_tips.c and you can edit the list. You can add some tips to the list or you can delete unused tips from the existing list. In most case the edit of the list is not necessary because you can atcivate the favorite tips from the list later using corresponding menu.

The EEPROM initialization menu is available through the main controller menu, so you can erase all calibration data for the tips if you want.

Tune the controller

The external thermo couple required to tune the potentiometer.

In the controller schematics you can see the potentiometer that tunes the operation amplifier to get the expeted temperature readings at pin1. You can use different operating amplifier, you can use different tips so this potentiometer increases the controller flexibility. This potentiometer should be tuned at least once you created the controller. The main idea is that the controller reads the voltage from the thermo couple through the ADC and gets some integer data in the interval 0-4095 depending of the voltage on its pin. The near the voltage to 3.3v the near the readings to the 4095. The potentiometer should be tuned so when the iron temperature become 450 Centegrees, the ADC reading should be about 4000.

To simplify controller tuning procedure, the tune mode implemented in the controller. This mode can be activated from the system menu item 'tune'. When the tune mode is activated, the controller powers on the iron and displays on the screen applied power (as a triangle) and the gauge of the current temperature readings. The gauge has a label '450'. When the gauge reaches this label, the iron temperature should be 450 degrees of Celsius.

Rotate the encoder to change the supplied power to the iron. Adjust the power manually to keep the iron temperature as neer to 450 Celsius as possible. Then rotate the potentiometer to tune the lower gauge to the label. When you have finished the tuning procedure, long press the encoder handle for about 2 seconds.

It is recommended to use the thick tip that produce the highest voltage to perform the tupe procedure. For example, T12-K, T12-D52 or so.

The working modes

The controller supports several modes:

  • Standby mode. The iron is switched off.
  • Main working mode (keep the temperature).
  • Bost mode, when the controller increases the required temperature for some period of time.
  • Tip change mode.
  • Tip calibration mode
  • Tune mode (the initial setup procedure)
  • Setup mode

When the controller is just powered on, the standby mode is activated. In this mode the soldering iron is completely powered off. The main display shows the following information:

  • The preset temperature in the top left corner of the display (in units selected - Celsius or Fahrenheit);
  • The 'OFF' message in the top right corner of the display, indicating that the iron is powered off;
  • The current temperature of the iron;
  • Current tip name;
  • The temperature of the handle (ambient temperature);

The preset temperature can be adjusted by rotating the encoder handle while the iron is off. To power on the soldering iron, push the encoder handle lightly. The controller will be switched to the main mode. Now the controller will try to keep the iron temperature near the preset temperature. When the iron is heavily used, the temperature can slightly deviate from the required value.

In the main mode the message 'ON' will be displayed in the top-right corner of the screen and the supplied power is displayed in the right part of the display as a triangle.

By rotating the encoder it is possible to change the preset temperature. The message 'ON' would be showed again till the iron would reached the new preset temperature. To return to the standby mode, press the encoder handle lightly.

If the tip would be removed from the handle in the standby mode, the controller would turned to the tip selection mode. In this mode the list of the active tips will be displayed on the screen. Rotate the encoder to select appropriate tip name of the new tip you are going to insert into the handle. It is not necessary to push the encoder, just select new tip and insert the tip into the handle.

To get to the setup mode, long press the encoder in standby mode. In the setup mode the configuration parameters can be adjusted.

The setup menu

There are several menu items in the menu. They are obvious and not all of them are described here in the details. You can select the temperature units: Celsius or Fahrenheit, setup the automatic power-off timeout or disable this feature completely, activate the tip in the main tip list, calibrate the current tip and customize the PID algorithm parameters. The most complicated menu items are described later.

The tip activation

You can change the active tip list to simplify tip change procedure. As you may already know, there are 91 tips in the default list. It wuold be inconvenient to scroll down through the complete list to select the one will be inserted to the handle. You can disable some tips in the main list if you are not going to use it anymore. The main tip list has a checkbox left of the tip name showind the tip is active or not and has a sign "[!]" right of the tip name if the tip is not calibtared. To activate the tip, press the encoder handle lightly. Rotate the encoder to select another tip. Long press the encoder when you would finished the tip activation procedure.

The current tip calibration

The external thermo couple required to tune the potentiometer.

The curernt tip can be calibrated using 'calibrate' menu item. If the tip is not calibrated yet, the "[!]" sign would be displayed near the tip name in the bottom line of the main screen. In the calibration mode, you should first select one of the reference temperature point (200, 260, 330, 400) to calibrate the temperature readings. Thep turn the power on by pressing the encoder lightly. The iron start heating. When the required temperature would be reached, the controller beeps and get ready to the real temperature enter. Check the iron temperature by the external thermo couple and enter this temperature to the controller: rotate the encoder handle to select the real temperature from the list then press the encoder lightly. The controller limits possible real temperature values near the reference temperature ponint. If you cannot find the real temperature in the list, enter the nearest value. This limitation increases the controller reliability by preventing to enter the temperature values that is far enough from the expected temperature. Every time you entered real temperature value to the controller, the calibration data is updated, so you can calibrate the tip iteractively. First, go through the all reference points, then repeat the procedure one more time. If the real temperature differs slightly from the reference one, you can assume the reference point is calibrated correctly.

After all reference points would be calibrated, long press the encoder to save new calibration to the EEPROM. The controller would double beep if the calibration saved succesfully.

How the controller works

The main software component of the controller is a procedure that check the iron temperature and calculates the required power using the PID algorithm.


...to be continued...