Picture of Closing the Loop on Surface Mount Soldering

Temperature seems like the easiest thing in the world to control. Turn on the stove and set the temperature you want. Switch on the furnace in the morning and set the thermostat. Adjust the hot and cold water to make the shower just right. Easy! But what if you want to control temperature beyond these everyday applications? If you want temperatures outside the normal ranges, or want stable temperature within a narrow range, you’re mostly on your own.

In my case, I wanted to control the temperature of a hot plate used for surface mount soldering. Initially, I used pulse width modulation to provide stable temperatures and experimentally determined settings to create the temperature profile required. You can read all about that in this Instructable. This system works and control of temperature in this manner is all well and good, but it has shortcomings.


  • Works only for my specific hot plate. Others are similar, but not identical and experiments are required to determine the settings and times needed to produce the requited profile.

  • Same situation if I want a different profile or temperature.

  • The soldering process takes a long time since stable temperatures must be approached slowly.

Ideally, we could just specify a temperature- time profile, press a button, and the controller would cause the hot plate to perform as programmed. We know this is possible since there are many industrial processes that use exactly this sort of control. The question is can this be done easily and inexpensively at home?

As you might have guessed, since I’m writing this Instructable, the answer is yes! This Instructable will show you how to build your own industrial-strength temperature controller. I’ll particularly target surface mount soldering, but any process requiring precise time temperature profile can use this system.

Note: When I use the name “Arduino” I mean not just the (not quite) copyrighted Arduino itself, but also the many public domain versions collectively known as “Freeduino”. In some cases I use the term “Ard/Free-duino”, but the terms should be considered interchangable for the purposes of this Instructable.

The temperature control scheme used in the Extreme Surface Mount Soldering Instructable is known as open-loop control. That is, a value that has produced the desired temperature in the past is expected to produce the same temperature when used again. Frequently this is true and produces the desired result. But if conditions are slightly different, say the garage where we’re working is a lot cooler or warmer, then you may not get the expected result.

If we have a sensor that can read the temperature and report it back to a controller, then we have closed-loop control. The controller is able to set an initial value to increase the temperature, look at the temperature as time passes, and adjust the setting to make the temperature go higher or lower until the desired temperature is reached.

Our approach will be to replace the AVRTiny2313-based PWM controller with a more powerful ATMega-based controller. Programming will be done in the Arduino environment. We’ll use a pc (Linux-Mac-Windows) running Processing to display the results and adjust the controller.

For the sensor, we’ll use an Infrared Temperature Sensor from Harbor Freight. The IR sensor will be modified to output the temperature as a serial data stream that the controller can read. We'll use an Ard/Free-duino as the controller, with a PC (Mac – Linux – Windows) for input to the controller. When we’re all done, the system will look like the picture. (You may have less extraneous circuitry on your breadboard however. That's OK.)

mr_man3 months ago

Great job! I'm curious if anyone knows of any products for sale that do this or the equivalent.

mmedonis made it!1 year ago

The Processing sketch puts up the error msg "No Update" in spite of the plot getting updated correctly. Might be due to my USB serial setup, or new version of Processing, haven't dug into it. The graphical plot runs fine, the commands are accepted fine, soldering went smoothly! Awesome Instructable doctek!

doctek (author)  mmedonis1 year ago

Glad you liked it! I have no idea why you get the "No Update". I haven't tried it with the new version of Processing. Glad it all works. Post if you find the cause of the message.

When compiling the IR_PID in Arduino, I get errors about the line #include avr/EEPROM.h in the eeprom file tab. So, then I changed to include but now I get these errors:

eeprom.ino: In function 'float readFloat(int)';
eeprom: 10:65: error : 'eeprom_read_blcok' was not declared in this scope

any ideas what I need to do?

I got this initially as well, with the Teensy and teensyduino stuff installed. I installed a fresh copy of Arduino IDE and it went away. I am using a board with an Arduino bootloader installed on the AVR chippy.

