Each soldering tip has a temperature sensor, a thermo-couple that generates very small voltage, about several millivolts, so to check this voltage operating amplifier is implemented in the schematics. You can see the sensor part of the schematics on the picture below.
- The minor schematics changes implemented: two 100k resistors added. You cannot use last firmware release without these resisters.
- Now the check temperature frequency increased to 48 HZ
- Buzzer is always on issue fixed
- Screen saver feature implemented
- New encoder button procedure increase the management stability
UPDATED 02/28/2021
- Fixed issue in the schematics, the handle connection was wrong. Please, investigate.
UPDATED 04/18/2020
- Tip activation menu available in tip selection mode by short press the encoder
- Main menu is accessible in tip selection mode by long press the encoder
- Two modes hardware switch supported: REED and TILT. Tilt switch algorithm updated.
- Ambient temperature and tilt switch readings now are available on debug screen.
- Debug mode available in about dialog by long press of encoder, no extra firmware required.
UPDATED 01/15/2020
- Now the tip activation menu is available in tip selection mode, just long press the encoder
UPDATED 11/16/2019
- Fixed incorrect message processing issue. Now "EEPROM read error" message would be displayed in case if the controller cannot access EEPROM IC.
- Empty slot for TIP calibration data issue fixed. The slot of non-active tip can be used for newly activated tip.
- When new tip activated, the controller checks data written to EEPROM. If tip configuration data would not read correctly the "EEPROM write error" message would be displayed.
UPDATED 11/09/2019
To fix the issue in tip connected detection procedure, capacitor C8 has been removed from the schematics and new firmware released.
UPDATED 11/05/2019
- New Encoder algorithm implemented, just press and hold the encoder button for long press
- EEPROM checking procedures added: at startup sequence and when tips are being activated
- default tip calibration data issue fixed
- automatic adjustment of the tip temperature depending on the ambient temperature issue fixed
UPDATED 10/21/2019
- Fixed I2C display type initialization bug
UPDATED 10/11/2019
- Soldering controller v2.00 released
- New schematics. Users using previous hardware version should perform minor change
- New firmware v.200 released based on u8g2 library
- Project migrated to C++
UPDATED 09/21/2019
- Sensor schematics error fixed.
UPDATED 03/19/2019.
- The schematic was revisited and fixed the thermistor connection.
- New version of the schematics published: zener diodes removed, changed the power of OP AMP
UPDATED 01/04/2019.
- Hardware standby (low power) mode implemented using tilt switch.
- New menu items implemented
UPDATED 10/22 2018.
- New calibration procedure implemented
- Updated algorithm to store tips configuration
- Bugs fixed
This is a second release of the soldering iron controller for Hakko T12 tips based on STM32 micro controller. The project is an evolution of the soldering controller built on atmega328 micro controller. This time the micro controller resources, mostly the flash memory amount, allowed to implement graphical OLED display. It was a pleasure to investigate the STM32 micro controller and I must say that the manufacturer created a great product.
The main features of this controller are:
- The controller supports OLED display based on SD1306 chip using 7-pins SPI or I2C interfaces. No additional recompilation or code modification required. If display would been found on I2C bus during startup procedure, it would be used. Otherwise the controller would initialize the SPI bus.
- The controller checks the soldering tip is connected by testing a current through the tip. If tip is not connected to the iron handle, the error message would be displayed on the main screen. But when soldering iron is powered off, the 'change tip' procedure would be activated. i.e. to change current tip, you just have to remove the soldering tip from the iron handle.
- The controller uses ambient temperature (sensor inside the FX9501 handle or in the case of the controller) to correct the tip temperature measured by a thermo-couple.
- The controller supports individual calibration of each tip by four reference points, 200, 260, 330 and 400 degrees Celsius.
- The dedicated calibration procedure is implemented in the controller to simplify the tip or Hot Air Gun calibration process.
- The controller uses 48 HZ PWM signal to control the supplied power to the soldering tip. This makes the controller silent.
- PID algorithm used to manage the supplied power to soldering iron. This allows to keep the iron temperature very stable.
- Accelerated rotary encoder algorithm implemented in the controller, allowing make the changes quickly.
- The temperature can be displayed in two degrees: Celsius or Fahrenheit.
- The controller implements automatic power-off procedure in case of inactivity.
- The standby (low power) mode implemented using optional hardware tilt switch.
- U8g2 graphics library implemented in the controller.
- Screen saver feature implemented.
If you have built previous (v1.00) version of this controller, you should perform two minor changes to the hardware schematics:
- SPI OLED CS pin is PA10 now (was PB12)
- TILT sensor pin is PA8 now (was PB14)
This changes are necessary because new CubeMX version does not allow use pins of SPI2 bus.
Previous version of firmware and schematics is available on github repository.
OLED 128x64 displayAs was stated on the feature list, the controller can work with I2C os 7pin SPI version of the OLED display based on sd1306 or sh1106 chip. During startup procedure the I2C bus scanned for OLED display. If the OLED display would detected on the I2C bus the controller starts using this display. Otherwise, SPI version of the display would be initialized. There are two displays shown on the complete schematics, but the only display can be connected to the controller. You can use either OLED display version, but only one.
The controller requires big size pcb to fit all the components so I suppose it is better to split the controller in two separate boards: main board and display board. It is convenient to solder rotary encoder to the display board and use encoder neck to fix this board on the acrylic front panel. See the picture below.
To make display pcb more compact, it is convenient to turn the display upside down (the connector is on lower side). So the display image is rotated by 180 degrees in the firmware. If you are going to connect the OLED in normal state, you should change the init() method in display.cpp file and recompile the firmware. Also, if your display is not built on sd1306 chip, you should change this file. The github repository contains binary firmware versions for ssd1306 and sh1106 OLED displays.
Hakko T12 Soldering TipsThe Hakko T12 soldering 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 amazing tool. The tips require just three wires: plus, ground and earth. The heating element inside the tip is connected consequently with the thermocouple allowing to decrease the required 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 only problem is its connector. To connect the handle to the controller you can replace the standard connector with some kind of aviation plug which can be ordered on eBay, for example. GX12-5 is a good choice.
The FX-9501 handle has a three-wires cable. To install the temperature sensor (thermistor) and tilt switch inside the handle, you may need to replace the cable with the five-wires one.
When connecting the handle to the GX12-5 plug you can use the following reference of the plug pinout.
Also you can order Chinese soldering kit like shown on the picture below and use another handle in this project. This kit also contains tilt switch and thermistor.
The handle of this controller kit has one disadvantage: it is not convenient to change the soldering tip while it is hot.
Build/Start checklistTo clarify the sequence for starting the controller here is the list of operations should be performed consequently:
- Build the controller hardware, solder all the components as shown in the complete schematics below.
- Connect the soldering iron handle with tip installed to the controller
- Power on the controller
- Activate some tips you are going to use (or all tips you have)
- Initialize the EEPROM (using main menu)
- Setup some common parameters through menu (temperature units at least)
- Tune the soldering iron potentiometer using tune menu item
- Calibrate several soldering iron tips
Each soldering tip has a temperature sensor, a thermo-couple that generates very small voltage, about several milivolts, so to check this voltage operating amplifier 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, rail-to-rail, low-noise operating amplifier, AD823. The temperature of the soldering iron tip is checked by the first amplifier on pins 1, 2, 3. As soon as tip uses the same two wires to heat and to check the temperature, zener 3.3v diode is used to limit input voltage on the operating amplifier when the iron is powered by 24 volts.
You can replace AD823 op amp by its analog. It should be rail-to-rail op amp, powered by +3.3 volts single power source and has low noise. The following list describes the analogs: lm6118, lm6218, lt1122, lt1201, lt1213, lt1215, opa2132, opa2134, opa2227, opa2604, tle2072, tle2142, tle2227. In case if none of them is available in the local market, the MCP602 and its analog can be used. It is cheaper but more noisy.
C9 capacitor should be placed as close to op amp as possible.
The controller also checks the iron tip is connected before the power would be applied to it. It increase the soldering station safety and allows to start the 'change tip' procedure if the tip is disconnected from the handle.
To check the connectivity, the controller uses second amplifier on pins 5,6,7 that measures the voltage drop on R10 depending on the current through the iron tip.
Supply Power to the IronThe power is supplied to the iron by low-frequency (48 Hz) PWM signal to make the controller silent. This time the MOSFET is driven by a simple circuit consists only one transistor because PWM frequency is low. 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. I believe you can replace this diode by schottky diode, but the fast recoverable diode is better. The resistor R2 ensures the iron would be switched off in case if controller hangs.
If you have previous (v1.0) version of the controller, you can keep existing heater circuit unchanged. Previous version of the mosfet driver is working fine with new firmware.
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.On aliexpress you can order another isolated DC-Dc converter 63v->5v Like shown on the picture below:
On aliexpress you can order another isolated DC-DC converter 63v->5v Like shown on the picture below:
If you cannot find these converters, it is possible to order another converter based on MP1584 chip like shown on the picture below.
It is advised to add yet another isolated 5v->5v converter, b0505s. Connect two DC-DC converters consequently in this case: 24v -> MP1584 DC-DC converter -> b0505 -> ams1117. And you get isolated power supply for your stm32 micro controller.
Separate at24c32 EEPROM IC from Atmel is used to store the soldering tip calibration and configuration data of the controller. The 2k resistors allow to communicate to the EEPROM and I2C OLED display at high speed, 400kHz.
Flash The Firmware to the Controller
To flash rebuilt firmware to the controller the st link v2 programmer and ST link utility are required.
Download the STM32 ST-LINK utility from st site. Install the utility in your system. Launch the ST-LINK utility, connect the programmer to the 4pins SWD interface of BluePill board, press "connect" button. The main window should display the memory content of the BluePill board. Press flash button to write the firmaware to the BluePill board.
Building instructions
To compile the project from the source code you have to:
- install "Workbench for STM32" and CubeMX software from openstm site.
- download your project ZIP file from the github repository
- create directory named F1_T12 in your project directory. You can determine your working directory using windows->preference menu, then select general->workspace parameter, then find "workspace path" field.
- extract everything from ZIP to F1_T12 or just extract ZIP archive from GitHub then rename created top folder to F1_T12 (name of top folder must be F1_T12)
- in Drivers folder extract zip archive u8g.zip, this create u82g directory inside Drivers folder
- start CubeMX (just click to F1_T12.ioc file in F1_T12 folder)
- CubeMX ask you to migrate to newer firmware version, answer yes to migrate.
- In the CubeMX select "Project Manager" pane. Here you must check project name and project location filed. Then select Toolchain as "SW4STM32" and mark checkbox "Generate Under Root".
- Press button "GENERATE CODE" then "Open Project". The system workbench should be started with the project.
- add include file path for u8g2 (Project -> Propertis ->Settings; Configuration: [All configurations], Includes => add directory for u8g2 includes (I added: "${workspace_loc:/${ProjName}/Drivers/u8g2/inc}")
- Convert project to C++ (Right mouse click on the project folder in the left pane)
- Add "-ffunction-sections -fdata-sections" optimization flags to make the binary code shorter. (Properties->C/C++ Build->Optimization->Other optimization flags).
- Compile and run
The EEPROM of the controller should be initialized first. During startup procedure the controller checks that 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 controller turns to the initialization menu. Here you can reset the EEPROM and activate required iron tips.
Note: Tip configuration data is available in the source file iron_tips.c and you can edit this 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 activate the favorite tips from the whole list using tip activation menu.
Tune the ControllerNote: the external thermo-couple required during this procedure.
In the controller schematics you can see two 500k potentiometer R5 that tunes the operation amplifier to get the expected temperature readings at controller pin PA4 pins of BluePill board. You can use different operating amplifier, so this potentiometer is increasing the controller flexibility. I can say that AD823 and MCP602 op amps require different values of R5.
The 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 on its 12-bits ADC depending on 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 is 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 (in percents) and the gauge of the current temperature readings ("iron temperature" in the picture). The gauge has a label '450' ("reference point").
Note:To perform tuning procedure more precisely, apply a solder drop to the contact between the thermo-couple and the soldering tip rod.
Connect external thermo-couple to the iron tip and enter the tune procedure. The iron should start heating. Rotate the encoder to change the supplied power to the iron. Pressing the encoder handle shortly you can toggle supplied power (on or off). Check you external thermo-couple and adjusting the power manually by encoder try to keep the iron temperature as near to 450 Celsius as possible. At the beginning you can supply a more power to the iron, but when the temperature will near to 450 degrees by external thermo-couple, you should decrease the supplied power. Any way, try to keep the iron temperature about 450 degrees.
As soon as you have stabilized the iron temperature near 450 degrees, rotate the 500k potentiometer trim to shift gauge bar on the display left or right. Adjust the potentiometer so the bar would be as near to the reference temperature as possible. Then long press the encoder handle (for about 2 seconds) to turn the iron off and finish the procedure. It is recommended to use the thick tip that produce the highest voltage when performing the tune procedure. For example, T12-K, T12-D52 or so.
User manualThe Working ModesThe controller supports several modes:
- Standby mode: the iron is switched off.
- Main working mode: keeps the temperature
- Boost 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.
There are several menu items in the main 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 ActivationYou 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 would 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 showing the tip is active or not and has a sign "[!]" right of the tip name if the tip is not calibrated. 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 CalibrationNote: the external thermo-couple required to calibrate iron tip.
The current 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. There are two calibration modes in the new version of the controller software: automatic and manual.
In the automatic calibration mode, controller tries to guess correct interval of internal readings for the current tip and asks you to enter real temperature at the several (5-8) reference points. First, 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 read the real temperature. Check the iron temperature by the external thermocouple and enter this temperature to the controller: rotate the encoder handle to select the real temperature from the list then press the encoder lightly. Then the controller continues with the next reference temperature. This procedure finishes when you enter temperature of all 8 reference points or when the real temperature over 430 Celsius. During this procedure controller updates tip calibration data and writes current tip temperature in the lower left corner of the screen.
As you can see the following parameters are shown on the screen:
- The calibrating tip name
- Reference temperature is the temperature the controller expect to setup
- Current temperature - is the calculated value of the temperature using current calibration parameters
- Applied power - the gauge of applied power to the iron, percentage.
After all reference points would be calibrated, the controller saves new tip calibration data to the EEPROM. The controller would short beep if the calibration saved successfully.
Automatic calibration procedure can built non-accurate calibration data parameters of the tip. To improve the tip calibration data the manual calibration procedure can be used.
In manual tip calibration you must guess the internal tip readings that matches the reference temperature. This procedure is iterative: you start with the some preset temperature value in internal units (for example, calibrated by automatic procedure) the controller heats the tip to this preset temperature and gets ready. Then you measure the real temperature by the external thermo couple. If the real temperature is not equal to the preset one, you should increase or decrease the preset temperature.
The progress bar in the lower part of the display shows the difference between preset and current temperature (in internal units) of the tip. The controller keeps the tip temperature near the preset value (vertical line on the progress bar) all the time. To increment the preset temperature, turn the encoder right, to decrease - turn it left. One encoder 'tick' corresponds one Celsius degree.
As soon you guess the preset temperature for the reference temperature point, press the encoder lightly. You return to the selection mode. Here you can select next or previous reference point. When you finish calibration, long press the encoder.
Automatic power off feature
This feature can prevent fire in your home. There are two automatic power-off features are implemented inside the controller, software and hardware. The hardware one requires optional tilt switch. The automatic power off feature enabled as soon as you setup the auto off timeout in the setup menu. You can setup the minutes before the soldering iron will be switched off in case of inactivity. In software mode, the controller turns on the Idle mode if the supplied power to the iron is stable. In this case, the controller will power off the iron in specified timeout. When the time to automatic shutdown near, it will be displayed as a seconds remaining. When you use the iron, the supplied power changes and the controller resets the automatic power off timeout.
As I mention before, this version of the controller supports hardware tilt switch.
The tilt switch is working as follows: when it turned downstairs, it is "open" (not conduct the electricity) when it turned upstairs, it is "closed". The tilt switch is the part of the Chinese soldering kit. One pin should be connected to PB14 pin of stm32 through 100k resister, another - to the ground. The tilt switch should be open when the IRON is turned downstairs (in use).
To use the hardware tilt switch, you must setup automatic power off timeout, standby and temperature. If the standby temperature is "OFF" the hardware tilt switch will not be used and software solution described previously will be implemented. Also, you can setup standby time (timeout to switch to low power mode). When the tilt switch enabled, the main working mode changes the following way. The iron is starting heating. When it reaches the preset temperature the "Ready" message will be displayed and the controller will keep the preset temperature. If the soldering IRON is not used (laying on the table, the tilt switch become "closed") the controller will switch low power mode in standby timeout. In low power mode, the controller will change the preset temperature to standby one (setup through main menu). If the iron keep laying for automatic off timeout, the controller will switch off the power.
As soon as you start using the iron, the controller restores the preset temperature.
The controller supports two types of hardware switches: TILT switch and REED switch. The type switch should be configured in the main menu. You can mount the tilt switch inside the soldering handle in any way, the controller would deactivate the low power mode when detects the tilt status change (open-closed or closed-open). The reed switch should be closed when the IRON is not in use. For example, you could add some magnet into your soldering base and install the reed switch into the soldering handle. When you put the handle into the base, the reed switch would be shorten and the controller would activate low power mode. Obviously in this case it is convenient to change the low power timeout to lower value.
To connect the IRON handle you can use the schematics shown bellow. As you can see, the TILT switch and the thermistor connected between dedicated line and ground. The iron tip is connected by three lines: Earth, ground and V+.
The software
Prebuilt version of the controller software can be downloaded from the github repository. To upload this hex file into controller, you can use stm32 st-link utility.
Or you can build your version of the sketch by the following instruction from the source code.
Comments