Project in progress
Grill & Deck-Door Monitor

Grill & Deck-Door Monitor © GPL3+

Monitors if our barbecue grill is on, displays the grill temperature, and checks if it's okay to leave the deck-door open.

  • 978 views
  • 0 comments
  • 1 respect

Components and supplies

About this project

We use our barbecue grill and our deck frequently. After once leaving the grill on all night, I wanted an easy way to check to make sure the grill is off before going to bed. This is especially important since our grill is tapped into our natural gas line and will stay on forever if we don't shut if off. We also like to leave our deck door open when it's nice out but it bugs me when I notice the door open and cool air is coming in, sometimes kicking on the furnace.

The goal of this project was to:

  • Display the inside and outside ambient temperatures on an OLED in the kitchen,
  • Light a red LED if the grill is on (i.e., grill temp exceeds a pre-determined temperature),
  • Display the grill temperature when it's on,
  • Light a blue LED if the temperature outside is colder than inside and the deck door is open and display a message indicating the deck-door should be closed.

Since I'm new to both programming and electronics, this project took me quite a few hours to complete but it was a great challenge, it was fun, and I'm happy with the results.

There are quite a few wires inside the device, some of which are shown on the following photo. You end up with even more after you run the signal wires (2 temperature sensors, magnetic door switch, thermocouple, power) to the box.

Everything fit snugly inside a 1-gang switch box. I would rather use a 2-gang box for more room but we already had an unused 1-gang box mounted in the perfect location in the kitchen backsplash.

Normally, the OLED will display the indoor and outdoor ambient temperatures.

If we open the deck door and the outside temperature relative to the inside temperature indicates we're probably loosing heat, a blue LED will light and the OLED will display a message telling us to close the door.

Once we turn on the barbecue grill and the temperature inside the grill exceeds 120F, a red LED lights and the grill temperature is displayed on the OLED. The grill operation overrides all other functions.

A couple notes regarding the code. First off, I'm sure there are better ways to do the coding. As mentioned, I'm new to this game so I'm open to suggestions for improvements. In general, my code works. I'm having one issue where the grill temp occasionally scrambles and then returns to normal. I haven't had time to figure out what's going on. I'll get to it someday.

Code

Grill & Deck-Door MonitorArduino
This code is for an Arduino Pro Mini 3.3V
//This code is for an Arduino Pro Mini 3.3V

//SET UP THE TMP36 SENSORS

int tmpOut = A0;//tmp sensor outside
int tmpIn = A1;//tmp sensor inside

const int numReadingsOut = 60;//This smooths out the readings
int readingsOut[numReadingsOut];
int indexOut = 0;
int totalOut = 0;
int averagetmpOut = 0;

const int numReadingsIn = 60;
int readingsIn[numReadingsIn];
int indexIn = 0;
int totalIn = 0;
int averagetmpIn = 0;

//SET UP THE DOOR CONTACT AND CLOSE NOTICE LIGHT

int magnetPin = 6;//to tell us if door is closed (LOW) or open (HIGH)
int blueLight = 5;//when this is on we need to close the door
boolean closeDoor = false;//we'll use this to determine what the OLED outputs

//SET UP THE OLED DISPLAY

#include <SFE_MicroOLED.h>
#include <Wire.h>
#include <SPI.h>
#define PIN_RESET 9  // Connect RST to pin 9 (req. for SPI and I2C)
#define PIN_DC    8  // Connect DC to pin 8 (required for SPI)
#define PIN_CS    10 // Connect CS to pin 10 (required for SPI)
MicroOLED oled(PIN_RESET, PIN_DC, PIN_CS); // Example SPI Declaration

//SET UP THE THERMOCOUPLE

#include <SparkFunMAX31855k.h> // Using the max31855k driver
// Define SPI Arduino pin numbers (Arduino Pro Mini)
const uint8_t CHIP_SELECT_PIN = 10; // Using standard CS line (SS)
// SCK & MISO are defined by Arduiino
const uint8_t VCC = VCC; // Powering board straight from Arduino Pro Mini
const uint8_t GND = GND;
// Instantiate an instance of the SparkFunMAX31855k class
SparkFunMAX31855k probe(CHIP_SELECT_PIN, VCC, GND);

//SET UP THE LED TO WARN GRILL IS ON

const int redPin = 7;

void setup() 
{
  delay(50);  // Let IC stabilize or first readings will be garbage
  oled.begin();
  pinMode(redPin, OUTPUT);
  digitalWrite(redPin, LOW);
  pinMode(magnetPin, INPUT_PULLUP);
  pinMode(blueLight, OUTPUT);
  digitalWrite (blueLight, LOW);

  for (int thisReadingOut = 0; thisReadingOut < numReadingsOut; thisReadingOut++)
  readingsOut[thisReadingOut] = 0;

  for (int thisReadingIn = 0; thisReadingIn < numReadingsIn; thisReadingIn++)
  readingsIn[thisReadingIn] = 0;
}


