Archive for PIC24

Toaster Oven to Reflow Oven – Part 2

Posted in PCB Manufacturer, PIC Micro with tags , , , , , , , on September 8, 2011 by Karel M

Last time I left you with a video showing the control board running a toaster oven. Today, I’m going to start with a video showing a PCB getting reflowed in the oven. I will cover the changes I made after the video.

The first and most important of the changes, a new temperature sensor. The diodes used in the original design are only rated to 175c  and wouldn’t work at the temperatures needed to reflow solder. After doing some searching online, I found what looked like a good and cheap replacement. It’s a 50K Ohm NTC thermistor part number 135-503LAF-J01.  It’s in a glass package like a small through hole diode which worked well because it made mounting the thermistor  much easier.

Speaking of mounting thermistor, it isn’t as easy as running some wires and soldering it in place. Wire that will work up to 300c is expensive and the solder will melt every time a board is reflowed. The solution I settled on, with some ideas from my roommate, was to drill a hole in the side of the oven, cover the hole with epoxy, and run some thin copper tubing through 2 holes drilled in the epoxy. The thermistor leads are then crimped into the copper tubing to make the final electrical connection.

The first step in mounting the thermistor was to drill a hole in the side of the toaster oven. I used a 1/2 inch drill bit but anything close will work. The only requirement is allowing enough room for the 2 small copper tubes to pass through without shorting. I left plenty of room on all sides and drilled a little above the top oven rack slot to allow the sensor to rest on top of the board that was being reflowed.  Here is a photo of the hole I drilled.

I placed a bit of duct tape on the inside of the oven to help keep the epoxy in place. I tried to put the tape on weakly and used the blunt end of a drill bit through the hole to push the tape away a little so the epoxy would be able to flow under the tape a little. That would help keep the epoxy from coming loose later. Here is what the tape looks like inside the oven. As you can see it doesn’t have to be pretty.

Next, I placed the oven on its side so gravity would help pull the epoxy through the hole onto the tape. After looking up several epoxies I settled on JB Weld.  It’s rated to work up to 300C and it’s easy to find. I wasn’t sparing and made sure to work the epoxy under the tape and completely cover the hole. Here is what the wet epoxy looks like.

Now, let the epoxy cure for 24 hours.  Once the epoxy is cured remove the tape from the inside and drilled 2 small holes. The holes should be just big enough to allow the small copper tubing to fit through. I got the tubing at Ace Hardware, but other hardware store should have it.  It came in a pack of 3 – one foot long pieces.  Here is a photo of the tubing with a small diode for size reference.

And a photo of the holes in the epoxy.

I then pushed the tubing in until it was about halfway into the oven, placed the leads of the thermistor into the tubing and crimped it down with pliers. I cut the excess tubing off with cutters and soldered wires from the tubing to the control board. Polarity doesn’t matter with a thermistor. That took care of the hardware mods, you can see the thermistor resting on a PCB in the following photo.

It’s nothing fancy, but it works quite well. The tubing has a bit of spring and gently holds the thermsitor on the board for better thermal contact.

With the hardware modified, I needed to update the software to compute the temperature from the thermistor reading. I settled on using the Steinhart–Hart equation to compute the temperature. This meant the first step was to convert the reading from the A/D converter into ohms. This was actually very easy since it was just ohms law, R = E/I.  E in this case is the A/D result times VCC (3.3 Volts) divided by the total counts of the A/D (1024 for the 10bit A/D). The current “I” in the equation is set at 55uA in the CTMU module. I had the PIC do the math using floating point since I was going to need floating point later for the Steinhart-Hart equation.

Now that the resistance of the thermistor is known, all I need to know was the A,B, and C constants to plug into the Steinhart-Hart equation. This is where I ran into a bit of a issue because there isn’t really a good datasheet for the thermistor I bought. If I was to do this again, I would make sure to buy a part with a good datasheet. Thankfully, the internet came to the rescue and I found an excel spreadsheet that calculates the three constants given temperature and resistance values at 3 points. If you do a search for Stein1.exe you will find the site that has the spreadsheet.  I had to heat the oven up and measure the temperature and resistance at a couple different temperatures. Once I plugged the data into the spreadsheet I had the constants I needed.

