The Toast-R-Reflow design consists of a power board and a controller. When I started the project, I didn't actually have a reflow oven, so the power board was designed with through-hole parts. This has worked out fairly well. There aren't very many pieces to the power board, and there's little incentive to minimize its size.

Each channel of the power switcher is a basic opto-isolated triac circuit consisting of a MOC-3020 opto-isolated driver triac and a BTA-20 power triac.

In designing the power board, the biggest limitation was thermal constraints. I got the largest heat sinks that I could reasonably fit into the allotted space, but the thermal calculations must be quite conservative, since we're building it into an oven. Fortunately, the space behind the controls in the oven I selected (and this is likely true for most) stays relatively cool during operation. This is largely because the area is liberally ventilated, likely in an effort to insure that the user controls remain cool enough to be handled regardless of how hot the oven interior might get. Nevertheless, the operating specification for the power board is an ambient temperature of 50°C. Given the heat sink has a cooling capacity of 5°C per watt and the BTA-20's maximum operating temperature, its own junction-to-tab thermal resistance and the device power dissipation curve, what that winds up with is a maximum current rating of 8 amps. Since I'm in North America, the toaster ovens I use are 120 volts, so that 8 amps yields 960 watts. That's not quite enough, so I designed the power board with two channels. Since most toaster ovens have an even number of heating elements (either two or four - divided between the top and bottom) and they're usually controlled separately (so that the oven can support broiling), this works out just fine. The two channels can handle 16 amps total, which would probably be enough to start tripping circuit breakers if it were all used.