void loop() 
{
  float temperature = probe.readCJT();//for the thermocouple
  
  oled.clear(PAGE);//clear out the oled of previous garbage 

  totalOut = totalOut - readingsOut[indexOut];//need all this to average temp readings        
  readingsOut[indexOut] = analogRead(tmpOut); 
  totalOut = totalOut + readingsOut[indexOut];       
  indexOut = indexOut + 1;                    
  if (indexOut >= numReadingsOut)              
    indexOut = 0;                           
  averagetmpOut = totalOut / numReadingsOut; 

  float voltout = ((averagetmpOut)*3.3/1024.0);
  float tempOut = (((voltout-.5)*100*9.0/5.0)+32.0);

  totalIn= totalIn - readingsIn[indexIn];         
  readingsIn[indexIn] = analogRead(tmpIn); 
  totalIn= totalIn + readingsIn[indexIn];       
  indexIn = indexIn + 1;                    
  if (indexIn >= numReadingsIn)              
    indexIn = 0;                           
  averagetmpIn = totalIn / numReadingsIn;

  float voltin = ((averagetmpIn)*3.3/1024.0);
  float tempIn = (((voltin-.5)*100*9.0/5.0)+32.0);

  int magnetValState;//declare and read the door contact
  magnetValState = digitalRead(magnetPin);

//The following three (3) if statements compare the temperatures outside
//versus inside. I want it to be 2F warmer outside than inside to open the door.
//Once it drops to 2F colder outside than inside I want to shut the door. This
//gives us a 4F range.

if(magnetValState == LOW)//door closed
{
  digitalWrite(blueLight, LOW);//blue light off
  closeDoor = false;//logic for printing to OLED
}

if (magnetValState == HIGH && tempOut >= (tempIn+2.0))//door opened & warm
{
  digitalWrite(blueLight, LOW);//still no need for blue light
  closeDoor = false;//logic for printing to OLED

}
if (magnetValState == HIGH && tempOut <= (tempIn-2.0))//door open & cold
{
  digitalWrite(blueLight, HIGH);//turn on blue light to warn to close door
  closeDoor = true;//logic for printing to OLED
}
  
  temperature = probe.readTempF();//read thermocouple in F
  if (!isnan(temperature)) {

}

  if (temperature >= 120)//grill is "on" (hot), this overides other OLED displays
  {
    digitalWrite(redPin, HIGH);//red light remains on while grill is on
    oled.setFontType(3);//note the font size, it will change later
    oled.setCursor(0,0);
    oled.print(" ");//just to adjust the numbers to the center of the display
    oled.print(temperature,0);//prints grill temp in nice, big numbers
    oled.display();
  }
   
 if (temperature <= 116 && closeDoor == false)//grill is "cold", door closed
  {
    digitalWrite(redPin, LOW);
    oled.setFontType(1);//note the change in font size
    oled.setCursor(0,0);
    oled.print("Out ");
    oled.println(tempOut,0);//outside temp
    oled.println("");
    oled.print("In  ");
    oled.print(tempIn,0);//inside temp
    oled.display();

  }

if (temperature <= 116 && closeDoor == true)//grill "cold", door open, should shut
  {
    digitalWrite(redPin, LOW);
    oled.setFontType(1);
    oled.setCursor(0,0);
    oled.println(" Brrrr");
    oled.println(" CLOSE");
    oled.println(" DOOR!");
    oled.display();
  }

delay(1000);//a delay makes everything smoother

}

Schematics

Grill & Deck-Door Monitor Fritzing Diagram
grill_monitor_TPKZAF17lM.fzz

Comments

Similar projects you might like

FlowerPot Monitor

Project tutorial by Andrei Florian

  • 2,586 views
  • 1 comment
  • 13 respects

Broadcast Radio/TV Connection Monitor

Project showcase by WT040

  • 1,102 views
  • 0 comments
  • 1 respect

Air Quality Monitor Live Display

Project in progress by Parts Oven

  • 1,769 views
  • 0 comments
  • 7 respects

Monitor Your Garage Door

Project showcase by victormarinus

  • 4,424 views
  • 1 comment
  • 11 respects

Solar Powered (Beehive) Monitor Using Sigfox

Project showcase by Vilém Kužel

  • 3,571 views
  • 0 comments
  • 18 respects
Add projectSign up / Login