The mighty soldering iron. If you need one, want one, or just love to build stuff, then this project is for you.

What is one of the most essential tools in an electrical engineer’s kit? I’ll tell you one that you probably love and hate; the soldering iron. You don’t have to be an EE to need one, you'll need one even if you're just a tinkerer who enjoys repairing stuff around the house. 

For basic applications, a standard soldering iron that you plug into the wall does the job, but for more sensitive work like repairing and building electronic circuits, you'll need a soldering station. The temperature control is critical as to not burn the components, especially the integrated circuits. In addition, you may also need it to be powerful enough to maintain a certain temperature in case you find yourself a big ground plane that you want to solder to. 

As a student attending University far from home, I found that it was impractical to uninstall my soldering station from my workbench to bring it back and forth when I visit home. I decided that it was best to get a new one, or better yet, build a new one.

 

Design

As I designed the soldering station, I had a few key qualities in my mind.

  • Portability – This is achieved by using an SMPS (Switched - Mode Power Supply) instead of a regular transformer and rectifier bridge.
  • Simple design – I didn’t want any LCDs, unnecessary LEDs, or buttons. I just wanted an LED segment display to show me the set and current temperature. I also wanted a simple knob to select the temperature (potentiometer) and no pot for adjusting the accuracy since it can easily be done by software.
  • Universal – I used a standard aviator’s 5 pin plug (some type of DIN) so that it is compatible with Hakko soldering irons and its tips.

The best way to temperature control a soldering iron is, in my opinion, using a microcontroller as a PID (proportional–integral–derivative) controller. It's very likely that you've heard of PID before, for example, 3D printers use it to set the hot end temperature. The principle is not new, as it can be used for anything that requires automatic adjustment and is widely used in the industry. Even your digital thermostat at home uses this type of controller. 

 

How it Works

Schematic

 

First of all, let’s talk about the PID. To explain it bluntly, let’s take our particular case here with the soldering station. The system is constantly monitoring the error, which is the difference between the set point (in our case, the temperature that we want and our current temperature). It adjusts the output of the microcontroller which controls the heater via PWM based on the following formula: 

 

.

 

As we can see, there are three parameters Kp, Ki, Kd. The Kp parameter is proportional to the error at the present time. The Ki parameter accounts for errors that have accumulated over time. The Kd parameter is a prediction of future error. In our setup, we are using Brett Beauregard’s PID library for adaptive tuning which has two sets of parameters: aggressive and conservative. When the current temperature is far from the set point, the controller uses aggressive parameters, otherwise, it uses the conservative ones. This allows us to have a low heat up time while still achieving precision.

Here is the schematic. It uses an 8-bit microcontroller ATMEGA8 in DIP (you can use an ATMEGA168-328 if you have one of those laying around) which is very common and the 328 variant is found in Arduino UNO. I chose it because it's very simple to program using the Arduino IDE, which also has some good libraries that are ready to go.

The temperature is read by the thermocouple that's built into the soldering iron. We amplify the voltage generated by the thermocouple by about 120 times using an op-amp because of the thermoelectric effect. The output is connected to the ADC0 pin of the microcontroller that turns the voltage into a value between 0 and 1023.

The set point is given by the potentiometer that's used as a voltage divider. It's connected to the ADC1 pin of the ATMEGA8. The range 0-5V (pot output) is changed to 0-1023 by the ADC and again to 0-350 degrees Celsius by the function “map”. 

 

Bill of Materials

ReferenceValueCount
IC1ATMEGA8-P1
U1LM3581
Q1IRF540N1
R4120k1
R6;R31k2
R5;R110k2
C3;C4;C7100nF3
Y116MHz1
C1;C222pF2
R21001
U2LM78051
C5;C6100uF (can be lower)2
R7;R8;R9;R10;R11;R12;R13;R141508

