DIY编程器网

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1814|回复: 0
打印 上一主题 下一主题

Reflow Oven Controller(另一个)

[复制链接]
跳转到指定楼层
楼主
发表于 2015-11-7 15:59:17 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
This shows the build for a simple Arduino-based reflow oven controller. This converts a basic toaster oven into a temperature controlled reflow oven for making surface mount circuits. The temperature profile is read from a simple text file on an SD card. This makes changing the temperature profile very easy, without any new code to upload.
I've not done much surface mount work, mainly as I like the projects that I build to be easily repeatable with minimal tools. But there are a number of ICs which are only available as a surface mount package.
Also, surface mount boards are smaller, so consume less resources, and do not require drilling all the holes.
Finished unit
Here is the finished unit. It has worked on a couple of test runs, but I will upload photos of the first boards built on it.

The oven is controlled with a solid state relay. It still works as a timed oven (but I will not be cooking my food in it after filling it with lead fumes).

The LCD screen shows the actual temperature (Ta), the setpoint temperature (Ts) the time taken in seconds (T) and the phase of the temperature profile.


This is crammed into the laser cut enclosure. It uses the DataDuino as the basis for project (with SD card and real time clock). A serial interfaces LCD screen (again with an Arudino) is used as the display. Temperature is measured with a thermocouple and a specialist  k-type thermocouple amplifier IC.
Reflow temperature profiles
There is quite a lot of information on the temperature profile required for reflow solder techniques.
Here is one link: http://www.intersil.com/content/dam/Intersil/documents/tb49/tb493.pdf
Basically there are four main stages:
  • Warm - Approx 90s getting up to 150C
  • Soak - Stay between 150 and 200C for 60s
  • Reflow/Peak - Ramp up up to 250C and stay there for at least 5seconds. Takes around 60s
  • Cool - The slower cooling the better the connections
Obviously each solder paste and set of components is slightly different. I needed a generic reflow curve which I could easily adapt.
I did this by implementing the reflow curve data within a text file on an SD card. This can be changed easily and the new set points are loaded each time the unit is switched on.
The data is in the format:
Start Temp, Finish Temp, Time, Rate
These are in .csv format and you can enter as many as you like. These data points will be used to create the temperature setpoint. A hysteresis controller is used to control the heater to get to the set point.
The setpoint temperature is calculated from first figuring out if the rate is +ve or -ve. This will then increment or decrement the setpoint. The setpoint temperature will then be the start temperature which is then ramped up to the finish temperature at the ramp rate. If the ramp is set to zero then the ramp is calculated from (finish temp-start temp)/Time.
Toaster Oven conversion
I used a second hand toaster oven, which cost £8 from the car boot sale. It was in almost new condition. It is 700W rated, which is a bit under rated it turns out, and uses infra-red elements at the top and in the base.



A solid-state relay (from a Chinese manufacturer, which I had lying around) is used to control the oven. This can cope with 25A, but I am only putting around 3A through it. The back of the relay is a metal plate for heat-sinking, which I bolted to the metal casing of the toaster. This would not be OK for leaving it on all the time, but for the 4-5mins for a reflow oven, this should be OK.

Testing the unit. The relay is added to the mechanical timer contacts.

The relay is mounted inside the case, onto the back metal plate (which is incredibly thin so probably will not work as an amazing heatsink).


Here I am testing the oven using a 5V input. The heaters are controlled well.
Temperature measurement
I have written about temperature measurment before. This time the temperatures are quite high. We need to be able to measure up to 400C with no problems. The typical technique to do this is to use athermocouple. This is a set of two junctions of two dissimilar metals. If one junction is kept cool while the other heated up then a very small voltage is generated (by the Seeback effect).
The problem is that this voltage is very small (a few uV per degree C). Also a cold junction is required which must have a known temperature.
To convert the thermocouple value into a more useful voltage I used a thermocouple amplifier IC. This was the AD8495CRMZ from Analog Devices. This was expensive (around £6 from Farnell), but did everything I needed. It has an internal calibrated temperature sensor so that it knows the cold junction temperature, a conversion for K type thermocouples and an amplifier. The output is 5mV per degree C, hence it is much easier to read by the microcontroller, especially at higher temperatures.
I used this thermocouple from Farnell, which is good for up to 1000C.

