The Digital Controller for Amazing T12 Soldering Tips





Introduction: The Digital Controller for Amazing T12 Soldering Tips

Updated 01/14/2018. Fixed bug with IRON overheating. New procedure in the tip configuration implemented. Now the temperature translation parameters changes during the IRON calibration.

Updated 11/23/2017. Fixed bug with cold temperature detection. New criteria for ready state implemented in the working mode and in the tip configuration mode. The schematics updated: no isolated power supply required, changed some registers, fast recoverable rectifier diode changed, proven the usability with cost-efficient operating amplifier, MCP602. Thank to geko1453.

Updated 10/21/2017. New PID parameters used. Fixed FET connectivity in the schematics.

Updated 10/14/2017. Fixed unstable work with 'thin' soldering tips such as T12-BC1, T12-JL02, T12-IL, T12-D12 by Increasing the frequency of temperature sampling to 50 Hz.. New PID coefficients implemented. No hardware change required, no configuration changes required, just update the firmware of your controller.

Updated 7/1/2017. New software features are available: new per-tip calibration and high-frequency temperature check by Timer1, no additional software library required.

It was a brilliant idea to create the hakko t12 soldering tips. They are just great: can keep the required temperature within the small interval, are compact and are heating extremely fast. Usually it takes about 12-15 seconds to reach the required temperature. You can buy great and expensive soldering station that uses these tips, or you can make own digital soldering controller based on arduino and invest more interesting details. In this project i will show you how to create non-expensive controller for hakko t12. The main feature of the controller is PID algorithm, that allows to supply the power to the iron smoothly and keep the required temperature very accurate.

The key features of this controller are:

  • Each tip can be calibrated separately by 3 reference points to increase the accuracy.
  • The PID method is implemented to keep the temperature of the soldering iron. The iron raises the temperature in about 12-15 seconds and keeps it inside 1 degree of Celsius.The controller keeps the temperature in case of heavy usage because the PID algorithm is very sensitive and can quickly increase the supplied power.
  • The controller supports two working modes: keep the temperature and keep the power supplied.
  • The controller is silent. The Timer1 working at 31250 Hz is used to generate the PWM signal.
  • The controller implements accelerated rotary encoder. When the encoder is rotated slowly, the temperature setting is changed by 1 degree. When the encoder rotated quickly, the temperature setting is changed by 5 degrees.
  • The temperature is stored in arduino EEPROM after the soldering iron was used in case the temperature settings were changed.
  • The controller saves in EEPROM units used for the displayed temperature (Celsius or Fahrenheit), preset temperature and calibration data.
  • Automatic switch-off in case of idle operation is implemented.

Step 1: The Connector

First problem was the connector, supplied with the soldering iron handle. It was so rarely used, i could not find the socket for it, so i used another pair of connectors that suit the characteristics of the soldering iron. This is aviation plug GX16-5 (or you can use GX16-5) with 5 pins.The wires of the iron handle are: black - minus, green - plus (24v), red - should be ground. Actually, i did not attached the red wire anywhere. The main two wires are the black one which is connected to the ground of the controller (minus) and the green one which is connected to the plus pin.

Step 2: Connect the Sensors

Second problem was the iron tip uses the same pins for heating and to check the temperature. The iron has the thermocouple inside that is connected consequently with the heating element. The thermocouple generates a small amount of electricity, about 2-9 millivolts depending on the iron temperature. The black wire is minus, the green wire is plus, do not change them.

To register this electricity accurate operating amplifier IC must be used. But, the iron should be powered through the same two wires. No one operating amplifier likes 24 volts on the input pins! Fortunately, some qualified people have solved this problem already. Here is the soldering iron controller for the hakko t12 iron. The schematics have brilliant idea to use the zener diode (vd6) to limit voltage on the input pin of the operating amplifier. As you can see on the picture above, In my controller 3.3 v zener diode is implemented.

The controller has two parameters to check: the iron temperature via first amplifier on pins 1,2,3 and the current that is going through the soldering iron via the second amplifier on pins 5,6,7. First amplifier should be tuned by 500k potentiometer at least for the first time. This variable resistor should be tuned the following way: when the iron is 450 degree of Celsius, the output voltage should become near 5 volts (reading of A0 pin in the Arduino should be near 850-900). To simplify the calibrate procedure the tune mode is implemented inside the controller software. The tune mode can be run from the settings menu. The tune procedure usually runs only once: it is implemented to help adjusting the variable register so the controller could correctly check the iron temperature.