Here is the bill of materials exported from the Kicad. In addition, you will need: 

  • Soldering iron Hakko clone, the most popular are on eBay and Chinese websites (with thermocouple, not thermistor) 
  • 24V 2A power supply (I recommend SMPS, but you can use a transformer with a rectifier bridge)
  • 10k potentiometer
  • Electrical aviation style plug with 5 pins
  • Panel mounted electrical connector
  • PCB
  • Power switch
  • 2.54mm pin headers
  • Lots of wires
  • Dupont connectors
  • Case (I 3D printed mine)
  • One triple LED array display
  • AVR ISP programmer (you can use your Arduino for this).

Of course, you can easily substitute the LED array with an LCD or use buttons instead of a potentiometer, after all, it’s your soldering station. I stated my design choices, but you can do it however you want it. If you need help with your code or if you are changing components, leave a comment and I will help you!

 

Build Instructions

 

First, you have to make the PCB. Use whichever method you prefer, I recommend toner transfer as it’s the easiest way. Also, my PCB is longer because I wanted it to be the size of the SMPS so I can put one on top of the other. Feel free to modify it, you can download the files and edit them with Kicad. After that, solder all the parts to the PCB.

Make sure to put a switch between the power supply and the power connector. Use relatively thick wires for the mains as well as the connection between the power supply and the PCB, as well as between the MOSFET output (H on PCB) and the ground wire for output. To wire the potentiometer, connect the 1st pin to 5V, the 2nd pin to POT, and the 3rd pin to the ground. All of the connections you need are on the PCB. For the LED array, take note that I used a common anode, but yours may be different. You will have to modify the code a bit, but the instructions are commented in the sketch. Connect pins E1-E3 to the common anodes/cathodes and pins a-dp to the corresponding pins on your array. You should consult the datasheet for it. Finally, mount the plug for the soldering station and solder the connections. The picture with the schematic should help you here. 

Now comes the fun part, uploading the code. You will need the PID library to do this. If you have an AVR ISP programmer, you know what you need to do. Connect the +5v, Ground and MISO, MOSI, SCK and RESET pins, download the Arduino sketch, open it (you need to have Arduino IDE installed on your computer) and click upload.

If you don’t have one, you can use your Arduino for this. Connect your Arduino (UNO/NANO) to the PC, go to file -> examples -> ArduinoISP and upload that. Then go to tools -> programmer  -> Arduino as ISP. Connect as below (PICTURE) and then download the Arduino sketch, open it and click Sketch -> Upload using Programmer.

ATTENTION! If you are using like me, an ATMEGA8 instead of the 168/328 and your Arduino version is greater than 1.6.0 you need to follow these instructions

That’s it. You can now enjoy your soldering station, built with your own skillful hands. 

 

 

Calibration

I lied, that’s not it. We need to calibrate it now. Since the heaters and the thermocouples inside have variations, especially if you don’t use an original Hakko soldering iron, we need to calibrate it.

First, you need a digital multimeter with a thermocouple to measure the tip temperature, although the best way to do this is to buy a tip thermometer (eBay has some fake Hakko ones that should be sufficient). After you measured the temperature, you need to adjust the default “510” value in this line in the code : map(Input, 0, 510, 25, 350) using this formula:

 

  

 

where TempRead is the temperature that appears on your digital thermometer and TempSet is the temperature that you have set on your soldering station This is just an approximate adjustment, but should be sufficient, you do not need extreme precision for soldering. I used Celsius because this is what it is usually used in electronics, but you can change to Fahrenheit in the code if you would like.

 

3D Printed Case (optional)

I designed and printed myself a case because I can stack the SMPS and PCB to be nice and tidy. Unfortunately, for you to use this case, you would need to find the exact type of SMPS. If you do have one and want to build it or if you want to modify it to your needs, you can download the files. I printed mine at 20% infill, 0.3 layer height. You can use higher infill and smaller layer height if you have the time and patience. 

 

Conclusion

There are still a lot of things that can be improved, like using a specialized thermocouple IC with cold junction compensation. If you have any suggestions, want any new features, or you just have problems during your build, please leave a comment.

