Controlling a Toaster Oven with a PICAXE - Part 2February 05, 2016 by Charles R. Hampton
Soldering surface mount components by hand can be done, but reflow soldering in an oven is much quicker and produces more consistent results. Building a microprocessor controlled reflow oven is well within the abilities and budget of many hobbyists.
Part 1 of this project included a discussion of reflow solder profiles, the four stages of reflow soldering, and a circuit for using a PICAXE microcontroller and a MAX31855 integrated circuit to read and display thermocouple temperature readings. If you missed it, it would be helpful to read it before proceeding with this article.
A small issue with the circuit presented in part 1 is the requirement for a 3.3V power supply plus a slightly higher voltage supply to control the SSR. A solution to that circumstance is presented in the schematic below. A 5V supply is used as the primary supply and the 3.3V for the MAX31855 and the PICAXE-08M2 is derived from U3 (an LP2950ACZ regulator,) plus C4 and C5. As a convenience, an on/off switch (SW1) and a power-on indicator (LED2 and R6) have been added. You may prefer this design to that presented in part 1; they both work well.
In this, the final article in the PICAXE reflow oven project series, the scheme for interconnecting the control circuitry, the SSR (Solid State Relay), and the toaster oven will be presented. In addition, the PICAXE code will be presented and explained, as will a process for fine tuning the code to work with your toaster oven.
One of the objectives of this project is to avoid modifications to the toaster oven whenever possible. However, there is one simple modification that is recommended: drilling a small hole in the rear cover of the oven to allow insertion of the thermocouple. The thermocouple should be located near the center of the oven and slightly above where the top of the PCB will be located, as shown in the photo below.
Alternatively, you could route the thermocouple lead between the oven door and the door opening, but due to interference problems when opening and closing the door, this is not recommended. Of course, the other end of the thermocouple lead is to be connected to the control circuit as discussed in part 1 of this project.
Note that the thermocouple is above the PCB, but not touching it, nor should it be allowed to touch any part of the oven. The PCB (which is just an empty board used for the photo) rests on a grill to allow air flow on its bottom as well as its top. The pan supporting the grill provides additional heat shielding from the lower element. For good reflow soldering, the PCB should be heated primarily by air convection rather than radiation or conduction.
The SSR (Solid State Relay)
A FOTEK SSR-40 DA solid state relay is used in this project. It is rated to switch up to 40 amperes of AC, and will be more than adequate to switch the 10 amperes or so required by the toaster oven. As the name indicates, an SSR duplicates the function of a relay, but does so without any metallic switch contacts and the associated noise—both electrical and acoustical—associated with electromechanical relays. Another benefit of an SSR is that it provides galvanic isolation between the control circuit and the mains AC.
Warning! The SSR switches mains AC voltage which is dangerous and can be fatal. If you are at all unsure about your knowledge of safely working with mains AC voltage, do not attempt to wire the SSR.
The photo below shows a method for wiring the SSR. Note that the SSR only switches one side of the AC line, and (in the USA) that should be the hot side of the line. Plugs and cordage intended for mains AC use are coded for identification of the hot versus the neutral wires. The wider of the two prongs on the plug is the neutral side, and the narrower is the hot side. On the cordage, the neutral side is indicated by a raised rib running along the outside of the insulation; the hot side does not have a raised rib in the insulation.
The red and black wires carry the control voltage for the SSR, and are to be connected to the control circuit as described in part 1 of this project.
Once the hardware is sorted out, it's time to consider the code that makes it all work. When you start the program, the first thing you should see is the splash screen shown below. You can modify it to whatever you would like.
The portion of the code dealing with reading the thermocouple and displaying the temperatures was discussed in part 1, and will not be repeated here. Instead, the focus here will be on the code that actually switches the oven on and off. The complete code is available for downloading at the end of this section.
Line 23 defines a new variable: HCC stands for Heat Control Counter and uses variable byte location b11. Line 39, which is outside the main program, ensures that HCC is set to 0 each time the hardware is reset.
Lines 77 through 107 are reproduced below.
Line 77 checks to see that HCC is set to 0, and if so, lines 78 through 92 are executed based on the temperature inside the oven. If it is less than 150°C, it enables the "Pre-heating" stage of the reflow process, which executes the heat_100 subroutine repeatedly until the temperature increases to 150°C. While in the pre-heating stage, the oven is operated at a duty cycle of 100%, and the LCD continues to display the temperature and the current stage as shown below.
When the temperature is at or above 150°C, the code steps to line 81. If the temperature is at least 150°C, but less than 180°C, it enables the "Soaking" stage of the reflow process, which executes the heat_70 subroutine repeatedly until the temperature increases to 180°C. While in the soaking stage, the oven is operated at a duty cycle of 70%, and the LCD continues to display the temperature and the current stage as shown below.
When the temperature is at or above 180°C, the code steps to line 84. If the temperature is at least 180°C, but less than 215°C, it enables the "Reflowing" stage of the reflow process, which executes the heat_100 subroutine repeatedly until the temperature increases to 215°C. While in the reflowing stage, the oven is operated at a duty cycle of 100%, and the LCD continues to display the temperature and the current stage as shown below.
When the temperature reaches 215°C, the code steps to line 84, which turns the heat off, and begins the "Cooling" stage of the reflow process. While in the cooling stage, the oven is off, and the LCD continues to display the temperature and the heat off indication as shown below. Line 90 prevents the reflow cycle from restarting until the PICAXE is reset.
As you may see above, the temperature continues to rise for several seconds after the heat is turned off. At that point, you should open the oven door slightly to let some of the hot air escape. Unlike the first three stages, which are controlled by the PICAXE, the cooling stage is manual, and you are the regulator. Let the temperature cool gradually back to 150°C, and then open the door fully. Don't forget to allow time for the PCB and the inside of the oven cool to sufficiently to not only ensure that the solder joints are solid, but to protect your fingers from grabbing that proverbial "hot horseshoe."
Once you no longer need to watch the temperature inside the oven, disconnect power from the control circuit. When you next power it up, HCC will be reset and be ready for another single cycle through the stages.
"Tuning" the Code
When you understand how the code works, it should be fairly easy for you to make changes to accommodate your toaster oven. Here are some suggestions:
- To adust the temperature setpoints for a different solder, change the temperature numbers in lines 78, 81, 84, and/or 87.
- With everything set up but with the oven empty, get a pencil, paper, and a clock with a second hand (or digits) and start a reflow cycle.
- Note how long it takes for each stage and write down the times.
- Refer to the stage times in part 1. If a stage doesn't last as long as you need, decrease the duty cycle of the heat by creating a new subroutine. For example, to change the 70% duty cycle to 40%, just make the high time 400 milliseconds and the low time 600 milliseconds.
- If the soaking stage lasts too long, you can increase the duty cycle up from 70% to 100% or anywhere in between in the same way. Other stages are already set at 100%, so your primary options would be more, or larger, heating elements. If you try to add some insulation to the oven, be very careful not to create a fire hazard.
- Once everything seems right, try a board with some inexpensive components, see how it goes, and make additional changes as required.
The benefits of SMD components need no longer elude you. Build your own reflow oven and start getting more compact, more professional looking PCB assemblies.
And watch for more PICAXE projects on AllAboutCircuits.com.
Give this project a try for yourself! Get the BOM.