Using a Photon to control my Sawtooth Pellet Smoker & access over the internet

Sawtooth Pellet Smoker control using a Photon.


I have a Sawtooth Pellet Grill, Model SPG-610 (SawtoothPelletGrills.com) that came with an analog control setup. The manufacturer offers an electronic control setup for an investment of $175.00!!! I cannot bring myself to pay that amount, as it has no remote monitoring or control capabilities, and one of their competitors (Traeger) offers the upgrade to electronic controls for a mere $60.00! The current controls consist of:

  1. A DPST rocker switch for POWER.
  2. A PRIME button (for cold weather startups).
  3. A START button.
  4. An LED to indicate POWER.
  5. A rheostat that goes from LOW to HIGH and is infinitely variable between the two.

I have used this smoker at a few BBQ competitions over the last year, and from transporting the grill around, the rheostat has become wobbly. Last weekend I was smoking a Corned Beef Brisket (making Pastrami) and I could not control the temperature at all! Turning the know up 1/16" would swing my temperature from 158 degrees up to 385 degrees in a matter of 5 minutes! Unacceptable! Time to do something about these horrible controls!

So here’s my plan…


I ordered a Photon, a rubber duck antenna and a Relay Shield for this project. I also have some other components on hand to use in this project. I need to control the Fan, Igniter and Auger Motor (all 120V and minimal amp draw, other than ignitor (300W @ 120V=2.5A)). That will be done through the Relay Shield. I also have already mounted a 6" long, stainless steel probe in the smoker, 1" above the cooking grate, to measure smoker temp (@ grate). I am using an Adafruit Thermocouple Amplifier (Analog Output K-Type Thermocouple Amplifier - AD8495 Breakout, PRODUCT ID: 1778) and would like to use this LCD Screen w/buttons I purchased also (RGB LCD Shield Kit w/ 16x2 Character Display - Only 2 pins used! - NEGATIVE DISPLAY, PRODUCT ID: 714). Everything would be powered up by a 9V Wall Wort style transformer with barrel connector and the 120V side would be powered through the power cord that came installed on the smoker.


Please note that I only have one project using a Photon board under my belt (a garage door opener that can be used over the internet (I have a secure, hosted website), via my iPhone or Apple Watch using IFTTT). I have a bit of experience on the Arduinos and currently have a mini breadboard and a Red Board wired up with the aforementioned thermocouple and amplifier and LCD Display to display the grate temperature in the smoker. (I was trying to see how accurate the dome thermometer was that came with the grill…let’s just say…whoa!).


Other aspirations with this project would be to be able to mount it all in the same location that the original control were in and to also be able to control the smoker (setpoint, startup mode and smoker temp) from either a website or an app. I plan on bringing a router with me to future BBQ Competitions to be able to access this information with or without internet access.

I have a few ideas on how to implement these things, but any help would be greatly appreciated!! I know I will run into some snags, especially on the software side and I am going to have to figure out auger on/off time through trial and error (more than likely) unless someone has some ideas on that!


Here’s some info on the grill:

**

1 Like

Here’s a picture of the UPGRADE control (lol!):

And here’s the wiring diagram, per the manufacturer:

1 Like

Just a little concerned if you are bring the smoker out to the field for competition and having it remotely controlled over the internet might bring about issues. :stuck_out_tongue:

I would personally create a physical switch + knob control and remote setting comes as a feature and not a must.

LOL! That’s nothing new! Don’t worry, I will lock down access! Can’t let the competition mess with me like that! The LCD Display I have, does have 5 buttons on it, so local control is absolutely doable!

1 Like

Hope to see your progress as you work on the project. :smiley:

1 Like

So, do you want to do a direct TCP connection between the Photon and an iPhone?

How is the auger controlled now? Does the knob control the speed of the auger, or some on/off cycle? Is the temperature controlled by the speed that the pellets are added to the smoker?

This sounds like an interesting project. If you need some help, particularly on the iOS side, I’d be glad to lend you a hand.