The IC is only available in a surface mount package, hence I needed to use these adaptors I made. The irony of needing a reflow solder oven to solder these is not lost on me, but I hand soldered these.
The final circuit was taken straight out of the data sheet. Which suggests using input resistors and filtering capacitors (there are two more capacitors on the back of the board). Also an output RC filter is used to remove any 50Hz hum.
Circuit overview
I am not planning on making loads of these, hence I have not produced a full circuit, so you will just have to make do with these photos and explanations. The main brains of the device is an Arduino based ATmega328 with the DataDuino board. I used this board as I have a load of them. It has an SD card holder in it and a real time clock to give accurate timing pulses (not really required, but I used it any way).

There are three main sections: The DataDuino brain, the thermocouple conversion circuit and a serial LCD display (the green board and the green LCD display).
The DataDuino has the main control code on it. it has two inputs for start and stop switches. It also has output LEDs for when the device is running and an output to control the heater solid state relay.

There were not enough pins to run and LCD display, but I really wanted a user interface which shows various data. Hence I used another Arduino board (home brewed on the Nottingham hackspace PCB workshop) and uploaded the basic Serial to LCD example within the Arduino IDE.
This worked great. To output data to the 16 x 2 LCD screen I needed to create an output which was 80 characters long. The first 40 are for the first line, which then rolls over to the second line for the next 40. This took a bit of working out, but is there in the data sheets if you look hard enough. So I updated this display with totally new data every second.
I like this as a way of adding a display - it only uses two pins and you can output error messages etc. I will probably roll a PCB for implementing this, please email if interested in one.
Arduino code
The Arduino code is here. I used the Arduino Uno bootloader and version 1.0.5 of the IDE. It requires a number of libraries to be installed, as listed in the header file. It should be commented to explain what it does. Please get in touch if you would like to know more.
  1. /********************************************************
  2. /****** Reflow Oven Controller - Arduino DAQ UNIT ********************
  3. /****** by Matt Little **********************************
  4. /****** Date: 15/10/13 **********************************
  5. /****** [email]info@re-innovation.co.uk[/email] ************************
  6. /****** [url]www.re-innovation.co.uk[/url] *************************
  7. /********************************************************

  8.   See [url]www.re-innovation.co.uk[/url] for information and construction details
  9.   

  10. /*************Details of Code*****************************

  11.   This is a reflow oven controller based upon the DataDuino board
  12.   The DataDuino has an SD card holder and a real time clock on-board
  13.   It interfaces with a modified IR cooking oven using a solid state relay
  14.   The SD card holds the temperature profile for the device
  15.   The RTC ensure correct timing for the stages
  16.   An additional k-type thermocouple and converter IC is required.
  17.   
  18.   A PCF8563 Realt Time Clock is used to timestamp the data.
  19.   
  20.   Pin D7 controls the heater
  21.   Pin A0 has a temperature sensor attached
  22.   
  23.   
  24.   An LCD interface would be nice.
  25.   
  26.   
  27.   //OLD*****************************
  28.   Pin D4 is set up to record a DS18B20 1 wire temp sensor (up to 4 sensors can be attached)
  29.   Pin D3 is set up to cound pulses from a sensor (such as a anemometer or flow sensor)
  30.   Pins D7,D8,D9 are set up to record digital information (0 or 1)
  31.   Pins A0 to A3 are set up to record analogue information (0 to 1024)
  32.   
  33.   

  34.   Updates:
  35.   15/10/13  Code Started   Matt Little
  36.   17/10/13  Added output via serial LCD  Matt Little
  37.   17/10/13  Added analog input  Matt Little
  38.   17/10/13  Added AD8495 Thermocouple amplifier and conversion factor  Matt Little
  39.   


  40. //*********SD CARD DETAILS***************************        
  41. The SD card circuit:
  42. SD card attached to SPI bus as follows:
  43. ** MOSI - pin 11
  44. ** MISO - pin 12
  45. ** CLK - pin 13
  46. ** CS - pin 10
  47. ** Card detect - pin 6

  48. SD card code details:
  49. created  24 Nov 2010
  50. updated 2 Dec 2010
  51. by Tom Igoe

  52. //************ Real Time Clock code*******************
  53. A PCF8563 RTC is attached to pins:
  54. ** A4 - SDA (serial data)
  55. ** A5 - SDC (serial clock)
  56. ** D2 - Clock out - This gives a 1 second pulse to record the data

  57. RTC PCF8563 code details:
  58. By Joe Robertson, jmr
  59. [email]orbitalair@bellsouth.net[/email]

  60. **********************************************************************************************************/

  61. /************ External Libraries*****************************/
  62. #include
  63. #include           // Required for RTC
  64. #include    // RTC library
  65. #include             // SD card library
  66. #include   // Library for putting data into program memory
  67. #include         // For writing values to the EEPROM
  68. #include

  69. /************User variables and hardware allocation**********************************************/

  70. /******* SD CARD*************/
  71. const int chipSelect = 10; // The SD card Chip Select pin 10
  72. const int cardDetect = 6;  // The SD card detect is on pin 6
  73. // The other SD card pins (D11,D12,D13) are all set within SD.h
  74. int cardDetectOld = LOW;  // This is the flag for the old reading of the card detect

  75. /*************Real Time Clock*******/
  76. Rtc_Pcf8563 rtc;
  77. #define I2C_RTC 0x51 // 7 bit address (without last bit - look at the datasheet)
  78. int RTCinterrupt = 0;  // RTC interrupt - This is pin 2 of ardunio - which is INT0

  79. /********* Output LED *************/
  80. const int LEDred = 5;  // The output led is on pin 5

  81. /********* Output for heater ************/
  82. const int heater = 7;  // HEater control is on pin 7

  83. const int swStart = 9;  // Start button
  84. const int swStop = 8;  // Stop button

  85. /********** Input for temperature sensor *******/
  86. //int temperature = A0;  // Analog input



  87. //********Variables for the Filename*******************

  88. char filename[] = "flow.csv";  // This is a holder for the full file name
  89. //int refnumber;     // The house number here, which is stored in EEPROM
  90. File datafile;   // The logging file
  91. int dataArray[100];    // This is the holder array for the data as a string. Start as blank
  92. int dataInt;    // This holds the integer value of the data
  93. int n = 0;    // An integer for counting how many data points available
  94. int dataPoint = 100;  // This tells us which set of data points the control system is using


  95. int timeFromStart = 0;  // Is a counter to show the time from switch ON
  96. int totalFromStart = 0;  // This counts the full time in seconds from the start
  97. int tempSetpoint = 0;   // This is the temperature to try and reach, with the heater control (hysteresis or PID)
  98. int startTemp = 0;      // These hold the temperature setpoints
  99. int endTemp = 0;
  100. int rateTemp = 0;
  101. int endTime =0;  

  102. int actualTemp = 0;  // This holds the actual temperature data
  103. boolean startFlag=LOW;  // Should the device start or not

  104. // Variables for the Pulse Counter
  105. int pulseinterrupt = 1;  // Pulse Counter Interrupt - This is pin 3 of arduino - which is INT1

  106. volatile int writedataflag = HIGH;  // A flag to tell the code when to write data


  107. int day_int =0;      // To find the day from the Date for the filename
  108. int day_int1 =0;
  109. int day_int2 =0;
  110. int month_int = 0;
  111. int month_int1 = 0;
  112. int month_int2 = 0;
  113. int year_int = 0;  // Year
  114. int hour_int = 0;
  115. int min_int = 0;
  116. int sec_int = 0;

  117. // Varibales for writing to EEPROM
  118. int hiByte;      // These are used to store longer variables into EERPRPROM
  119. int loByte;

  120. unsigned long int calibrationFactor = 0;    // This holds the Vref calibration factor

  121. //**********STRINGS TO USE****************************
  122. String comma = ",";
  123. String date;        // The stored date from filename creation
  124. String newdate;     // The new date, read every time

  125. // These are Char Strings - they are stored in program memory to save space in data memory
  126. // These are a mixutre of error messages and serial printed information
  127. const char initialisesd[] PROGMEM = "Initialising SD card...";
  128. const char noSD[] PROGMEM = "No SD card      ";
  129. const char start[] PROGMEM = "Reflow Oven                             Controller      ";
  130. const char checkSD[] PROGMEM = "Checking SD.....  ";
  131. const char okSD[] PROGMEM = "SD Data is OK    ";


  132. #define MAX_STRING 80      // Sets the maximum length of string probably could be lower
  133. char stringBuffer[MAX_STRING];  // A buffer to hold the string when pulled from program memory

  134. //****************INITIALISE ROUTINE******************************
  135. void setup()
  136. {

  137.   
  138.   //******Real Time Clock Set - up********
  139.   // A4 and A5 are used as I2C interface.
  140.   // D2 is connected to CLK OUT from RTC. This triggers an interrupt to take data
  141.   // We need to enable pull up resistors
  142.   pinMode(A4, INPUT);           // set pin to input
  143.   digitalWrite(A4, HIGH);       // turn on pullup resistors
  144.   pinMode(A5, INPUT);           // set pin to input
  145.   digitalWrite(A5, HIGH);       // turn on pullup resistors
  146.   pinMode(2,INPUT);    // Set D2 to be an input for the RTC CLK-OUT   
  147.   //initialise the real time clock
  148.   Rtc_Pcf8563 rtc;

  149.   Serial.begin(9600);    // Set up a serial output for data display and changing parameters

  150.   analogReference(DEFAULT);  // This sets the internal ref to be 2.56V (or close to this);

  151.   // Read in the Voltage Set-point
  152.   hiByte = EEPROM.read(0);
  153.   loByte = EEPROM.read(1);
  154.   calibrationFactor = (hiByte << 8)+loByte;  // Get the sensor calibrate value
  155.   
  156.   Serial.println(getString(start));
  157.   delay(2000);
  158.   Serial.println(getString(checkSD));
  159.   delay(1000);
  160.   
  161.   initialiseSD();    // Inisitalise the SD card
  162.   // Here we want to read from the SD card and get the correct temperature setpoints:
  163.   datafile = SD.open(filename);    // Open the correct file
  164.   if (datafile)
  165.   {
  166.     //Serial.println("Data is available:");
  167.     // read from the file until there's nothing else in it:
  168.     n = 0;
  169.     while (datafile.available())
  170.     {
  171.       // Need to parse the data and record it into a varaibale here
  172.       // Data is in the format Start Temp, Finish Temp, Time, Rate
  173.       dataInt = datafile.parseInt();
  174.       
  175.       //Serial.println(dataInt);  // For debugging
  176.       
  177.       dataArray[n] = dataInt;
  178.       n++;
  179.       // The end result of this is dataArray with all the data as int within an array
  180.       // The value n which is the number of ints within the array (divide by 4 to give number of setpoints)
  181.     }
  182.     // close the file:
  183.     datafile.close();
  184.    
  185.     Serial.println(getString(okSD));
  186.     delay(1000);
  187.   }  
  188.   else
  189.   {
  190.     // No SD card - the device will not run
  191.     // Show error message and highlight error LED
  192.     Serial.println(getString(noSD));
  193.    
  194.     //************TO DO****************
  195.     //When SD card is inserted then re-initialise everything....???
  196.     //************TO DO****************
  197.   }  

  198.   
  199.   attachInterrupt(RTCinterrupt, RTC, FALLING);  // This sets up our Interrupt Service Routine (ISR) for RTC
  200.   pinMode(LEDred,OUTPUT);    // Set D5 to be an output LED
  201.   pinMode(cardDetect,INPUT);  // D6 is the SD card detect on pin 6.
  202.   pinMode(heater,OUTPUT);
  203.   
  204.   //Set up digital data lines
  205.   pinMode(swStart,INPUT);  
  206.   pinMode(swStop,INPUT);  
  207.   
  208.   initialiseRTC();  

  209. }



  210. //**************The RTC interrupt****************
  211. // I use the CLK_OUT from the RTC to give me exact 1Hz signal
  212. // To do this I changed the initialise the RTC with the CLKOUT at 1Hz
  213. void RTC()
  214. {
  215.   
  216.   if(startFlag==HIGH)
  217.   {
  218.     // We update the temperature setpoint every second
  219.     // This is done here to give accurate timing
  220.     timeFromStart++;
  221.     totalFromStart++;
  222.   }
  223.   writedataflag=HIGH;
  224.   
  225.   if(writedataflag==LOW)  // This stops us loosing data if a second is missed
  226.   {
  227.     // This gives us a 1 second output pulse for accurate timing
  228.     // This is used to output data onto the serial port
  229.     // Set the writedataflag HIGH
  230.     writedataflag=HIGH;
  231.   }
  232. }


  233. void loop()
  234. {
  235.    
  236.   
  237.   // ************ MEASURE THE TEMPERATURE *********************
  238.   // Temperature is measured using a K-type thermocouple.
  239.   // This is amplified with a AD8495 therocouple amplifier
  240.   // Which converts the signal to 5mV per degree celcius
  241.   // Hence the reading in volts / 0.005 = actual temperature
  242.   actualTemp = ((float)analogRead(A0)/(float)calibrationFactor)/(0.005);   // Read the analogue voltage

  243.   // Check if start button pressed
  244.   // If start button is pressed then reset the dataPoint and timer values
  245.   if(digitalRead(swStart)==LOW)
  246.   {
  247.     // Only if the start button is pressed do we start
  248.     startFlag=HIGH;
  249.     digitalWrite(LEDred,HIGH);
  250.     dataPoint=0;
  251.   }

  252.   if(digitalRead(swStop)==LOW)
  253.   {
  254.     // If the stop button is pressed then STOP!
  255.    
  256.     //*******SWITCH OFF HEATER***********
  257.     digitalWrite(heater,LOW);  
  258.    
  259.     startFlag=LOW;
  260.     digitalWrite(LEDred,LOW);
  261.     timeFromStart=0;
  262.     totalFromStart=0;
  263.     dataPoint=100;
  264.   }
  265.   
  266.   
  267.   
  268.   if(startFlag==HIGH)
  269.   {
  270.     // Only run if the data point is within the range available on the SD card
  271.     if(timeFromStart>=(dataArray[(dataPoint*4)+2]))
  272.     {
  273.       timeFromStart=0;  // Reset the time for this new datapoint set
  274.       dataPoint++;  // Increase the data points
  275.     }  
  276.    
  277.     // Here we run the program
  278.     if(dataPoint<n 4)
  279.     {
  280.       
  281.       //*********** SORT OUT HEATER CONTROL HERE *********************
  282.       // The heater works on Hysteresis control
  283.       // We check the heater every 20ms (approx)
  284.       // This might need adjustment of the hysteresis control for overshoot
  285.       
  286.       if(actualTemp>=tempSetpoint)
  287.       {
  288.         digitalWrite(heater,LOW);
  289.       }
  290.       else
  291.       {
  292.         digitalWrite(heater,HIGH);
  293.       }
  294.       
  295.       
  296.       delay(200);  // Gives a very short delay to the on/off control
  297.       
  298.       //**************************************************************
  299.       
  300.       
  301.       if(writedataflag==HIGH)
  302.       {
  303.         writedataflag=LOW;
  304.         
  305.         startTemp = dataArray[(dataPoint*4)];
  306.         endTemp = dataArray[(dataPoint*4)+1];
  307.         endTime = dataArray[(dataPoint*4)+2];
  308.         rateTemp = dataArray[(dataPoint*4)+3];
  309.         
  310.         
  311.         // We also want to update the temperature setpoint (tempSetpoint)
  312.         // This must be caluclated from a mixture of the rate, the start temp and the final temp
  313.         
  314.         // If the rate is zero then we work out the rate from the start/end tempeeratures
  315.         if(rateTemp==0)
  316.         {
  317.           // The rate will depend upon the difference between the start and end temps
  318.           if(endTemp>=startTemp)
  319.           {
  320.             rateTemp = (endTemp-startTemp)*10/endTime;
  321.           }
  322.           else if(endTemp<starttemp)
  323.           {
  324.             rateTemp = (startTemp-endTemp)*10/endTime;
  325.           }
  326.         }        
  327.         
  328.         
  329.         // We need to calculate the direction of the temperature change:
  330.         if(endTemp>=startTemp)
  331.         {
  332.           // In this case the direction is INCREASING
  333.           tempSetpoint = (startTemp*10 + (rateTemp*timeFromStart))/10;
  334.          
  335.           if(tempSetpoint>=endTemp)
  336.           {
  337.             tempSetpoint=endTemp;
  338.           }
  339.         }
  340.         else if (endTemp<starttemp)
  341.         {
  342.           // In this case the direction is DECREASNG
  343.           tempSetpoint = (startTemp*10 - (rateTemp*timeFromStart))/10;
  344.          
  345.           if(tempSetpoint<=endTemp)
  346.           {
  347.             tempSetpoint=endTemp;
  348.           }
  349.         }
  350.         displayData();
  351.       }
  352.     }
  353.     else
  354.     {        
  355.       
  356.       startFlag=LOW;
  357.       digitalWrite(LEDred,LOW);
  358.       timeFromStart=0;
  359.       totalFromStart=0;
  360.       dataPoint=100;
  361.       
  362.     }   
  363.   }   
  364.   else
  365.   {
  366.     digitalWrite(LEDred,LOW);
  367.    
  368.     digitalWrite(heater,LOW); // Ensure heater is OFF when stopped running
  369.    
  370.     //********* DISPLAY DATA **********
  371.     // Want to display data even when not running
  372.     // Do this 1 per second
  373.     if(writedataflag==HIGH)
  374.     {
  375.       writedataflag=LOW;  
  376.       displayData();
  377.     }
  378.   }
  379.   

  380.   
  381.   
  382.   
  383. }

  384. //*********** FUNCTION TO INITIALISE THE SD CARD***************
  385. void initialiseSD()
  386. {
  387.   //Serial.println(getString(initialisesd));
  388.   // make sure that the default chip select pin is set to
  389.   // output, even if you don't use it:
  390.   pinMode(chipSelect, OUTPUT);

  391.   // see if the card is present and can be initialized:
  392.   if (!SD.begin(chipSelect)) {
  393.     //Serial.println("FAIL");
  394.     // don't do anything more:
  395.     // Want to turn on an ERROR LED here
  396.     return;
  397.   }
  398. }

  399. // Converts a decimal to BCD (binary coded decimal)
  400. byte DecToBcd(byte value){
  401.   return (value / 10 * 16 + value % 10);
  402. }

  403. // This routine pulls the string stored in program memory so we can use it
  404. // It is temporaily stored in the stringBuffer
  405. char* getString(const char* str) {
  406.         strcpy_P(stringBuffer, (char*)str);
  407.         return stringBuffer;
  408. }

  409. //Initialise the RTC
  410. void initialiseRTC()
  411. {
  412.   // This section configures the RTC to have a 1Hz output.
  413.   // Its a bit strange as first we read the data from the RTC
  414.   // Then we load it back again but including the correct second flag  
  415.   rtc.formatDate(RTCC_DATE_WORLD);
  416.   rtc.formatTime();
  417.   
  418.   year_int = rtc.getYear();
  419.   day_int = rtc.getDay();
  420.   month_int = rtc.getMonth();  
  421.   hour_int = rtc.getHour();
  422.   min_int = rtc.getMinute();
  423.   sec_int = rtc.getSecond();
  424.   
  425.   Wire.begin(); // Initiate the Wire library and join the I2C bus as a master
  426.   Wire.beginTransmission(I2C_RTC); // Select RTC
  427.   Wire.write(0);        // Start address
  428.   Wire.write(0);     // Control and status 1
  429.   Wire.write(0);     // Control and status 2
  430.   Wire.write(DecToBcd(sec_int));     // Second
  431.   Wire.write(DecToBcd(min_int));    // Minute
  432.   Wire.write(DecToBcd(hour_int));    // Hour
  433.   Wire.write(DecToBcd(day_int));    // Day
  434.   Wire.write(DecToBcd(2));    // Weekday
  435.   Wire.write(DecToBcd(month_int));     // Month (with century bit = 0)
  436.   Wire.write(DecToBcd(year_int));    // Year
  437.   Wire.write(0b10000000);    // Minute alarm (and alarm disabled)
  438.   Wire.write(0b10000000);    // Hour alarm (and alarm disabled)
  439.   Wire.write(0b10000000);    // Day alarm (and alarm disabled)
  440.   Wire.write(0b10000000);    // Weekday alarm (and alarm disabled)
  441.   Wire.write(0b10000011);     // Output clock frequency enabled (1 Hz) ***THIS IS THE IMPORTANT LINE**
  442.   Wire.write(0);     // Timer (countdown) disabled
  443.   Wire.write(0);     // Timer value
  444.   Wire.endTransmission();   
  445. }

  446. // Display the data for the serial LCD display
  447. void displayData()
  448. {
  449.       // Here we display the data in the correct format for the LCD serial display
  450.       // Data is displayed on a serial LCD screen (another Arduino)
  451.       // Data is in a grid 40 x 2, but only the first 16 char on each line is shown
  452.       
  453.       // Data is displayed:
  454.       // Ta:XXXC Ts:XXXC
  455.       // T:XXXXs  MODE
  456.       
  457.       // We need to know the legth of Ta, Ts and T in order to display this properly
  458.       // MODE will display which section of the relflow curve we are in
  459.       // It will also say if running or stopped
  460.       
  461.       Serial.print("Ta:");
  462.       Serial.print(actualTemp);
  463.       //Serial.print(" ");
  464.       for(int t=0;t<(5-String(actualTemp).length());t++)
  465.       {
  466.         Serial.print(" ");
  467.       }
  468.       Serial.print("Ts:");
  469.       Serial.print(tempSetpoint);
  470.          
  471.       for(int t=0;t<(29-String(tempSetpoint).length());t++)
  472.       {
  473.         Serial.print(" ");
  474.       }      
  475.       
  476.       Serial.print("T:");
  477.       Serial.print(totalFromStart);
  478.          
  479.       for(int t=0;t<(6-String(totalFromStart).length());t++)
  480.       {
  481.         Serial.print(" ");
  482.       }
  483.       
  484.       // Here we want to display the mode.
  485.       // This is figured out from the dataPoint number
  486.       switch(dataPoint)
  487.       {
  488.         case 0:
  489.           Serial.print("Warm");
  490.           return;
  491.         case 1:
  492.           Serial.print("Soak");
  493.           return;
  494.         case 2:
  495.           Serial.print("Peak");
  496.           return;
  497.         case 3:
  498.           Serial.print("Reflow");
  499.           return;
  500.         case 4:
  501.           Serial.print("Cool");
  502.           return;         
  503.         case 100:
  504.           Serial.print("STOPPED");
  505.           return;
  506.         default:
  507.           Serial.print("ERROR");
  508.       }                     
  509.       for(int t=0;t<(10);t++)
  510.       {
  511.         Serial.print(" ");
  512.       }
  513.       Serial.println(" ");
  514. }  
复制代码


Testing
Here are some photos from initial testing. It worked OK, but did not get up to warm temperature quick enough. I ran through one cycle and then tried it again and it worked much better. I think I need a slightly longer warm up cycle, but this is adjustable via the SD card.
You can see the temperature probe near the surface of the test piece of board.


The test was just an old copper clad board with some flux and solder paste on it. But it did flow.
</starttemp)
</starttemp)
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享分享 支持支持 反对反对
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|文字版|手机版|DIY编程器网 ( 桂ICP备14005565号-1 )

GMT+8, 2024-12-26 14:17 , 耗时 0.132894 秒, 21 个查询请求 , Gzip 开启.

各位嘉宾言论仅代表个人观点,非属DIY编程器网立场。

桂公网安备 45031202000115号

DIY编程器群(超员):41210778 DIY编程器

DIY编程器群1(满员):3044634 DIY编程器1

diy编程器群2:551025008 diy编程器群2

QQ:28000622;Email:libyoufer@sina.com

本站由桂林市临桂区技兴电子商务经营部独家赞助。旨在技术交流,请自觉遵守国家法律法规,一旦发现将做封号删号处理。

快速回复 返回顶部 返回列表