Yet another T12 Soldering Station

t12_header.jpgI built one, like 2 years ago, but didn’t have time to write a blog post about it. Up until now when I have to make another one for my friend, I decide it’s time to do documentation about it. It is pretty much straight forward except the T12 tips I bought wasn’t the same that I had before. Then the calibration process begins…

Schematic

I wasn’t using KiCad when I made the first one 2 years ago. I just “drew” the PCB layout using SprintLayout without making a schematic for it. About a year ago, I switched to KiCad to do all the PCB work. So I decide to spend sometime redo the schematic in KiCad. Would be better to have a schematic for reference, isn’t it?.
schematic.png
PDF version T12SolderStation_sch.pdf

The circuit is very much similar to Arduino UNO, which uses the same bootloader as well. UNO has UART baudrate twice as fast as Nano’s. Hence faster when upload sketch.

To be honest, you don’t need to do accurate reading of the T12 tip temperature, 10-20 °C off would just be fine. What you need is to control the temperature up and down at will and have good capability to solder at ground plane. My first solder station was a chinese clone of the Hakko 936. It still works just fine. But sadly, the handpiece of those cheap clones doesn’t have silicone wire. I accidentally burnt a small hole on the wire and had to use electrical tape to seal it. Secondly, the thermal contact between the heater and the tip (900M tip) of these clones is very bad. Hence of bad performance, you need to crank the temperature to pretty high, 350°C at least, just to do ground pin that has large thermal mass.

This is the one I had 5 years ago. I can’t even pronoun the name, HULKKO? HYLKKO or HUKKO? Whatever…

hakko_clone.jpg

There is lack of indication on the front panel, as only one single LED that turns on when power is pumped to the heater otherwise it is off. I forgot to turn it off all the time. I had to make a small timer using ATTiny13 that beeps every 5 minutes to remind me to turn this damn thing off.

The PCB

I am lazy, so I just use the picture that’s exported directly from SprintLayout.

pcb.png
Layout file for SprintLayout6 T12 solder_station_r03.rar

Haven’t done PCB in KiCad yet, again I still am lazy :D

ports.png

I didn’t know what kind of optical sensor I would use at that time so that I left 2 pins A2, A3 exposed directly to the header. I was thinking of slotted optical switch or IR obstacle sensor.

So why the sensor? It is to set the solder station into sleep mode and keep the heater at lower temperature such as 100°C. You don’t need to keep it constantly at, say, 300°C at all times. You know, high temperature speeds up the oxidisation process and destroys the plating at the tip. With the power supply I use, it takes about 3-5 seconds to reach 300°C from 100°C.

slotted_optical_switch.jpg IR_tracking_sensor.jpg IR_obstacle_sensor.jpg

Turned out, I used my own homebrew sensor.

opto_1.jpg opto_2.jpg homemade_opto_sensor.jpg

The T12 solder station clones out there have vibration sensor on the handpiece as mechanism to prevent it going into sleep mode. It’s neat but come on, I don’t want to wave the handpiece around just to wake it up from sleep. So, a microswitch or a slotted opto switch would be better for me.

The homemade sensor is just a pair of IR LED, transmitter and receiver. They are actually IR LED and IR photodiode work as a proximity sensor. You have to hook the photodiode backward as it allows reverse current flow through when it sees IR light. If you hook it like a normal LED, it just conducts like a normal diode.

Too bad if you have the handset with black rubber. Black colour absorbs light which also absorbs IR light. So in this case, you pretty much end up with an amplifier and a comparator attach to the sensor like the the sensors above or use a different solution.

Yeah, I am cheap, so I just stick the sensor to the dock using Blu-Tack.

Power Supply

AC-DC24V4A.jpg

This is the AC-DC converter to get 24V for the heater. It is rate at 24V - 4A 6A. I think the seller means 6A peak. Judging from the wire wound around in the main transformer, I don’t think it will have any issues handling 4A at 24V.

At 24V, the 8 Ohm heater draws 3A from the power supply, which is 72W. My old T2 tip had 4 Ohm heater which demanded 6A from the power supply. Of course there is a small drop from the wire, the MOSFET that reduces the theoretical drawing current a bit but it is kinda neglectable. When to choose PSU, you should pick one that has more head room. For example, your application needs 100W, you should use a 120W PSU at least or 150W PSU to be safe. Especially with everything comes from China. At best they use the max power for rating, but normally, they label their counterfeit product for much higher rating.

The power supply I used actually quite good. It handled my old tip, 4 Ohms, nicely. I want this one because it is small enough to fit into a 3D-printed enclosure. Even after 2 hours using the solder station, it didn’t even get warm. Yes, I had a 10k thermistor to measure the temperature inside the enclosure.

I also need to reduce from 24v to 5v for the logic circuit. A proper way to do this is to use a buck converter then post regulate with a linear LDO. 24V is too high for linear regulator to drop down to 5V. The buck converter will give you high ripple on the voltage output. While linear regulator will give you a lot cleaner voltage output but with the cost of excessive power turn into heat. Basically, if you want 5v from 24v using linear LDO, you have to “waste” 19v into heat. But since I don’t need to measure tip temperature extremely accurately. I just ignore the LDO and be happy with the ripple from the buck converter. That was why I don’t need to use instrumentational opamp for the thermocouple amplifier, just a dirt cheap LMV321 to do the job.