1 Like

If you can configure your mobile to be a wireless hotspot, that’d save you the hassle of creating local communication since you can then just use the cloud features. That said, definitely do built in manual control, that’s always convenient.

A direct connection would work too. I can’t remember if the Photon is Internet only or can it be accessed over Wi-Fi? Wi-Fi would be a little easier, but the way I have my Garage Door Opener Photon, I can access it from a web page.

The manufacturer doesn’t publish their on/off times of the auger that I know of. The knob allows the grill to feed pellets for a longer period of times between off cycles. For instance it might feed pellets for 5 seconds, then turn auger off for 4 seconds. It just keeps repeating this cycle. It doesn’t know what temperature the grill is, you have to manually adjust the knob to get the temperature dialed in to your liking. The down side is, ambient temperature plays a huge role in this! The know setting you finally figured out to keep the smoker @ 250 degrees on a 60 degree day is not the same setting as on a 30 degree day.

I more than likely will need that help on the iOS side!! :wink: Thanks Ric!

@Moors7

That’s not a bad idea Jordy! Yes, manual control will be part of the build for sure!

Does anyone know if I need to use pull-up resistors on the I2C lines for the Adafruit 714 LCD Display I mentioned at the top of this post with the Photon?

Hi @JayBirde

From the Adafruit assembly instructions for that display, it looks like R1 and R2 are 4.7kohm pull-up resistors for the i2c lines. I do not think you need external resistors and it won’t hurt anything to try it without them anyway, so go for it!

Thanks Brian…lesson learned…RTFM! Thank you! :grimacing:

OK. Next question for anyone who wants to answer… :wink:

I have been killing myself trying to figure out what the heck I am doing wrong in trying to get this Adafruit 1778 Analog Output K-Type Thermocouple Amplifier to work with my Photon.

Here’s the details: I have both Grounds from the Amplifier to ground on Photon, V+ is connected to +5VDC on Photon, and OUT is connected to pin A1 on the Photon. (I had this working with my Arduino before).

Here’s the code (sorry, but figured I should just post it all…some of it should also be ignored…trying a few things).

// This #include statement was automatically added by the Particle IDE.
#include "PID-AutoTune/PID-AutoTune.h"

// This #include statement was automatically added by the Particle IDE.
#include "pid/pid.h"

// This #include statement was automatically added by the Particle IDE.
#include "Adafruit_RGBLCDShield/Adafruit_RGBLCDShield.h"

int igniter = D3;       // Igniter connected to D3 (Relay 1)
int auger = D4;         // Auger connected to D4 (Relay 2)
int fan = D5;           // Fan connected to D5 (Relay 3)\
// Smoker temperature probe
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();

// These #defines make it easy to set the backlight color
#define RED 0x1
#define YELLOW 0x3
#define GREEN 0x2
#define TEAL 0x6
#define BLUE 0x4
#define VIOLET 0x5
#define WHITE 0x7
float Vout; 
float temp;

void setup() {


pinMode(igniter, OUTPUT);   // Sets pin as output
pinMode(auger, OUTPUT);     // Sets pin as output
pinMode(fan, OUTPUT);       // Sets pin as output
pinMode(A1, INPUT);       // Sets pin as input
Wire.begin();

// Debugging output
  Serial.begin(9600);
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);

  // Print a message to the LCD.
  uint32_t freemem = System.freeMemory();
  lcd.clear();
  lcd.print("free memory: ");
  lcd.println(freemem); 
  delay(2000);
  lcd.clear();
  lcd.print("Sawtooth Control");
  lcd.setCursor(0,1);
  lcd.print("Version 2.0");
  delay(1000);
  lcd.clear();
  lcd.print("Temperature:");
  lcd.setCursor(0,1);
  Vout = analogRead(A1);
  temp = (Vout-1,25)/0,005;
  lcd.println(temp);
  delay(500);
  lcd.setBacklight(WHITE);
}

