Continuing education

PIC projects

Shortwave radio

Broadcast radio

High voltage



Digital Soldering Station Controller

This project owes it's birth to the extraordinarily "nice and warm" summer of 2010. We do have air conditioning but with temperatures hovering in the mid nineties on most days staying indoors doesn't sound appealing. I had acquired two of Weller's 40W pencils. I like them, they make nice robust equipment. This particular pencil is meant to be used with their 40W soldering station. It's nice and slim and fits in just about anywhere soldering may be needed, without accidentally touching anything around it. It's meant to be powered by a 18V RMS step-down transformer, the actual soldering power is PWM controlled. When hot, I measured its resistance to be around 9 Ohm. Additionally, what makes it even more appealing is the fact that it takes a 4mm diameter tip, the kind one can easily obtain from a local Radio Shack. The RS tip is not iron-coated but inexpensive and made of copper. Therefore, it's shape can easily be forged into a finer tip.

To summarize, I have a slim soldering pencil that uses inexpensive copper tips and is powered by 18V or less. What if I use two 12V 2200mAH Li-Po batteries, such as here, connected in series (24V) as a power source and have a microcontroller manage the PWM function? The MCU also looks at the available voltage from the batteries, displays it on the LCD and shuts off the power when the batteries drop below the 3V per cell to avoid damaging them. Last but not least the MCU reads desired tip temperature from the user.

I selected the PIC16F870 as my processor as I had a few left over from previous work. This one has one PWM channel and several pins that can be configured for analog input, needed for measuring the battery. Since code is already needed to fire up its internal ADC, I figured it's easier if I used a potentiometer as a user input device. Most commercial stations use a rotary encoder, but I had a 2.2K potentiometer with a switch in my junk box.

After a little pondering the circuit came together, please see below. For this project I used 2X16 dot-matrix LCD panel, which I believe was "liberated" from an old junked Epson fax. I'm using it in 4-wire mode and it goes on PORTB. There are two 3-terminal voltage regulators in the circuit. The first one, LM7808 takes the full input down to 8V which powers the MOSFET buffer. I could have connected the gate directly to the PIC output but in my opinion this is not a good engineering practice. The MOSFET needs to pass the full ~2.7 amps when both batteries are freshly charged and due to its large internal capacitances voltage spikes present at the moment of switching may find their way into MCU and cause havoc. Moreover, there is also the danger that if or when the MOSFET - for whatever reason decides to leave this world, the full battery voltage will fall on the unfortunate PIC and take it with it. A buffer is required between the PIC's output pin and the MOSFET gate. There are commercial chips available, designed specifically for that purpose but I didn't have them. Also, since the PWM period using standard color burst 3.57MHz crystal came to a lowly 220 Hz, implementing the buffer on all discrete components presented no special problems. I happened to have a few PHP55N03 MOSFETS's in my junk box, these are logic-level, which came from a consumer-grade "recycled" UPS and are meant to be gated by a 5V signal. However in the interest of project reusability I decided to employ a type of buffer that can dish out higher gate signal when needed. It's essentially an amplified emitter follower where both transistors never reach saturation which makes the entire buffer fast acting. Typically there is a PNP transistor and a Schottky diode in place of the 620 Ohm resistor. Here the speed wasn't all that important and I left the resistor in place. Also, when the power is disconnected from the PIC, the gate of the MOSFET is kept grounded and only leakage current is present. PORTA input 0 reads the pot and input 1 connects to the battery measurement circuit. The PIC can only measure voltages between 0V and 5V, while the fully charged battery can reach 25V. In the interest of maximum resolution, the voltage swing signal has to be as large as possible. Therefore, I resolved these demands in a bit of unorthodox manner. Assuming a fresh battery voltage of 25V and a fully depleted 18V, the result would be a swing of 7V. First, the TL431 (programmable shunt reference) subtracts 15.5V from it. Second, the R8, R9 voltage divider divides the remaining voltage by 2, resulting in 1.25V to 4.75V swing at AN1. Trimpot R7 assures that even with component values +/- 10% this is achievable.

Since the PIC's VDD is also the reference for its ADC, select U3 output as closely to 5V as possible. I used an LP2950 LDO regulator here, in a TO-92 case. Q4 switches on the buzzer when the battery is measured to be depleted. This is in addition to displaying the results on the LCD and turning off power to the pencil.

When experimenting with assembled circuit, I found that it was absolutely necessary to place a freewheeling diode parallel to the load (the pencil). I did not measure its inductance, but it seemed substantial. Without the diode there is the risk of exceeding MOSFET's allowable voltage. No components were damaged while building this circuit, but "precautionary measures are the better part of valor" as the saying goes.

In acknowledgement of my projects being “ongoing”, I decided to include an ICP in the circuit. The HEX for the PIC16F870 is here. Should you, the reader, wish to write your own code, I encourage you to do so – but please forward me a copy!!! I hope you enjoyed building my digitally controlled soldering station.

My homebrew soldering set complete with a roll of Kester 60/40 0.031" solder and Radio Shack flux.

Even though it somewhat complicated the box construction, I decided to mount the LCD at an angle in order to better see what's going on.

Turned on and ready to go. Be careful, it's hot!

A closeup of the display. Since I had a 2x16 LCD display, I opted for the battery voltage to be shown on the top row.

To view the inside, I have taken the top lid off. The plywood is vertically split into two compartments, the top portion houses all the electronics and the bottom one batteries. Since I intended this to be a one of a kind prototype, I didn't bother making a PCB for it. All components are soldered onto a small breadboard. I was asked why I didn't use a heatsink on the switching MOSFET. Well, even when the batteries are freshly charged and the temp control cranked all the way up, the transistor only passes ~3A of current, the MOSFET doesn't even get warm - so I didn't use a heatsink.

The box viewed from the bottom. Unfortunately I'm not perfect so the box came out a little crooked. It doesn't lay totally flat and rocks just a tiny amount. Also the four screws protrude a little and I stand a chance of scratching a table. The remedy for these was to glue on four rubber legs. Now its 100% and safe.


Happy soldering... de Brian, perhaps in Central Park.