morning all, trying to get a my pressure sterilizer to maintain a specific temp with a thermo coupler and a uno how ever i can read them temp fine it prints it on the display but the control logic is not working at all, it switches it on but bot of any aqdvice would be great
#include <max6675.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
//temp control points
#define SETPOINT 114.0
#define DEADBAND 0.5
#define COOKER 10
#define ON true
#define OFF false
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
LiquidCrystal_I2C lcd(0X27, 2, 1, 0, 4, 5, 6, 7);
// make a cute degree symbol
uint8_t degree[8] = {140, 146, 146, 140, 128, 128, 128, 128};
void setup() {
pinMode(COOKER, OUTPUT);
digitalWrite (COOKER, OFF);
lcd.begin(16, 2);
lcd.setBacklightPin(3, POSITIVE);
lcd.setBacklight(HIGH);
lcd.createChar(0, degree);
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
delay (1000);
float t = thermocouple.readCelsius();
lcd.setCursor(0, 0);
lcd.print ("COOKER");
lcd.setCursor(7, 0);
lcd.print(t, 2);
lcd.setCursor(15, 0);
lcd.print("C");
// now we begin with the control logic
if (digitalRead(COOKER) == ON)
{
if ( t > SETPOINT + DEADBAND)
{
digitalWrite(COOKER, OFF);
}
else
{
if (t < SETPOINT - DEADBAND)
digitalWrite (COOKER, ON);
}
}
}