The second amplifier is used to check the soldering iron is connected to the controller. The controller switch on power to the iron and checks the current is going through it. The 1uF and 100n capacitors increase the readings stability. The current is checked permanently when the iron is powered on and is checked every half of second by the small amount of power when the iron is switched off.

Step 3: Make It Silent

To supply the power to the iron, the P-channel mosfet transistor is implemented. Arduino controler can manage this mosfet throughout the PWM signal. The arduino built-in software library implements the function analogWrite() to manage PWM pins. Unfortunately, the frequency of the standard PWM signal is 490 Hz. If this function would be implemented, the controller would generate the noise while the power supplied to the iron. But who loves such a noise? To make the controller silent, PWM signal generated by Timer1 running at 31250 Hz is used.

Each mosfet has some capacitance on the gate. This capacitance is really matters when we need to switch the mosfet quickly. Here you can find the detailed description of the problem along with the schematics that allows manage the mosfet at the high frequency. The schematics of the heater is shown in the picture. To increase the speed of mosfet, the two-transistors driver is implemented on bipolar transistors. You can use another transistor pair. The fr107 diode does not allow the backward current when the mosfet is closed. You can change this diode with another high frequency impulse diode.

Also you can see the inductance on the schematics. My controller generated the noise without this inductance and the table lamp, connected to the same outlet begins flickering. 6A 100uH inductance should work well.

Step 4: Assemble the Controller

As you can see, I have split the schematics into two parts: hight-voltage heater part and low-voltage sensor part. The high-voltage heater consists of the mosfet and its driver and fr107 diode. As soon this version of the controller has smaller parts (2W resistor instead 5W one and fr107 diode instead of fr304) it is not necessary to split the controller. You can place all the components on the single PCB.

Here is the list of the components you need to build the controller:

  • AC-DC power supply 24 v.
  • DC-DC isolatedpower converter 5v for the controller.
  • Arduino controller (you can use arduino nano v3). I used the atmega328p-pu microcontroller with 16 MHz oscillator and two 22 pF capacitors because it is more compact. Do not forget to burn the bootloader inside the controller.
  • lcd 0802 display
  • irf9540 mosfet
  • npn general purpose transistor ksp10 (2n2222 is better) - 2 pcs.
  • pnp general purpose transistor s9012h (2n2907 is better)
  • Zener diode 3.3 volts
  • Zener diode 18 volts
  • FR107 FAST RECOVERY RECTIFIER DIODE (you can use another impulse diode)
  • Operating amplifier ad822 Rail to Rail with mosfet input (can be replaced by analog). The MCP602 cost-efficient operating amplifier is proven to work.
  • 0.11 Ohm 2 watt power resister to check the current through the iron.
  • 100 Ohm resistor - 2 pcs
  • 470 Ohm resistor - 2 pc
  • 50k resistor
  • 1k resistor - 3 pcs
  • 5.1k resistor
  • 10k resistor - 3 pc
  • 100k resistor
  • 10k potentiometer
  • 500k potentiometer
  • 1uF ceramic capacitor
  • 100 nF ceramic capacitor - 5 pcs
  • rotary encoder with the push button
  • buzzer
  • connector GX12-5 (or another)

The DC-DC converter is proven to work. As soon as the current to the controller part is just 30mA, i suppose you can use the linear voltage regulator LM317 or 7805, this should heat a little (19v * 30mA = 570mW).

Finally, burn the sketch to the controller.

Step 5: The Controller Menu

As i mention before, the controller has several modes:

  • standby mode
  • main working mode (keep the temperature)
  • power mode (manually regulate the power)
  • setup mode
  • tip calibration mode
  • tip selection mode
  • tune mode (tune the potentiometer)

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

  • The preset temperature in the left side of the upper line (in units selected - Celsius or Fahrenheit);
  • The 'OFF' message in the right side of the upper line indicating that the iron is not powered;
  • The current temperature of the iron in the left side of the second line;

When the iron become cold after it was used, the 'cold' message is displayed on the second line. The preset temperature can be adjusted by rotating the encoder handle while the iron is powered off.

Sometimes the active tip name is displayed in the upper-left corner of the standby screen instead of the preset temperature.

Tip selection mode is activated from standby mode when the iron tip (or iron handle) disconnected from the controller. When you remove the tip from the handle, the controller allows you to select new tip from the list menu of supported tips. This list can be adjusted in the sketch manually by editing the source code. As you can see, by default the sketch supports 5 different tips. You can change this number and you can supply new names of your tips (each tip name could have up to 4 letter in its name).