Enclosure

enclosure.png enclosure_2.jpg

Nothing much to say, just a lot of vent slots. It was designed in Fusion 360. I had some idea to employ microswitch instead of opto sensor, but meh, too much work to do. The first one printed in white PLA, looked quite nice actually. I ran out of white PLA this time but cyan PLA also works for me.

Arduino sketch

T12_solderstation.ino.rar

The sketch is about 560 lines long. I custom wrote most of them instead of using library. The only three libraries included are

  • avr/interrupt — for encoder
  • EEPROM — save temperature setting
  • LiquidCrystal — show temperature to character LCD 0802

I don’t use blocking function such as Delay() in the main loop. I use flags to run sub routines in the main loop.

loop()
{
  if (LCD_update)
  {
    //............
  }
  if (Optocheck)
  {
    //............
  }
  if (HeaterUpdate)
  {
    //............
  }

  //.............
}

I have TIMER2 to raise interrupt for every 50ms, that runs some checks at different rate.

/// Setup timer for 20Hz (or 50ms each INT event)
void initTimer()
{
  //initialize timer2
  noInterrupts();           // disable all interrupts
  TCCR2A = 0;
  TCCR2B = 0;
  
  TCNT2 = 1310;            // preload timer 65536-16MHz/256/20Hz
  TCCR2B = TCCR2B & B11111000 | B00000111;    // 30.6Hz
  TIMSK2 |= (1 << TOIE1);   // enable timer overflow interrupt
  interrupts();             // enable all interrupts
}

// Call every 50ms
ISR(TIMER2_OVF_vect)        
{
  TCNT2 = 1310;   // preload counter for 20Hz
  // set some flags to update LCD, run opto check or update heater
  // ....
}

I also have custom code to handle encoder

#define ENCA 3
#define ENCB 2
#define ENCBTN 4
void pciSetup(byte pin)
{
  // custom function just to enable PinChange interrupt on this pin
}
void EncoderSetup()
{
  pciSetup(ENCA);
  pciSetup(ENCB); 
  pciSetup(ENCBTN);
}

ISR (PCINT2_vect) // handle pin change interrupt for D0 to D7 here
{
  // catch the change of ENCA and ENCB to determine which direction of rotation
  // if (CW) => do this
  // if (CCW) => do that
}

And custom PWM output function. Well only for pin D9. Refer to Arduino Timer / PWM cheat sheet to setup on other pins as well.

//setup timer1 for PWM at D9
void initPWM_Tip()
{
  digitalWrite(TIP_PWM, HIGH);
  pinMode(TIP_PWM, OUTPUT);
  TCCR1A = _BV(COM1A1) | _BV(WGM10);  // turn on PWM on D9 only
  TCCR1B = TCCR1B & B11111000 | B00000001;    //31KHz
  OCR1A = 0; // default off
}

// pwm = 0 // turn off
void PWM_TipOut(int pwm)
{
  pwm &= 0xFF; //get only low byte
  OCR1A = (byte)pwm;
}

Well, if you use analogWrite(), you will hear a mono-tone sound at frequency 490 Hz every time it pumps power into the heater.

Since I don’t care much about precision, but I do care about stability, I just do sampling the tip temperature a few times to get more accurate reading.

// Read T12 temp
int16_t read_T12()
{
  // x8 sample
  int32_t T=0;
  for (int8_t i=0;i<8; i++) T += analogRead(TIP_AN);
 
  // For TIP that has 8 OHM heater:
  // T = 0.44*(A0) + 52
  T = ((int32_t)44*T/100) >>3;
  return (int16_t)T + 52;
}

Calibrate new tip

I still remember I bought a “genuine” T12-K Tip (chisel tip) and a knock-off handle for Hakko FX-951 at the time I made the first T12 solder station. The bag of the tip had Hakko logo all over it. I thought it was genuine one. Apparently not! The tip, that was supposed to be “genuine”, had 4 Ohm heater while the info on the internet says T12 tip has 8 Ohm heater. Well, at 24V it could possibly draw (24V^2) / 4R = 144W from the power supply. The problem is not about power hungry heater but the thermocouple in series to it. At that time I lower the real temperature of the heater about 20°C to get feasible reading at low temperature which is inaccurate at high temperature. But meh, didn’t matter if it reported 20°C lower than the actual temperature. I got what I wanted, constant temperature and adjustable.

But this time I need to change the equation to match the knock-off T12 tip that has 8 Ohm heater.

I setup my test bench as follow

test_bench.jpg

I have a K-type sensor and the T12 tip both dip in a cup of vegetable oil. I have my temperature controlled hot plate to heat up the cup. The LCD0802 just show up ADC value (0 - 1023) and the air temperature. So every time I get a round number on the thermocouple meter such as 50, 55, 60, 65… I record the ADC number into excel file and then plot the curve. Add a trendline on the chart to get the equation of the curve. That equation is what I use to calculate from ADC to temperature.