uint8_t i=0;


void loop() {
    
  

digitalWrite(igniter, HIGH);
digitalWrite(fan, HIGH);
digitalWrite(auger, HIGH);
//delay(3000);
//digitalWrite(auger, LOW);
//delay(2000);


  uint8_t buttons = lcd.readButtons();

  if (buttons) {
    lcd.clear();
    lcd.setCursor(0,0);
    if (buttons & BUTTON_UP) {
      lcd.print("Left-Cold Start");
      lcd.setCursor(0,1);
      lcd.print("Right-Warm Start");
      lcd.setBacklight(WHITE);
    }
    if (buttons & BUTTON_DOWN) {
      lcd.print("DOWN ");
      lcd.setBacklight(WHITE);
    }
    if (buttons & BUTTON_LEFT) {
      lcd.print("Select to Start");
      lcd.setBacklight(RED);
    }
    if (buttons & BUTTON_RIGHT) {
      lcd.print("RIGHT ");
      lcd.setBacklight(TEAL);
    }
    if (buttons & BUTTON_SELECT) {
      lcd.print("Startup");
      lcd.setCursor(0,1);
      lcd.print("Initiated!");
      lcd.setBacklight(WHITE);
    }
  }
}

Cool project.

You can use Blynk to view current temp and status plus change settings from the Blynk app on your iPhone or Android. It’s a pretty slick app that should allow you to do all you want to do without needing to create some custom app. http://www.blynk.cc/

Blynk has a library in the online IDE if you want to check it out.

1 Like

@JayBirde, can you Serial.print() the analog reading from the thermocoupler and see if you get any reading?

I used lcd.print and got something like 1629.36 and a couple of Chinese symbols. The reading never changed if I grabbed the probe. I took a voltage reading on A1 & did the math and the thermocouple is reading about 52 degrees which was pretty accurate.

When I flash this code, the unit resets and then gets stuck where the LCD just displays “Temperature” then the Photon flashes a combination of red flashes. I have to put the Photon into Safe Mode & re flash.

Your loop needs to continuously poll the analogRead value to get updates. Can you try that? :slight_smile:

I’d say you should use a “point” (.) instead of a “comma” (’,’) as your decimal seperator.
And for good coding instead of x / 0.005 it’d be better to use x * 200.

BTW: The max output of analogRead() will be 4095 while on Arduinos it’s 1023 - this might needs to be considered in the calculation too.

You also need to make sure the output of your sensor never exceedes 3.3V.

2 Likes

Thanks for the idea Ryan! I actually have Blynk on my phone already!

@kennethlimcp I moved the code down to the void loop section. Nice catch! Didn’t realize I had it in the setup! Forest for the trees!

@ScruffR I made your recommended changes to the code and did the math from the amplifier, you are right! My divisor before was based on 1024 output and the Photon is 4096. So instead of a .005 divisor, it would actually be .0008! Huge difference! Thank you!

So here’s where I am at right now. Still getting really weird temp measurements on the display (319850.00). I decided to try and simplify things down to an easier to understand level and maybe be able to figure out what is going on! The thermocouple amplifier is connected as such:
+V connected to 3V3 on Photon
GND connected to GND on Photon
OUT connected to A1 on Photon

I also modified the temp = line in the code to look like this:

temp = Vout

I thought, this way I can see the ACTUAL voltage reading coming in to the A1 pin on the display.

I measured from GND to A1 and am getting 1.289 VDC

The display, however, is showing 1592.00

Next, I moved the OUT of amplifier to A2 pin (thinking there is something possibly wrong with A1), but got the same exact reading!

Can anyone possibly tell me what is going on?

Thanks in advance!

Doing the math here

You get 1592 as analog reading where 3.3V would give you 4095.
So (3.3V / 4095) * 1592 = 1.283V (pretty close) and if you measure your 3V3 pin and set this reading instead of 3.3V, you’ll be even closer, I’d say.