Arduino Software Code
#include <LiquidCrystal.h>
#include <MAX31855.h>
// Adruino 1.0 pre-defines these variables
#if ARDUINO < 100
int SCK = 13;
int MISO = 12;
#endif
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);
double tempTC[4], tempCJC[4], tempTCf[4];
int CS1 = 10;
int CS2 = 9;
int CS3 = 8;
int CS4 = 7;
int LED = 6;
bool temp_unit = 0; // 0 = Celsius, 1 = Fahrenheit
MAX31855 temp1(SCK, CS1, MISO);
MAX31855 temp2(SCK, CS2, MISO);
MAX31855 temp3(SCK, CS3, MISO);
MAX31855 temp4(SCK, CS4, MISO);
void setup() {
Serial.begin(9600);
pinMode(LED, OUTPUT);
lcd.begin(20, 4);
}
void loop() {
tempTC[0] = temp1.readCelsius();
tempTCf[0] = temp1.readFahrenheit();
tempCJC[0] = temp1.readCJC();
tempTC[1] = temp2.readCelsius();
tempTCf[1] = temp2.readFahrenheit();
tempCJC[1] = temp2.readCJC();
tempTC[2] = temp3.readCelsius();
tempTCf[2] = temp3.readFahrenheit();
tempCJC[2] = temp3.readCJC();
tempTC[3] = temp4.readCelsius();
tempTCf[3] = temp4.readFahrenheit();
tempCJC[3] = temp4.readCJC();
for(int i=0; i<4; i++) {
Serial.print(i);
Serial.print(": ");
Serial.print(tempTC[i]);
Serial.print("/");
Serial.print(tempTCf[i]);
Serial.print("\t");
Serial.println(tempCJC[i]);
}
Serial.println(" ");
lcd.setCursor(0,0); //line 1, left margin
lcd.print("T0:");
lcd.setCursor(3,0);
lcd.print(tempTC[0]); //temp 0
lcd.setCursor(8,0);
lcd.print("C");
lcd.setCursor(11,0);
lcd.print("T1:");
lcd.setCursor(14,0);
lcd.print(tempTC[1]); //temp1
lcd.setCursor(19,0);
lcd.print("C");
lcd.setCursor(0,1); //line 1, left margin
lcd.print("T2:");
lcd.setCursor(3,1);
lcd.print(tempTC[2]); //temp 2
lcd.setCursor(8,1);
lcd.print("C");
lcd.setCursor(11,1); //line 2, left margin
lcd.print("T3:");
lcd.setCursor(14,1);
lcd.print(tempTC[3]); //temp3
lcd.setCursor(19,1);
lcd.print("C");
//digitalWrite(LED, HIGH);
// delay(1000);
// digitalWrite(LED, LOW);
delay(1000);
}
This coding was specific for the Team's requirements of wanting to analyze 4 different positions inside the reactor. Therefore the above code takes 4 different readings labeled T0, T1, T2, and T3. T0 represented the temperature reading at the bottom of the reactor nearest the burner while the temperature readings uniformly raised vertically towards the steel drum lid, i.e. T3 was the top most position near the lid.