It is easy to spot that at low temperature, the curve is not straight, but around 70°C it starts to get straight.

T12_cali.png

To make it more straight, I just have to remove some data points to get the trendline match to the curve. There, the equation to find temperature. Too easy. No need to do convert ADC to voltage then from voltage to temperature using temperature characteristics of that very thermocouple.

So, I get 8 samples of ADC to compensate to the ripple of power supply, plug that sum of 8 samples into the equation then divide by 8 to get good result.

At the first test run, I forgot to change the variable into suitable name but leave it as “ADC” as seen on the trendline equation. A typical copy and paste job just like this:

int16_t read_T12()
{
  int32_t T=0;
  for (int8_t i=0;i<8; i++) 
    T += analogRead(TIP_AN); // x8 sample
 
  // Following the equation: Temp = 0.44*(ADC) + 52
  T = ((int32_t)44*ADC/100)/8;
  return (int16_t)T + 52;
}

I sum up 8x samples into 32bit number T but forgot to plug that into the equation but “ADC” instead. Turn out, “ADC” is actually a built-in macro or something so it was actually compiled and ran. The result was 8 times smaller. I got 65°C. The real value was 65*8= 520°C. And that 520°C was just the max 10bit ADC value, 1023. The real temperate after about 10s was much more than that. I could see the the tip glowing red which was at least 600°C up to 800°C. I was a bit panic and cut the main power immediately.

Lesson learned: always do “triple” check when copy and paste even if, especially if the compiler doesn’t complaint.

burnt_t12_tip.jpg

Fortunately, that burned tip T12-BL will be the one that I’ll never use. I use mostly T12-K for all application, from SMD to through hole. That T12-BL still works though even it looks beat up with all black oxidisation.

So why solder station instead of cheap solder iron

cheap_iron_240v_heater.png

The cheap solder irons have the tip and the heating element separate from each other. Usually those irons take a minute or two to heat up. That’s ok for hobbyist. But what’s dangerous here with cheap irons is it feeds main AC 240V (in Australia or 220V in most of other countries or 110V in the America) directly to the heater. That kind of design poses hazard of electrocution don’t you think?

adjustable_iron_240v_heater.jpg

The same for some temperature adjustable irons. Since it still feeds 240V AC to the heater. Not recommended.

A better design is the old Hakko solder station that uses 900M tip. It’s heater powered by 24v ac from isolated step down transformer to get 24v from 240v. The heater is coated in ceramic enclosure along with a thermocouple sensor to read temperature. This design has much advantages so that it was like a standard chinese clones must copy. One downside of this design is the tip is separated with the heater which is the bottle neck of the transfer rate of the heat from heater to the tip.

Now solder iron companies improve their technology and put the heating element and the thermocouple inside like the T12 tip. Which is why T12 tip and similar designs are way way better than 900M tip. And of course it isn’t cheap. Up to the time of this blog post, FX951 solder station costs AU$480. The similar design from JBC will cost you over $1000 yankees.

All in all, You can buy a clone T12 tip and a handle for AU$30. Throw in about $50 more for components such as PSU, MOSFET, microcontroller… Write some code and then you’ll have the same functional solder station that cost over AU$400.

Edit:
2020-12-21

I was wrong when I coded the timer for this project. I wanted around 20Hz update rate. Now to think about it, it is impossible with simple code like that. I should have a counter then scale down the update frequency in half or quarter to get exactly 20Hz.

/// Setup timer for 20Hz (or 50ms each INT event)
void initTimer()
{
  //.....
  TCNT2 = 1310;   // same effect as TCNT2 = 30;
  //.....
}

// Call every 50ms <-- wrong timing
ISR(TIMER2_OVF_vect)        
{
  TCNT2 = 1310;   // suppose to be preload counter for 20Hz, but actually it is 34Hz
  // ....
}

The preload value is 1310, which is 0×051E in 16bit hex number. I forgot timer2 is 8bit timer, which it takes only the low byte 0×1E or 30 in decimal. Timer2 ticks 255 times to get 30Hz. If it ticks less than 255 times before overflow, it would run at higher rate, not lower rate as I thought.

The Update rate would be:

f1=1/T1=1/255		or f1=30Hz
f2=1/T2=1/(255-30)	   f2=?Hz

f2 = 30 * [1/225] / [1/255] = 30*255/225 = 34 Hz

The result was a bit higher than I wanted, slightly higher than intended at 20Hz. Anyway, 34 Hz is still good for me. The higher update rate, the smoother it is. But if the update rate is high enough you will be in your own trap which you want to avoid: audio frequency range. That was the reason I had to use custom PWM at 31KHz instead of AnalogWrite(). So the code is still all good. But I feel I need to update the post to clear the mud

 

Add comment

Fill out the form below to add your own comments

User data




Add your comment


[color=red] TEXT [/color]
[quote] TEXT [/quote]
[code=arduino avrasm cpp css java javascript nginx perl python] TEXT [/code]
Clear format