Dubious engineering of a reflow oven controller
So, our previous experiment demonstrated that our "watch it and turn it off when its done" approach to reflow soldering really didn't work. Consequently, we set about the process of designing a controller. Taking our inspiration from this guy we will be going with the "set all the controls to on and then interrupt the mains with a Solid State Relay" approach. This has a number of advantages. For one thing, it doesn't require figuring out how to get the enclosure off the oven (which is not trivial as it has strange rubber feet moulded into it...). Also, messing around inside something that is all running at mains voltages is a bit scary. It might give us the opportunity to mitigate the 110V issue by only using a 50% duty cycle at most.
We considered some nice PCB mount SSRs like this but there were a number of problems with that option. As an aside, I'm going to use UK Farnell links here not because I'm particularly endorsing Farnell, but because they have a nice range and, if you use a respectable University as your postal address, they ship things quickly and efficiently, consequently we base some of our decisions round "what can we get from Farnell" and keep all our Bills Of Materials in terms of Farnell order codes. Anyway, PCB mount SSRs look cool and all, but those ones are only rated to 10A. We did a layout that had several of them in parallel and ran into the more serious problem. We asked the Internet how big a trace we would need to support 240V at 16A (which is over the 13A fuse, but safety margins are good when we are involved). We get our PCBs from BatchPCB. Again, I'm not endorsing them per-se but they are cheap for the one of random stuff we do, and the 3 weeks lead time means we get on with some proper work while we are waiting for things to turn up! For the 1Oz copper they supply we would need 542mil traces. Unfortunately, the gap between the pins on those SSRs are only 400mil apart. We did another layout with 543mil traces down the sides of the array of SSRs and then smaller, 5A traces (meaning we would need 3-4 of the SSRs). This was a fun exercise in layout but then created a more interesting problem. We now had big areas of exposed metal that was going to be at mains voltages. Now, BatchPCB do very nice green coatings to their PCBs but I really wasn't comfortable about the idea of accidentally putting my hand on it and trusting the green coating to be 240V insulating. Big, mains voltage metal like this really scares me. Luckily, Farnell came to the rescue with the Celduc SU842070. A nice, plastic object with big screw terminals for the scary mains voltage and little screw terminals for the control signal it lets us design our controller for a more sensible 5V, and it even has a little LED to tell you when its active.
The next question was: what else does our controller need? It certainly needs a thermocouple, and they are best used with nice amplifiers/compensators like the AD8495 that will take the thermocouple input, compensate for the cold junction temperature by using an internal temperature sensor, and output a nicely calibrated voltage that varies at an exact number of mV per degree C (an exact number that I can't be bothered to look up). Having measured this temperature so accurately - and having gone so very wrong last time - we really do want to display this data and some other status bits on an LCD. Our offices are filled with boxes of random electronics that we have acquired over the years and one of them contained a two line text LCD display that has been floating around for ten years waiting for a use. It seems to be a Powertip 2402-A which is based on the Sitronix ST7066U (pdf).
We have input, output, and something to control. We will just steal 5V off a nearby USB port since the SSR has a control current limiter that only draws 14mA, the LCD says it draws 2mA, and we don't plan to have too much else taking power. The final decision is the processor. Now, I love the ATTiny5 - there is just something extremely cool about having computing power adequate for many control jobs in a package so small you could inhale it and barely notice! I really did try to get this project working with one. It has the A/D converter to cope with the thermocouple amplifier, it can easily drive a transistor to power the SSR control input, but the LCD was something else. I lay in bed one night contemplating using the remaining two I/O pins to drive a shift register and its output latch so that it could just pipe stuff across the control and data bus, but then I realised I would need clock pins too. Eventually, I had to admit defeat, but I will work the ATTiny5 into everything else conceivable! Instead, we revert again to the office boxes. When I took over my office I found a sealed Farnell bag in a filing cabinet draw. On opening it I was met with two STR911Fs (the 80pin versions). Its a bit of a huge step up from the ATTiny, and we could have gone for a PIC or a more sensible Atmel product, but these are free and we always like free. Our trusty BusPirate can just about manage JTAG programing as long as you are patient, so this is also a good chance to have a play with that.
Some extremely dubious schematic design followed. I use gEDA for schematics, simulation with SPICE, and pcb layout. Its not considered as "user friendly" as Eagle but its free. Yes, I know you can get the limited version of Eagle for free but no one likes to feel limited, and at $169 for the cheapest version its probably worth the learning curve to use something totally free. Also, maybe I'm weird but I don't find Eagle as obvious to use, and I like that gEDA uses text files in its backend for those days when you are feeling overly keen and want to tinker. The schematic came together fairly quickly, once the full 80pins of STR911 symbol had been developed. I have not tested this yet so its possible I have made some drastic electrical mistake (I'm still not 100% sure which power level should be connected to the JTAG VREF pin for example.).
The two items labeled "buck" are buck converters based on the AP34063S8G. These will produce the 1.7V for the core, and the 3V for the IO stuff. The SSR control is run directly off the USB 5V supply, but with a fair sized capacitor at C1 to prevent it being too much of a stress on the USB power lines as it switches. The driving transistor is wired to I/O pin 0 of port 2. There are three LEDs wired to the 5V line via transistors. These are connected to the first three I/O pins on port 3 to give some basic status output - and to give us something to test the very first software download by flashing. A bit of PCB layout (which I find very therapeutic, actually...) leads to a board that (eventually, after this mornings tweaks) passes BatchPCB's Design Rule Check bot.
If anyone wants the gEDA files for this let me know through the comments or by email. I'll gladly give them out on a GPL-style basis - i.e. make sure you mention us when you distribute them further. The only thing that keeps me from posting them here is that I can't be bothered to go find a GPL declaration and paste it in to all of the files. I haven't made this yet, I haven't tested any of the subcomponents, I haven't even really thought that hard about some of it. Any EE students who want to comment are welcome; can you try to elaborate on "that'll never work" a bit though please?
So, board designed. Bitter experience tells me that the next thing to do is order the parts and lay them onto a life sized printout to make sure all the footprints are right before we get the boards made. It turns out the typo that changes SOIC-16W to SOIC-16M still makes a valid footprint that looks very similar but doesn't actually fit!