As I get more serious into my electronics hobby, I need to work with more SMD components. Some component packages are very difficult or impossible to solder with a traditional soldering iron. To solve this problem, I decided to hack a toaster oven to become a reflow soldering oven.
Basically, to perform reflow soldering, solder paste is placed on a printed circuit board, and the components to be soldered is placed on top of the solder paste. When the oven heats the solder paste past the melting temperature, the solder paste melts and solders the component to the circuit board.
To control the oven's temperature, I created my own reflow toaster oven controller circuit. This circuit uses an ATmega32U4 microcontroller to monitor the oven's temperature using a thermocouple and AD595AQ, and then control the oven's heating element using a solid state relay. The controller features USB logging/debugging, USB bootloading, a graphic LCD display, and 3 buttons. The firmware features tweaking for all settings, manual temperature control, manual heating element control, and automatic temperature profile control (with a nice temperature history graph display). This circuit will plug into a wall outlet, and the oven will plug into this circuit, while the solid state relay basically acts as a switch between the wall outlet and the oven's heating element. Safety is the main design objective (but some things were limited by cost), and ease of use is the second objective.
Here is a demonstration video:
Some more key features:
Included here (see bottom of this step) are all of the project files. This package contains the CadSoft EAGLE 5.11 schematic and PCB files, the PCB gerber files, the source code for the microcontroller firmware (including the bootloader), and some mechanical drawings for the heat sink and plastic shielding.
Step 1: Before You Begin
There are several videos in this Instructable. Please watch them in full screen and 720p resolution, because there will be some text that you might want to read. The text content of this Instructable will also include additional notes and links. Most images from the videos will also be uploaded into the gallery. Most images (there are over 150 images in this Instructable) are annoted and sized in such a way that they do not suffer from image compression. The pictures, text, images, and files may not match exactly due to having revisions and different versions, but I'll guarantee that the text and files are in their final versions. I usually learn something new with every one of my projects and I put the important stuff in a final thoughts page and appendix at the end.
Safety NotesThis is probably the most dangerous electronics project I've done to date, involving high voltages and fire hazards. I am not responsible for your safety, and I am not liable for any claims, damages, or other liability. Do this project at your own risk.
Step 2: Reflow Soldering Basics
To understand why I need something to precisely control the ovens temperature, you need to understand the stages of reflow soldering. See the graphs in the gallery for a general overview. This kind of graph, sometimes known as a reflow profile, is found in many datasheets so you can solder electrical components safely.
First, please realize that kitchen toaster ovens are terrible at keeping a certain temperature on their own, but it's good enough for cooking. You can't just count on using the temperature dial on the toaster.
Second, remember that heat expands materials and cold contracts materials. Heating too fast or cooling too fast can cause cracks. Uneven temperature distribution can cause things to bend or warp. You don't want things to break, and things that are bent won't solder properly due to poor contact.
Solder paste is generally a mixture of flux and microscopic balls of solder. The flux will clean the soldering surfaces when it is heated, and the balls of solder will melt and bond the surfaces.
When doing reflow soldering, you put some solder paste over the pads on the PCB. To make this easier, you can use a stencil made of a thin sheet of plastic, with holes laser-cut into it where you want solder paste (I will cover how to make and use stencils later). Place the components on the pads, then pop it in the oven and let it go through the stages.
This is why I need a controller to control the temperature of the oven automatically, going through all the stages at the right temperature, for the right time duration, and at the right heating or cooling rate.
Step 3: Circuit Design and PCB Layout
Please watch the video as I explain how I designed the circuit. I will point out each component, show you where it is, and explain it in detail.
The design files are all included in the project downloads, it's mostly in CadSoft EAGLE 5.11 format, but I've included images as well.
The PCB layout isn't a complicated layout. There are some things I'd like to point out:
Step 4: Circuit Assembly Part 1
Show All 11 Items
Here's a shopping list for electrical components:
Qty Sch Ref Name Value Package Rating Notes 1 C3 Tantalum Capacitor 10 uF 1206 6V or Greater 4 C4, C5, C6, C7 Ceramic Capacitor 0.1 uF 0805 or 0603 6V or Greater 2 C8, C9 Ceramic Capacitor 22 pF 0805 or 0603 6V or Greater 1 C10 Aluminum Caoacitor 47 uF or greater 6.6mm x 6.6mm 6V or Greater 1 C11 Tantalum Capacitor 4.7 uF 1206 6V or Greater 10 C1, C2, C12 to C20 Ceramic Capacitor 1 uF 0805 or 0603 6V or Greater 1 IC1 LM1117 3.3V SOT-223 1 JP1 Male Header 3x2 0.1" Pitch Standard 6 Pin ISP Header for AVR 1 JP2 Screw Terminal 2 Pins, SparkFun PRT-08084 3.5mm Pitch For thermocouple 1 Q1 Crystal 16 MHz HC49 SMD 20 pF, +/- 30 PPM 2 R1, R2 Chip Resistor 22 Ω 0805 or 0603 1/10 W, +/- 10% 4 R3, R4, R7, R8 Chip Resistor 10 kΩ 0805 or 0603 1/10 W, +/- 10% 1 R6 Chip Resistor 330 Ω 0805 or 0603 1/10 W, +/- 10% 2 S1, S2 Button Switch TL3330 3 S3, S4, S5 Button Switch TL6120DF Must be super tall 1 USB USB Mini-B Female Connector UX60A-MB-5ST SMD My favorite, easy to solder, flat bottom 1 LCD LCD COG Graphic Display NHD-C160100DiZ 160x100 Pixel 1 LCD FPC Connector A100284CT, 1-1734592-4 14 Pos, 0,5mm Pitch,
Right Angle SMD 1 U1 AVR Microcontroller ATMega32U4-AU 44 TQFP 1 U2 Thermocouple Amplifier AD595AQ 14 DIP 1 U2 Chip Socket 14 Pins 14 DIP 1 Relay Solid State Relay D2425 by Crydom 240 VAC, 25 A 1 JP2 Thermocouple,
type K GK11M,
by Test Products Int -40 to 510 °C 1 USB Wall Charger 120V or 240V AC to 5 V DC, 1000 mA Used as wall AC to 5V DC converter 1 Cooling Fan 5V DC 40mm x 40mm,
10mm to 17mm thick 1 AC Extension Cord 16 AWG or Thicker 300V
Solder these components to the PCB, follow the PCB design.
To get a PCB, download the project files, and send the Gerber files to a PCB manufacture. I used Seeed Studio 's Fusion PCB Service, it'll cost you $29 for 10 pieces.
Most components are 0805 (but can be substituted with 0603), everything on the PCB can be hand soldered. Surface mount soldering is easy, as demonstrated in my video:
There are several special connections you need to make, see the diagrams in the gallery about the following:
You need to put a lot of solder onto the wide exposed AC tracks so it can handle the large amount of electrical current.
Clean the PCB using alcohol or flux cleaner. Leaving flux on the PCB might cause inaccurate readings from the AD595AQ.
The schematic has some notes on it, I hope you read them.
Step 5: USB Wall Charger Hack
Show All 13 Items
Find the USB wall charger I used. It has to be small, works with 120V AC and 240V AC (so it works in both North America and other places), and supplies 5V DC at 1000mA.
Cut it open, I used a saw to cut off the two ends.
Unfolded it. Soldered two wires for the AC power input (polarity doesn't matter, so I used two black wires). Solder another two wires to the USB port where the 5V DC output and DC ground is, I used a black wire for ground and red for 5V since polarity is important here.
I suggest you use 22 gauge stranded wire for all of this. 24 gauge is acceptable. Stranded wire is flexible.
Insulate the entire device. I used electrical tape for this. A huge heat shrink tube would also be acceptable.
Connect your new wires to the appropriate locations on the controller PCB, as shown in my diagrams.
Step 6: Thermocouple Modification
You can avoid this step if your thermocouple does not have any special connectors on the end. Try buying the K type thermocouple from Adafruit Industries (product ID 270), or SparkFun version (SEN-00251). The one I used is a GK11M from Test Products Int.
The thermocouple I used has a special plug. Nobody sells the actual socket for this plug (it's really designed for a specific hand-held device).
So I had to connect some wires to the thermocouple, and then plug the wires into the terminal block.
Remember that polarity is very important here so I used red wire for where there is a plus sign (chromel side) and black wire for the negative sign (alumel side).
Remember to use the same type of wire for both wires. If you use copper for the red wire, you must use the exact same copper for the black wire. It doesn't have to be copper but both wires must be the same material, because different metals would have a small voltage difference that will mess up the voltage readings.
Please read the appendix about how thermocouples work.
Step 7: Heat Sink
Show All 10 Items
The manufacture for this solid state relay actually sells the appropriate heat sinks designed specifically for their relays, they are somewhat expensive. But I'm a cheapskate DIY loving university student who has access to free scrap metal at school, so I built my own heat sink.
From the datasheet, there is a graph (see in gallery) that shows what the thermal resistance of the heat sink needs to be. I'm going to use 25 degrees C as room ambient temperature, and 15A. If you look at the graph, you might think a 4 C/W heat sink is enough.
Why do I think I can make a heat sink that's suitable? This HS351 heat sink is 3 C/W:
It's just a simple tiny piece of aluminum. I think my heat sink will be just as effective, plus I have a cooling fan. The heat sink I made also makes it easy for the entire circuit to sit on a surface, unlike the small heat sink that you can buy.
During the first test, I used the relay with a 120V AC, 1300 watt toaster oven, in a basement room that's at about 18 degrees C, at maximum power output for 20 minutes. The temperature of the relay and heat sink was measured using an infrared temperature measuring gun and it never reached over 30 degrees Celcius. This shows my heat sink is sufficient.
Enough Rambling, How to Build the Heat Sink:
Step 8: Final Circuit Assembly
Look at the diagrams while doing the next few steps.
Now you can screw the relay into the bottom side of the PCB, the relay should have come with the screws you need already. Check the orientation of the relay, but the hole spacing is slightly different on each side so it's not really possible to screw it in backwards.
Solder the fan's wires to the PCB, watch your polarity. (I didn't have any connectors, but if you want, use a polarized Molex or JST connector for this)
Solder the modified USB charger's wires to the PCB, watch your polarity. (I didn't have any connectors, but if you want, use a polarized Molex or JST connector for this)
Use a flux cleaner to clean the flux off the PCB. I have this spray can that is absolutely magical at this job. I've discovered that the flux actually affects the thermocouple readings greatly so cleaning it is important.
Tuck away anything that is loose, and secure it. I tucked everything under the PCB and secured it down with electrical tape.
Step 9: Programming and Using the Bootloader
Please watch this video, where I show you how to compile the bootloader, how to flash the bootloader into the microcontroller, how to use the bootloader, and how to install the driver you need.
To actually do any of the things in the video, you need to have a working GNU tool chain setup. Follow some of these general AVR tutorials, which should get you started:
Step 10: Firmware
All of the source code are included in this project's download files. They are completely commented.
The code is composed of several components:
There are some major details I need to point out here:
Refer to the previous "Instructable Step" about the bootloader to see how to compile and bootload the application code, there is even a video in there.
Step 11: Plastic Shield
Please see the mechanical drawings in the project downloads. Cut a sheet of 2mm thick acrylic (cheaper) or polycarbonate (stronger) to the square shape and drill the appropriate holes.
Note that the picture is missing a hole that exists in the drawing. That hole is so you can access the screw terminals.
I hot glued some 0.25" long #8 machine screws to the buttons so they will stick out over the plastic shield.
Before you attach the sheet of plastic over the PCB, you need to program the AVR microcontroller first, that's actually in another "Instructable Step". When you finish that, use 1" long #4 machine screws and nuts to attach the plastic shield to the PCB. (I didn't have any stand-offs, use stand-offs if you want)
This will go over the PCB and protect it from things falling onto it, and protect your fingers from the uninsulated areas on the PCB. But if you actually tried to stick your finger under there, you can still get hurt. Keep this thing away from people who don't understand it.
This step comes after all of the software tasks, because it's not possible to use the ISP header if the plastic cover was on.
Step 12: Toaster Oven Modification
Show All 10 Items
You need to modify a toaster oven. The goal of the modification is to connect the top and bottom heating elements directly to the AC power cord, instead of the toaster oven's own control dials. Please watch this video presentation where I show you how to perform this modification in a safe manner.
To summarize my steps:
I want to repeat my safetly notes:
Further performance enhancing modifications were made after testing, which are discussed later.
Step 13: Menu Usage
Watch this video where I show you how to use the menu (warning: kind of boring)
There are three buttons, the top button is used as "select" or "add", the middle button is used as "next menu item" or "exit current mode", the bottom button is used as "subtract".
The main menu offers 4 options:
The screen refresh rate is slow, keep that in mind, you might need to hold down the button for a second before it responds.
Step 14: Testing, Tuning, Logging
Show All 7 Items
In the following video, I show you how I test my circuit, how to log the temperature data during the testing, and how to use this data to configure the settings.
Notes I Made During First Test
From this serial port, data is sent in comma-seperated-value format. You can use a serial terminal to log this data into a .csv file and then open it in a spreadsheet program. Remember that raw ADC readings must be multiplied by 0.32 to convert it to degrees Celcius, and PWM OCR values are between 0 and 65535.
In "manual temperature control" mode, the text you see will look like
1, 234, 567, 559,
2, 237, 567, 564,
3, 232, 567, 536,
4, 235, 567, 524,
The format is
time in seconds, raw ADC reading, target ADC reading, PWM OCR value
In "manual PWM control" mode, the text you see will look like
1, 567, 559,
2, 567, 564,
3, 567, 536,
4, 567, 524,
The format is
time in seconds, raw adc reading, PWM OCR value,
Note: Use this mode to measure the highest temperature you can achieve and how long it takes to achieve it.
In "auto" mode, the text you see will look like
0, 1, 567, 559, 524,
0, 2, 567, 564, 559,
1, 3, 524, 559, 559,
1, 4, 567, 524, 564,
1, 5, 564, 559, 559,
1, 6, 567, 564, 524,
2, 7, 567, 559, 559,
2, 8, 567, 559, 564,
2, 9, 564, 559, 559,
3, 10, 567, 559, 559,
3, 11, 564, 559, 564,
The format is
stage number, total time in seconds, raw ADC reading, target raw ADC reading, PWM OCR value,
time doesn't reset if the stage changes
TweakingRun through the auto mode a few times to test it, remember to save the log data to help you. If it doesn't keep the temperature steady or heat/cool at an unsteady rate, then adjust the PID constants from the "edit settings" submenu.
If the temperature tends to rise too fast, then lower the P constant. If the temperature doesn't rise fast enough, then raise the P constant.
Adjusting the I and D constant will affect overshooting or oscillating behaviour. This takes experimentation.
If all else fails, try to just turn up the P constant up really high and set I and D to 0, this will effectively stop the software from using PWM and just turn on the relay if the measured temperature is below the desired temperature.
Test RunAfter tuning and performance optimization, you should run the "auto mode" reflow cycle just to see what the temperature curve looks like. I did this with a junk PCB populated with a single resistor just as a test. In the pictures, you can see I didn't do the cleanest job because I applied the paste with the syringe tip directly without a stencil. But the solder did melt and the component is soldered in place perfectly.
Step 15: Performance Improvements
The very first test showed that the temperature reached 225 degrees Celcius in 520 seconds, and 260 degrees Celcius in 900 seconds. This is a little too slow.
I then raised the rack about 1.5" closer to the top heating element, and sealed most of the holes and tiny seams inside the oven using aluminium tape. This isn't the smartest idea since I had no idea what temperature the adhesive can withstand, but it seems to be OK.
After these changes, the temperature reached 225 degrees Celcius in 360 seconds, and 260 degrees Celcius in 570 seconds.
Then I applied a layer of aluminium tape to the front glass door, covering the bottom 2/3 of the glass door. I then performed another test: 225 degrees Celcius in 320 seconds, and 275 in 560 seconds.
This is just fast enough for reflow soldering according to the temperature timeline that I am following, but more improvements would need to be made.
I stuffed the inside of the oven with a layer of pink fiberglass insulation. This stuff is not electrically conductive and can handle a temperature of 500 degrees Celcius. It is safe for use in my situation.
I also found a large brick to place in the oven. The purpose of the brick is to occupy volume so there is less air inside the oven to heat. The brick is covered with aluminium foil to stop it from absorbing heat too fast. This brick actually did not get very hot, it is actually cooler than the surface of the glass door. It does its job exactly as I expected it to.
I am very happy with the final results: 225 degrees Celcius in 300 seconds, and 275 degrees in 540 seconds. I can reach the end of the "soak" stage in just 3.5 minutes.
Step 16: Solder Paste Stencil
Here is a video showing you how to generate a Gerber file that you can use to create a solder paste stencil using CadSoft EAGLE 5.11
Step 17: Performing Reflow Soldering
Show All 11 Items
Watch the following video presentation, where I show you how to perform reflow soldering:
Here are some other tutorials from other websites:
Summary of Steps:
If you notice that the cooling is too slow, you can open the door just a bit, while watching the LCD display so you don't cool too fast.
After it's finished, take it out of the oven and your circuit should be all soldered.
You need to clean your PCB using alcohol or flux cleaner, unless you are using "no clean" solder paste.
Step 18: Final ThoughtsThe AD595AQ chip is a old chip and it costs $20 each. Newer designs should use a newer and cheaper alternative. Example: MAX31855 or MAX6675
I did find some other relays with similar ratings but the only way they can achieve those ratings is by using a heat sink or with a cooling fan. So I decided the "puck" shaped relay is a great idea since it makes it easy to mount.
A full enclosure would have been the best idea. The plastic shield offers enough protection for me to handle my circuit, but I am still able to be shocked if I tried to stick my finger underneath the plastic.
For the toaster oven I chose, I have to raise the PCB closer to the heating element. See my test results from before. I did this using ceramic tiles or a brick. This lowers the amount of air that needs to be heated as well, which should speed up the rate of heating (adding same amount of energy into less volume). However, solids have more heat capacity than air, which should actually slow down the rate of heating as (it takes in more energy). But since it'll take more time for the solid to suck the energy out of the air, the final effect should still be that it makes the air get hotter faster.
This project can easily be ported to the ATMega328P, which is important if you really want to use an Arduino. Please note that my circuit is running on 3.3V, and although a 16 MHz crystal is used, it's actually running at 8 MHz. I might design an "Arduino Shield" version of my circuit later.
I have seen similar projects using mechanical relays that simply turn on and off the heating element, with the slow reaction time of the heating element, this apparently works well enough.
I am capable of building my own AC to DC converter circuit, but I just don't feel like it's worth the effort for this project. I would have had to squeeze it in the PCB design as well.
The heat sink is not grounded. I did not find any reliable documents that indicates that it is safe to ground the heat sink. It probably is safe to ground it, but you might not be using a grounded extension cord. My toaster oven isn't grounded.
Arduino Leonardo's bootloader (currently in beta as the date of this page) should also work, but I don't want to rewrite a lot of instructions.
This Instructable has so many videos because I'm experimenting with different methods of presentation. I've used computer screen capture, panning around in CadSoft EAGLE with both the schematic and PCB side-by-side, 720p video recordings with my new smartphone, slide shows, and fooled around with video editing a lot. I like using videos to get my thoughts out in the order I want to present in, and then providing a text and picture summary, which I can use to fill in gaps that the videos did not cover.
Step 19: Appendix
PWM Frequency and the Solid State RelayThe solid state relay is built using a TRIAC (or something similar, like two thyristors) because it needs to handle large alternating currents. Remember that we are trying to put 120V AC at 60 Hz (these numbers are North American) through this relay.
Wikipedia on thyristors http://en.wikipedia.org/wiki/Thyristors
omega.com: Solid State Relays (pdf)
Once you trigger a thyristor, it starts to conduct, but it will not stop conducting until the voltage reaches zero.
This also means if you tried to power the heating element with a DC power source, once the relay has been triggered, it will stay on forever. So do not attempt to use a DC power source. (Also, if you did use DC, you would probably fry the USB charger).
The fact that thyristors won't stop conducting will make high frequency PWM ineffective as the PWM duty cycle won't correlate to the power delivered to the heating element. When a pulse from the PWM output ends, it doesn't mean the AC current is turned off.
If a low PWM frequency is used, then you have more control over how much power is being delivered. If the PWM frequency is 1 Hz, PWM duty cycle at 50%, and the AC power is 60 Hz, then you are basically saying "I want to let about 30 out of 60 oscillations through per second". The relay will try to turn it self off 60 times per seconds at regular intervals, unless you keep the input signal high.
The gallery includes a few diagrams that illustrates what I'm saying in terms of voltages and waveforms.
The Crydom solid state relay is actually more complicated because it has special zero-cross triggering. This means the relay will conduct immediantly after the voltage is zero (instead of at any time) and turn off immediantly when the voltage is zero again if the trigger is removed. What I am saying still applies. The output waveform will always start at 0V and end at 0V, which is good for equipment that doesn't like being turned on too fast.
There are special solid state relays that can control the output waveform according to a linear input (and thus, filtered high frequency PWM can be used). But these cost more, and the heating element doesn't react fast enough for this to be useful anyways.
How Thermocouples WorkWikipedia about thermocouples http://en.wikipedia.org/wiki/Thermocouple
Maxim application note 4026 http://www.maxim-ic.com/app-notes/index.mvp/id/4026
I used a K type thermocouple, with the AD595AQ thermocouple amplifier chip. The K type thermocouple is made of a junction between chromel and alumel, where a small voltage is generated proportional to the temperature difference at the junction. The AD595AQ is designed to amplify the small voltage between the chromel and alumel to a voltage that is 10 mV per degrees Celcius. The AD595AQ features "cold junction compensation", which basically it means it can use room temperature as the reference voltage.
Remember how I said you must use the same metal for the wire that connects the thermocouple to the terminal block? For example, using copper, the voltage beween the alumel and copper would be cancelled out by the voltage between the chromel and copper, while the left over voltage would be proportional to the temperature. As another example, if you used copper connected to the chromel and steel to connect the alumel end, then your final voltage reading would be the voltage between the alumel and chromel plus the voltage beween the copper and steel, which is not accurate.