You can select new tip name from the menu list before plug the tip in the handle.

To power on the soldering iron, push the encoder handle lightly. The controller will be switched on and the main working mode activated. Now the controller keeps the iron temperature near the preset temperature. When the iron is heavily used, the temperature can deviate from the preset one. In the main mode the display shows the following information:

  • The preset temperature in the left side of the upper line (in units selected - Celsius or Fahrenheit);
  • The 'ON' message in the right side of the upper line indicating that the iron is powered on and is heating. When the iron reaches the preset temperature, the 'rdy' (ready) message will be displayed. The 'wrk' message indicates that the iron is in use;
  • The current temperature of the iron is displayed in the left side of the second line;
  • The power supplied to the iron (in percents) is displayed in the right side of the screen;

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

In the main working mode, the controller checks for the current through the iron. If the current would not detected, the controller switches off the power and the message 'Failed' would displayed on the screen. Light press the encoder button to return to the standby mode.

The power mode can be switched on by long press the encoder while it is in the main mode. In the power mode, you can manually adjust the power supplied to the soldering iron by rotating encoder. In the power mode the screen shows the power supplied to the iron in the internal units (0-255) and the iron temperature in human readable units. Light press of the encoder toggles on-off power in the power mode. Long press of rotary encoder handle will return the controller from power mode to the main mode.

To get to the setup mode, long press the encoder in standby mode. In the setup mode the configuration parameters can be adjusted. There are 6 menu entries in this mode:

  • Automatic switch-off timeout is minites [3-30]. This feature can be disabled. To work properly you may need to tune the PID algorithm parameters manually;
  • Temperature units (Celsius or Fahrenheit);
  • Tip calibration ('tip cfg');
  • The iron potentiometer calibration ('tune');
  • Save the changes;
  • Cancel the changes;

Rotate the handle to select the menu item. To change the selected item, press lightly the encoder handle. After adjusting the parameter, press the handle again to return to the setup menu. Long press of the encoder handle can be used to return back to standby mode and save the parameters in the EEPROM. Or the parameters can be saved, by selecting the 'save' menu item.

Step 6: Tune the Controller

You need external thermometer to calibrate the controller.

As it was said before, the controller has to be tuned at least once. The
potentiometer 500k should be adjusted accordingly. When the iron reaches the temperature of 450 centigrade, the readings of the A0 analog pin should be 850-900. To simplify calibration procedure, the tune mode is implemented in the controller.

When the tune mode activated the iron is powered-off. Lightly press the encoder in the tune mode to toggle the iron on or off. Rotate the rotary encoder to switch the iron on or to change the supplied power. The controller displays the temperature readings in internal units (readings from A0 pin) in this mode. Rotating the encoder adjust the power to keep the 450 degrees of centigrade (use external thermometer). At the beginning you can increase the power to the maximum value to speed up the iron heating, then decrease the power to keep the temperature at the 450 degrees. You need to adjust the power to keep the iron temperature as near to 450 degrees as possible.

Now rotate the variable resistor handle to get the sensor readings near 900. Ensure that this readings is not the maximum one, rotate the variable register and get 930-950, then return back to 900. It is important because the controller should be able to measure the temperature greater than maximum value. When the variable register adjusted, press and hold the encoder for about 2 seconds to return to the setup menu. The controller calibration successfully completed.

Step 7: Calibrate the Tip

You need external thermometer to calibrate the tip.

The hakko T12 tips have different parameters and have to be calibrated separately to keep the temperature more accurately. First, you have to select the tip required. To do so, return to the standby mode, remove the tip from the handle and select required tip name from menu list rotating the encoder then put required tip into the handle. Asterisk ('*') in the lower-right corner of the display indicates that this tip has not calibrated yet.

Each tip calibrated by three reference temperatures: 200, 300 and 400 degrees of Celsius. To calibrate the current tip, select 'tip cfg' menu item from the setup menu. The controller will be switched to the calibration mode. In this mode first select the desired reference temperature (200, 300 or 400 degrees of Celsius) then lightly press the encoder. The iron starts to heat and the controller would keep the iron temperature near the selected value. As soon the iron reaches the selected temperature, the buzzer will beep. This indicates that the controller is ready to adjust the temperature at the selected reference point. Use external thermometer to evaluate actual temperature of the iron, then rotate the encoder to adjust the reference point to the controller. Then press the encoder lightly. The reference point will be saved. As soon as you corrected the temperature at selected reference temperature, the controller update the translation formula. You can select another reference temperature to adjust or you can perform yet another update of the current reference point. When the temperature would be updated at all three reference points you can save the translation formula to the controller EEPROM. To do so, press and hold the encoder button for about 2 seconds.

