Saturday, October 24, 2020

0000 0000 0100 0110

Hot Chips in an oven

No, this is not a recipe blog all of a sudden! I am exploring all options to make the pesky PADAUK FreePDK programmer project as to date my ham-fisted soldering has resulted in a melted mess rather than the expected lovely PCB goodness. To that end, I bought a cheap oven.

Temperature control is clearly fairly rudimentary on the original unit, and in fact it is possible to buy control circuitry to bake perfect chips as per the heating/cooling profiles for various solder paste formulations.


Instead (and because I'm cheap) I'm going to press into service a combination of an appropriate K-type thermocouple, plus a MAX6675 to help an AVR to interpret and plot the temperature inside the oven. I'm hoping the combination of live monitoring and mad flicking of switches might give me enough control to make the solder flow. The unknown at this stage is my ability to smear solder paste WITHOUT a stencil! What was I thinking? Oh yeah, cheap...

Firstly I hooked up the thermocouple to the MAX6675 module, loaded up example code, made a few quick modifications and ran the program to see if it worked.

/*

ATMega8A temperature probe
https://github.com/YuriiSalimov/MAX6675_Thermocouple
OneCircuit Tuesday 20 October 22:28:10 AEDT 2020
*/ #include <Thermocouple.h> #include <MAX6675_Thermocouple.h> #include <SmoothThermocouple.h> #include <TM1637Display.h> #define SCK_PIN 6 #define CS_PIN 7 #define SO_PIN 8 #define CLK 13 #define DIO 12 int temperature = 0; #define SMOOTHING_FACTOR 5 Thermocouple* thermocouple = NULL; TM1637Display display(CLK, DIO); void setup() { display.setBrightness(0x02); Thermocouple* originThermocouple = new MAX6675_Thermocouple(SCK_PIN, CS_PIN, SO_PIN); thermocouple = new SmoothThermocouple(originThermocouple, SMOOTHING_FACTOR); } void loop() { const double celsius = thermocouple->readCelsius(); display.showNumberDec((int)celsius, false); delay(500); }

Then I did the OLED thing...

/*
  Code based on:
  https://github.com/YuriiSalimov/MAX6675_Thermocouple
  https://github.com/olikraus/u8glib/
  
  OneCircuit Tuesday 20 October 23:08:11 AEDT 2020
*/ #include <Thermocouple.h> #include <MAX6675_Thermocouple.h> #include <SmoothThermocouple.h> #include "U8glib.h" #define SCK_PIN 6 #define CS_PIN 7 #define SO_PIN 8 int temperature = 0; int timer = 0; #define SMOOTHING_FACTOR 5 Thermocouple* thermocouple = NULL; U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE); void draw(int howlong, int howhot) { u8g.setFont(u8g_font_unifont); u8g.setFontPosTop(); u8g.drawStr(1, 1, "OneCircuit"); u8g.drawHLine(1, 1 + 14, 78); u8g.drawStr(1, 25, "Time(s): "); u8g.setPrintPos(75, 25); u8g.print(howlong); u8g.drawStr(1, 40, "Temp(C): "); u8g.setPrintPos(75, 40); u8g.print(howhot); } void setup() { Thermocouple* originThermocouple = new MAX6675_Thermocouple(SCK_PIN, CS_PIN, SO_PIN); thermocouple = new SmoothThermocouple(originThermocouple, SMOOTHING_FACTOR); u8g.setRot180(); if ( u8g.getMode() == U8G_MODE_R3G3B2 ) u8g.setColorIndex(255); else if ( u8g.getMode() == U8G_MODE_GRAY2BIT ) u8g.setColorIndex(3); else if ( u8g.getMode() == U8G_MODE_BW ) u8g.setColorIndex(1); } void loop() { const double celsius = thermocouple->readCelsius(); temperature = int(celsius); u8g.firstPage(); do { draw(timer, temperature); } while ( u8g.nextPage() ); delay(1000); timer++; }

/*
Sketch uses 14696 bytes (44%) of program storage space.
Maximum is 32768 bytes.
Global variables use 330 bytes (16%) of dynamic memory,
leaving 1718 bytes for local variables. Maximum is 2048 bytes.
*/



Soon I'll fire up the oven with an actual PCB in it - and then mock up the ATMega328p based control/measuring unit. Will the madness ever end? <nope>







No comments:

Post a Comment