I’ll leave you to thoroughly read the instructions again; find your parts and build the thing. I wish you burn-free soldering!

 

 

  Download Code  


Comments

35 Comments


  • spyglass 2016-05-20

    hi
    why do you have 2 versions of the code ?

    • Cezar Chirila 2016-05-20

      Hello spyglass. Sorry for that, It is fixed now.
      It was actually the same code, only the second one had more comments to explain some lines better. Please tell me if you have any further questions.

      • spyglass 2016-05-20

        Hi
        Does q1 mosfet require heatsink ?

  • spyglass 2016-05-20

    HI
    does lm7805 or q1 require heat sinks ?

    • Cezar Chirila 2016-05-21

      Hello
      They do not require a heatsink. Q1 has a low rDS on. If you want you can put a small heatsink on lm7805 especially when using a 24v power supply.

      • spyglass 2016-06-27

        Hi Cezar
        Is D1 the left digit or right ?

  • grahamed 2016-06-24

    Hi

    Many Hakko irons use thermistor not thermocouple

    • Cezar Chirila 2016-06-24

      Hello!

      In the Bill of Materials I was referring to the Hakko clone irons, not the original ones. Over the years I have bought about 5 or 6 of these, each time from diferent vendor, and all of them had thermocouple.

  • spyglass 2016-06-27

    Hi Cezar
    Do you have the code to use it 2x16 lcd display instead of 7 segment display ?

    • Cezar Chirila 2016-06-28

      I do not have the code, but it shouldn’t be too hard to implement.
      Put this in the beggining :

      // include the library code:
      #include <LiquidCrystal.h>

      // initialize the library with the numbers of the interface pins
      LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

      In the void setup add this :

        // set up the LCD’s number of columns and rows:
        lcd.begin(16, 2);

      And in the void main function change this :

      show(temperature);

      into this :

      lcd.setCursor(0, 1);
      lcd.print(temperature);

  • spyglass 2016-06-28

    Hi Cezar

    is Enable 1 the left or right digit ?

    • Cezar Chirila 2016-06-28

      I think that Enable 1 is the right digit, but I am not 100% certain. You can easily reverse the connector or just reverse it in software if it isn’t right.

  • spyglass 2016-07-04

    Hi
    What is the value of the pot ?

  • micvee 2016-07-12

    Bonehead question, I’m sure, but what wattage did you use for your resistors?

    • Cezar Chirila 2016-07-13

      Hello Micvee!
      I think I use some 1/4 and 1/2 because it was what I had available. You are safe to use 1/4W for all if you wish.

  • sencer 2016-07-31

    hey. nice project. I’m currently trying to build this one. But the temperature circuit is not working with me? When I plug the thermocouple I always get a stable “0” on the analogread regardless what the temperature is. But when I unplug the value changes between 760-770. I’m using Lm358N and I’ve checked the circuit several times. Any help with that ??

    • Cezar Chirila 2016-07-31

      Hello!
      First, make sure your power supply connections to the Op-Amp are correct. Then make sure the thermocouple is plugged in right, it has a polarity.
      A picture would help a lot.

      • Cezar Chirila 2016-07-31

        Also it is ok to get a stable 0 when the temperature on the tip of the thermocouple is the same as that on the connection to the op-amp.

      • sencer 2016-07-31

        Umm. I checked again, not working. I mean the thermocouple’s resistance is about 120 ohms at 250-300 C degrees.at 25 C it is about 50 ohms. Now I am testing this iron unplugged(heater). Do I have to plug the heater and then check it. But another design with the thermocouple is working. So I really need help. How can I send some photos. Thanks

    • Cezar Chirila 2016-07-31

      Unfortunately You do not have a thermocouple, but a thermistor. The thermocouple generates voltage (a few mV), a thermistor changes its resistance according to temperature.
      Here is a table : http://s15.postimg.org/pslo7mlmz/Hakko936_Temperature_Curve.jpg
      Also, look here for how to use the thermocouple : http://playground.arduino.cc/ComponentLib/Thermistor2

      In the schematic, just change the resistor value (10k) with a 51 ohm one that measures as close as possible to your thermistor (resistors have tolerance).

      • sencer 2016-07-31

        Thanks. It is working better. Need few adjusting but overall good. Last thing: How did you calculated the “51ohm” resistor. Can you send the formula? Thanks.

    • Cezar Chirila 2016-07-31

      In order for that code to work “out of the box” u need to use a resistor with a value equal to that of the thermistor at room temperature, which you said it was 50ohm (confirmed by that graph). You can also make your own function using arduino map(), but this will be linear.

  • 4759Sy 2016-08-01

    Hy
    Icanont open skema eith eagle?what the solve problem?
    Thank?

    • Cezar Chirila 2016-08-02

      Hi 475Sy!
      You need to use KiCAD. It is Open Source, give it a shot.

      • 4759Sy 2016-08-03

        Hy. I was download kicad .but the andruino can not komplier.this mesage .exit status 1
        Error compiling for board andruino uno. Iam sory ism newbe

    • Cezar Chirila 2016-08-03

      Did you install the PID library?

      • 4759Sy 2016-08-05

        Hy.iam yesterday not yet instal pid library.it is ok now.i has instal.but i am has problem again.i use prosteus 8 and use arduino uno and i try simulation.why its 3digit not same wit temperatur thermo couple input?can7segmet replace wint lcd 16*2?thecode firm ware ?
        Thanks before .iam new in mikrokontroler

    • Cezar Chirila 2016-08-25

      Please check the above comments for code to use with 1602 LCD.

  • monkeysass_half 2016-08-29

    Is there a preferred or recommended method to change the code to display Fahrenheit? Instinct tells me to write the conversion into the temp loop but experience (or the lack thereof)  tells me there’s a less messy way. Any advice?

    • Cezar Chirila 2016-08-29

      I think the easiest way to do it is to change line #77 to “show(temperature * 9 / 5 + 32);”.

      • Cezar Chirila 2016-08-29

        The most correct way to do this is to use Fahrenheit from the beginning, at the map function. If you use the above easy way, your will have a greater error, because it rounds twice. Once for the float to integer, second for the celsius to Fahrenheit. In the worse case scenario you loose 0.49 + 0.49 = 0.98 degree Celsius as opposed to a 0.49 Fahrenheit loss.. 
        You should be more preoccupied with the calibration, in my opinion.

  • monkeysass_half 2016-08-29

    Thank you for your quick reply. Your tutelage proved to be reliable as far as my being able to calibrate my tip to within a few degrees Centigrade of what my Fluke 51 Digital Thermometer displays. Results that I am very happy with and are likely more accurate than I am able to measure.
    My inquiry was the first step toward my inclusion of a switch that will (hopefully) change my LED array to display either scale as well as LEDs to indicate which scale is currently in use. Not imperative by any means but, more of a “bells and whistles” feature that presents another challenge with which I hope to hone my skills even further. The extra “ooh’s” and “aah’s” from the guys at work when they see that part of it will serve as a well executed shoulder rub for my ego, as well. wink
    My part was merely the execution and I would not benefit or enjoy taking credit for YOUR hard work on this project for which I would like to express a heart-felt “thank you” for sharing it. It is my intention to recognize you as the creator and designer to everyone I share it with.

    • Cezar Chirila 2016-08-29

      Thank you very much for your comment. I am truly happy to read comments such as yours, knowing that my article helped someone.
      Congratulations on the build, you deserve all the credit for YOUR hard work, my article was just an inspiration. Keep on tinkering.
      PS. If you have any trouble with the state of the scale feel free to comment here and I will help you. (A boolean that changes it’s value on the press of a momentary switch and an if statement should do the trick)

  • milimod 2016-10-18

    Hi Cezar

    Please put the source code For software BASCOM-AVR or CodeVisionAVR.