As is was mention before, the tip list can be adjusted in the software sketch. You can add more tips to the list and select new names of your tips. Tip name could be up to 4 symbols length.

If the tip is not calibrated, the calibration points are evaluated as the average value of all another tips that have been calibrated. If there is no one tip calibrated in the controller, the default calibration formula would be used.

Step 8: Automatic Power-off Feature

The automatic switch-off feature has been implemented in the controller. This was a great challenge because the iron handle has no shock sensor or other way to ensure the iron is in use now or just is laying down on the table. The main idea was to use the value of supplied power to the iron. In the idle state, the controller decreased the power to the minimum value to keep the required temperature. Unfortunately, the math dispersions of the temperature and the supplied power are not constant in the idle state and can periodically change. Tuning the PID algorithm parameters, i have stabilized and minimized both dispersions. The controller in the idle state now keeps the temperature dispersion as low as possible. The criteria of the iron usage is the power has been incremented slightly from the smallest value registered. This algorithm has been tested for a while and i suppose can be used for automatic power-off feature.

This solution is not very reliable so you can disable this feature.

Also, the sketch contains the class for debug and tune the PID parameters manually.

You can implement another iron handle in your version of the controller, the handle can have the shock sensor or similar to surely distinguish the idle state.

Step 9: The Old Schematics for Reference

Here you can see the previous schematics of the controller. Both hardware versions are compatible with the source code provided. May be you have already built this schematics. In this case you can use the pictures for future reference. Thank you very much.

5 People Made This Project!


  • Science of Cooking

    Science of Cooking
  • Microcontroller Contest

    Microcontroller Contest
  • Spotless Contest

    Spotless Contest

We have a be nice policy.
Please be positive and constructive.




any future upgrade like 1602 lcd

no update is planned at this time.

Hm, I have another issue these days. I received a D16 tip and when trying to calibrate the 400° point, the controller seems to never reach the temperature. It goes up and down towards the calibration point but then gets stable around only 380° indicated on the display (which in fact is already slightly above 400° according to my thermometer). But since the calibration point will never be reached from the controller's point of view, it never lets me provide the real temperature.
Any idea on that?

What sketch version are you using? The code was updated January, 14.

Any way, I would investigate the issue.

I'm using the latest version (February 11th)... I will check with some older versions of the code to see if there is any difference...

Looks like the issue with a stability when thin iron tip is used. These tips can change the temperature very quickly. You can use on of the following workarounds:
1. If you are not going to heat this tip over 300 degrees Celsius, just do skip the 400 degrees point.
2. The controller switches the power off if the internal readings of A0 analog pin is too high to prevent the tip overheat. Tune the potentiometer one more time using the current tip. As you have seen, each tip has different temperature parameters (the thermocouple generates the voltage different way). You have to tune potentiometer to ensure internal readings of the A0 analog pin about 850-900 at 450 Celsius. Also you can decrease this readings to 820-850 to let a little bit bigger temperature of the tip. Then you should calibrate all your tips one more time.
3. You can change the PID algorithm constant Ki at line #384. The lower the value the slower the controller changes the power supplied and become more stable.

Best regards.

Thanks for getting back to me on this. After some further investigation, it seems to me that the internal reading does not change properly when the iron is being heated.

I tried the tune mode once more and while heating up the iron, the internal reading increases. So far so good. But at some random point the value freezes (different number on each trial). The external thermometer proves that the temperature of the tip changes in the meantime while the reading on the display does not change. When I switch off the iron still in tuning mode, the value on the display makes a sudden jump and then slowly decreases while the tip cools down.

Seen that before? It just makes no sense to me...

Please tell me if the link works fine. I remind you that in the archive you will find two versions of hardware.

1. with the use of non isolated DC to DC step down module for 5V supply

2. with the use of AC to DC psu module for 5V.

you want to use the isolated DC to DC module that @sfrwmaker uses,
easily can make changes to the footprint of PCB on CAD files....

WARNING The design files are for the previews version of @sfrwmaker`s project and not include the latest hardware changes.

I wish
you good progress.

Hi, the link works fine. Is it possible to correct firmware for I2C display? I want to repeat this project, but my goal is to make PCB smaller and put in into the solder (like TS100).