The input side of the MOC-3020s, like all opto-isolators, is merely an LED. Light the LED and the relevant heating element will turn on. But it's all-or-nothing: once a triac is turned on, it will stay on until the next AC zero-crossing. To get fractional power, you either need to do what a lot of lamp dimmers do and delay the triac turn-on during each cycle, or you need to do what every microwave oven does and just turn the elements on and off repeatedly to establish a fractional duty cycle. To do the former in software, you'd need to establish a zero-cross notification for the controller so that it could time the turn-on of the elements at least. To do it in hardware would require some sort of D/A conversion. The latter option is far, far simpler. As long as the time period for the PWM system is substantially longer than the AC cycle time, you can ignore the zero-crossings (in theory, it's still better to turn the triac on at zero volts, but in practice this has not proven to be necessary in my experience). I chose 1 second as the PWM interval. For 50% power, you turn the elements on for 500 msec and off for another 500.

The power board has three board-mounted QD terminals. The oven I chose (and I expect quite a few of them do as well) used QD terminals for all of the chassis wiring. There were three of particular interest - one from the hot line of the incoming wire from the AC plug, and one from each of the top and bottom elements (in my case, the AC hot line QD terminal was the wrong size and needed to be replaced. I just used an ordinary crimp terminal from Home Depot). The three interesting QD terminals were attached to the matching terminals on the power board and the board was secured to the outer chassis with #4 bolts and 1/4" standoffs. When selecting a mounting location, make sure that nothing can come in contact with the board or wiring. Be particularly cautious mounting the board near ventilation holes - you don't want to be able to poke anything through the hole and touch the HV traces on the board.

The input side of the opto-isolators comes to a three position screw terminal. Connect a 3 wire cable to it, being careful to note which of the three wires is the common cathode. Route the cable out of the oven however you can. I drilled a hole in the chassis and used a grommet. If you want to test the oven, plug it in. Since the opto-isolators are LEDs, if you apply a voltage to them, you must insure that the current limit is not exceeded. For 5 volts, use 150 ohm resistors. Alternatively, you can use a 25 mA current limited power supply. When each channel is powered, the appropriate heating element in the oven should turn on. When de-powered, the element should turn off.

The controller's job is to monitor the oven's temperature and control the heating elements so so that the board experiences the correct time:temperature profile. Generally, a profile consists of a pre-heat interval, where the board is gently brought up to a starting temperature. Next, there is a soaking period, where the board is very slowly brought to a temperature just under the activation point of the solder paste. Once there, the oven heats as quickly as possible to the maximum temperature of the profile and holds very briefly. Lastly, the oven cools, but only at a maximum cooling rate, lest the board and/or components suffer thermal shock.

Achieving this requires two things: A thermocouple to measure the temperature of the oven interior near the boards, and a PID controller. PID stands for Proportional, Integral, Derivative, and it's the gold standard for feedback loop controller design. The PID controller's job is to make a process variable (in this case, the temperature of the oven) arrive at a (potentially moving) setpoint without overshoot, undershoot or instability. There is an excellent Arduino library that will do the job perfectly, and the firmware was, more or less, designed directly around it.

The other requirement is the ability to sense the temperature. The best sensor for the job is a thermocouple. They're hardy, accurate, and have an operating temperature range far wider than our reflow oven will ever need. To actually read the temperature from them requires a device called a thermocouple amplifier. These devices are carefully tuned at the factory to accurately convert the minute voltage output from the thermocouple into a reading (either an output voltage with a much larger scale than the input, or a direct digital output) usable by the rest of the system. Both the AD595 and AD8495 chips are analog thermocouple amplifiers. The AD595 outputs a voltage of 10 mV per °C, and the AD8495 outputs a voltage of 5 mV per °C. Both of those are easily readable by an Arduino analog pin.

The first version of the controller was an Arduino Uno with an AD595 on a breadboard and an AdaFruit i2c RGB 2x16 LCD shield. It proved the concept and design and its last job was to run the reflow cycle for its own permanent replacement. The AD595 was chosen because it was the only through-hole part I could find to do the job. It was outrageously expensive - nearly $15 for one - but at the time, breakout boards for SMD thermocouple amplifiers weren't available. The AD8495 is a third the cost and does every bit as good a job, but is an MSOP-8 package. Since I did this, AdaFruit now offers an AD8495 breakout board that's perfectly suitable, or you could go directly digital with a MAX31855 breakout.

The first permanent version of the controller was designed with an ATTiny85, an AD8495 thermocouple amplifier, and an i2c 2x16 RGB backlit LCD "backpack" display. The display is a clone of the AdaFruit i2c RGB LCD Arduino shield that's used extensively by the OpenEVSE project. It's been my go-to user interface for a lot of my projects.

It wasn't too long after that that I combined the display backpack with the controller itself, and then switched from the ATTiny85 and the i2c GPIO chip to an ATTiny84 and the standard LiquidCrystal library. Along the way, I added a 1.8 volt LDO to provide a reduced voltage analog reference so that the resolution of the temperature sensing could be increased.

But the problem with both the ATTiny84 and ATTiny85 variants is that, while they work perfectly well, the code to make them work uses the entirety of the available flash. And while it was good enough as-is, I envisioned a desire for some folks to add additional features. That meant upgrading the controller (I chose the venerable ATMega328P). But while I was at it, I decided to switch to the MAX31855 digital thermocouple amplifier. It has a 1/4°C resolution across the entire range of a K type thermocouple and can also provide the ambient temperature of the controller itself (I use that to mark the initial temperature for the pre-heat phase). The new controller has an FTDI compatible serial port header (the current code does temperature logging), three buttons (at present only one is used - the other two are for expansion) and has three different profiles built-in: one for SnPb solder paste, one for RoHS, and the third is a "bake" profile for dehydrating moisture sensitive parts (they're kept at 125°C for 10 hours).

All of the controllers are "backpack" designs. The parts all mount on a board the same size as the 80x36mm 16x2 LCD display. The controllers all have an SMD 2.1mm barrel connector for DC power (they take 6-12 VDC), and all have a button mounted on the back. The thermocouple connects to a pair of screw terminals, and the oven's power board cable connects to a set of 3. Operation of the oven is trivial. The button understands "short" and "long" presses (250 msec is the dividing line). While it's idle, a short press will start a cycle and a long press will select between the available profiles. While it's operating, a short press toggles the display between showing the target temperature and the duty cycle of the elements. A long press cancels the cycle in progress and returns to idle.

The theory of operation of the controllers is quite straightforward. Worthy of particular note are some of the choices made on which pins to use. The SPI pins of each controller (MOSI/MOSI/SCK) are used for programming. That means that if some other use is made of those pins, it must not be allowed to interfere with programming. The best way to achieve that is to insure that whatever you put on those pins will, by default, place its own pins in a high impedance state. Baring that, place 1k resistors between the programming interface and the other uses of those pins. I'm in the habit of putting the 1k resistors before the LCD anyway (even though as long as the R/W pin is not held low those pins will be inputs) because one project I did once had the LCD power switched on and off, and while the LCD was off its bus pull-up resistors were enough to impede programming. To save pins, I shared the LCD data bus pins with the data and clock pins of the MAX31855. As long as both the LCD and MAX chips have separate chip enable pins and they're not both simultaneously asserted, that's ok. Since the MAX is a 3.3 volt chip, diode+pull-up level shifters need to be used to protect it from 5 volt logic. On the output side, nothing special needs to be done. When CE is not asserted, the pin is high impedance and insensitive to 5 volts. When CE is asserted, it's an output, and 3.3 volt logic signals are high enough for the ATMega to interpret. The ATMega controller is clocked at 16 MHz. It's not particularly necessary, but I decided to stick with the Arduino pattern. If desired, you can load an Arduino boot loader into the controller and upload sketches with the FTDI interface. Done that way, you would simply tell your Arduino IDE that the device is an Arduino Uno and upload sketches with a serial cable. If you do this, you should short the DTR_RESET jumper. This will cause DTR transitions on the serial port to reset the controller. If you do this, be careful not to transition DTR while the oven is running, or you'll reset the controller, which will abort cycles in progress. If you want to save a few pennies, you can instead fuse the ATMega for an internal 8 MHz oscillator and leave off the crystal and the two 22 pF caps.

I figured out another way to do the Model II controller that is slightly easier to build. Because the MAX31855 is a 3.3 volt chip, it would be handy to run the entire system on 3.3 volts and not have to have two separate LDOs for system power. In principle, both the LCD and the ATMega controller are perfectly happy to run on 3.3 volts... except that the contrast voltage input to the LCD must be something like 4.4 volts lower than Vcc. If Vcc is 3.3 volts, then that voltage actually has to be negative.

It turns out that doing that is actually not too hard. You can use a charge pump to turn the 3.3 volt supply into a -3.3 volt supply, then use a pot between that and ground to supply the contrast voltage for the LCD.

An argument can be made that this is just trading one power supply for another, but using 3.3 volts for the entire system does have the benefit of eliminating all of the level shifting for the thermocouple amplifier.

The model I controller uses an ATTiny84. All of its available pins are spoken for given the design. AREF is fed 1.8 volts so that becomes the full scale voltage of the A/D converter. This means the maximum temperature is 360°C, which is plenty. Reducing the reference voltage allows greater measurement resolution.

A power board kit and the two current models of the controller (model I is the ATTiny84/AD8495 version and model II is the ATMega328P/MAX31855 variant) as both "quick kits" (the SMD assembly and programming is done, you just do the through-hole assembly) and fully assembled and tested are available in my Tindie store. The firmware is availble on GitHub