For anyone else looking for the datasheet of the interface to the IR temperature device (link in instructable is dead), I believe it is located here. http://www.zytemp.com/products/files/TNm_302.pdf
doctek (author)  HypervisorX1 year ago
Thanks for the update!
doctek (author) 1 year ago
This is probably due to using a later version of Arduino than I used. I suggest posting the errors to the Arduino forum and asking for help there.
johnnie mac2 years ago
The Harbor Freight link has changed to http://www.harborfreight.com/infrared-thermometer-93984.html
jpnorair3 years ago
I love this project so much. For us stingy embedded prototypers it is game-changing. I've decided to port it to CC430 Chronos... with wireless temperature profile upload and monitoring via OpenTag. Then I'm going to use it to build MORE CC430 boards -- you gotta love machines building machines. See you in a month!
osbock3 years ago
I'm curious. You note 5V on the connector, yet the thermometer runs off 3V batteries. Is there a regulator on board?

Also, in the recent videos, it looks like the thermometer is mounted higher (and has a nicer looking mount! (pictures?) I assume the spot it's looking at is larger, but does it matter much, and if so how?
doctek (author)  osbock3 years ago
Just take the batteries out. 5V powers it without a problem.

You may be looking at someone else's set up. Mine still uses the rubber band. As long as you mount it within 4 to 6 inches (or so), the spot size will be small enough to work fine. Just don't put anything under it but hot plate. I prefer a 4 inch working distance. In practice, this hasn't been an issue.
juggler4 years ago
any troubleshooting advice?
I am unable to get 120vac from the power controller.
The rest appears to be working perfectly. The teensyduino is blinking the power on and off, 120vac is coming into the power controller but no vac is getting out to the load...
Thanks for any advice you have.
doctek (author)  juggler4 years ago
Sounds like your PWM control unit and IR sensor are both working fine! Good job!

Be sure the connections to your AC Control Unit are correct. The green jumper must connect to the same ground as the Teensyduino. The Yellow wire must be on the output. Be sure it is connected on the processor side of the output LED. I'm assuming you've already checked this obvious stuff, so let's go on.

Disconnect the control signal from the Teensyduino. Looking at the pictures, this is the yellow jumper wire. Connect that directly to Vcc (+5V). Be sure the green jumper is connected properly and hooked to ground. This should turn the AC on continuously. If you don't get output, check the wiring of the AC Control Unit. (I assume you built this yourself from the plans in the other Instructable.)

Still no output? Try shorting pins 4 & 6 of the MOC (optoisolator). Still no output? Check your wiring of the AC Control unit carefully. Be sure the diodes and SCRs are installed with the correct polarities.

Let me know what you learn and I'll try to help more.
juggler doctek3 years ago
Thanks for your help.
Sorry it took me so long to get back to this.

Shorting pins 4&6 turned on the 120v. I don't know what that means I did wrong though.

Thanks again
dausmus4 years ago
The link to the Zytemp document that Scott used is no longer correct. The correct new link to his source document is:
http://www.zytemp.com/products/files/TNm_302.pdf It has good info in there.

Nice instructable.
buddhafragt4 years ago
everything is working fine, but I dont understand if it is possible to save a soldering time/temp table.
I can adjust the temp manually, but can I save a profile??

best regards
doctek (author)  buddhafragt4 years ago
Great idea, and you could certainly modify the software to do this. The reason I haven't tried to do that is that the environment (mostly the ambient temperature) changes enough that I would need to correct for it and controlling the process by eye is pretty easy. The type of parts on the board and presence or absence of ground plane makes a difference also. Some sort of sensor of board temperature or solder flow would be needed.
brettn20025 years ago
Very nice instructable!  Well researched & documented.  Could you please post the pinouts for the IR sensor circuit board?  On the board they are labeled "A, G, C, D, and V," but which one is the interrupt, data out, etc.?
My bad!  They're listed in the 2nd photo on step 3.
jeff-o5 years ago
Fantastic work!  I've added this to my list of Things to Build.