With the constants and thermistor resistance known, it was simple to have the PIC calculate the temperature. The PIC does all the math, including calculating the natural log of the resistance. The Steinhart-Hart equation provides temperature in Kelvin, so the program converts to Celsius and, if a flag is set, converts to Fahrenheit.  This number is fed into the PID  control loop and controls the Triac output level.  The floating point math uses about 10% of the code space in the pic, but there is still room left over for additional features.

While I was working on the code, I also added a new feature. The controller on power up checks to see what the line frequency is (50Hz or 60Hz)  and automatically adjusts timings for Triac control.  For use outside of the USA, the only change needed will be a transformer rated at the appropriate input voltage that provides around 9V AC out.

With the code updated, I had to give the oven a try and solder a part. I settled on soldering a 44 pin TQFP part, a CPLD in this case.  I will put pictures below, but it went very well. There were a couple solder bridges but that was caused by to much solder paste. This was my first time using this paste and the oven but it was nothing a little solder wick couldn’t fix. A little less paste next time and it would have been good right out of the oven. I used a ROHS solder paste from Digikey.

Solder paste on the board.

Board cooking in the oven.

Fresh out of the oven, you can see a couple of solder bridges.

After cleaning up with solder wick. It was a success!

Need to clean up the residual flux with some IPA, but the solder looks good.

Next, I want to add more options for setting up the PID control loop to the user interface. Stay tuned for that update.

Advertisements

A PIC Based Temperature Controller – Part 4

Posted in PCB Manufacturer, PIC Micro, Uncategorized with tags , , , , , , on August 28, 2011 by Karel M

I have a basic user interface setup that allows the temperature to be set. Currently only the right 2 buttons are used, one for up temperature and the other for down temperature. When the laminator is turned on it shows the current roller temperature. Pressing the up/down button momentarily shows the set point, which is 50F at power up. This means the laminator is off by default. Holding up/down for a couple seconds starts the temperature changing in 5 degree increments every second. Releasing the button again shows the actual temperature of the roller.

I plan on adding code that will use the extra button to allow the set temp to be saved to the PICs internal EEprom and set again just by hitting the button momentarily. This will allow a commonly used temperature to be set quickly.  Also, the room temperature calibration will be entered by holding the 3rd button while powering on the laminator. The calibration will also be saved to EEprom, and will only need to be done once. After working with the the code, I also want to a feature that will allow the PID constants to be changed by entering a special mode. This will allow the board to be tuned for different uses without needing reprogram the PIC.

I have tried the laminator out at it works well. Here is a picture of the laminator heating up. Please ignore poor quality, I had to do a longer exposure because I was only getting one digit showing in the pictures. This is caused by the 3 digits being multiplexed and only a single digit being turned on at a time. The camera was fast enough to only show one digit on at a time.

Laminator Working and Coming up to temperature.

I currently have the second sensor disabled, because the PID control loop does a good job heating up the laminator while preventing overshoot.  I will add the second senor as a fail safe that will turn off the laminator if the first sensor stops working for some reason. The laminator heats up to normal lamination temp of about 240F in less than 2 minutes. This is a nice improvement of the original 5 minutes or so it used to take, and is an added bonus of the modification.

I ran a blank board through a few times and the laminator only lost about 15 degrees on the first pass and recovered quickly.  After the 2nd pass the board was hot enough that I didn’t want to touch it.  This is a big improvement on the dozen or so passes it used to take. I need to see how hot the laminator will safely work. I have tried 260F for about an hour without any issues. If it can go a bit higher, a one pass toner transfer should be in sight. Worst case it will take 2 passes, which for me is very acceptable.

The display cutout was just done with a rotary tool, and while being a bit crude, works well. If I left the bit of plastic that would have gone between the display and buttons it almost would look stock.

Seeing there might be some interest in this project, I have set up a kickstarter page to try to get this into the hands of hackers and tinkerers like you. If you are interested, please feel free to check it out.

I hope to post a video of the laminator in action soon, but it’s currently apart as I was adding some features to the code.