Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Christopher ReidMichael Wiesecke
Published © GPL3+

Smart Meat Smoker Monitor

Our project is to give the ease of an electric smoker with the flavor of a charcoal smoker.

BeginnerFull instructions provided5 hours67
Smart Meat Smoker Monitor

Things used in this project

Hardware components

ELEGOO 3pcs MB-102 Breadboard 830 Point Solderless Prototype PCB Board Kit
ELEGOO 3pcs MB-102 Breadboard 830 Point Solderless Prototype PCB Board Kit
×1
Miuzei 20KG Servo Motor High Torque RC Servo Metal Gear
×1
HiLetgo K Type Temperature Sensor
×1
MAX6675 Temperature Sensor Module
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
ThingSpeak API
ThingSpeak API

Story

Read more

Schematics

Circuit Diagram

Code

ReadTemp

C/C++
Copy and paste to a particle app and flash it to a particle device to use it.
#include <Particle.h>
int SA = 0;

// Servor handler
void ServoHandler(const char *event, const char *data);

#define CS_MAX D18 // Chip Select pin for MAX6675

double temp;

void setup() {
  Serial.begin(9600);
  pinMode(CS_MAX,OUTPUT); // MAX6675 /CS Line must be an output for hardware SPI
  digitalWrite(CS_MAX,HIGH); // Set MAX7765 /CS High
  SPI.begin(D18); // Init SPI
  SPI.setBitOrder(MSBFIRST); // Sets the order of the bits shifted out of and into the SPI bus
  SPI.setDataMode(SPI_MODE1); // Base value of clock is 1, data is captured on clock's falling edge
  Particle.subscribe("Servo Angle", ServoHandler);
  Particle.variable("Temperature", temp);
}

void ServoHandler(const char *event, const char *data) {
  // Convert the received data to a double
   SA = atof(data);
// Callback function to handle the "Temperature" event
//Particle.publish("ReceivedTemp",String(tempF));


}
void loop() {
  uint16_t v; // Variable to store the raw data from MAX6675
  double tempC; // Variable to store the temperature in Celsius
  double temp; // Variable to store the temperature in Celsius
  digitalWrite(CS_MAX,LOW); // Pull MAX7765 /CS Low
  v = SPI.transfer(0x00); // Send dummy byte and read MSB of data
  v <<= 8; // Shift MSB to left
  v |= SPI.transfer(0x00); // Send dummy byte and read LSB of data
  digitalWrite(CS_MAX,HIGH); // Set MAX7765 /CS High
  if (v & 0x4) { // Check if thermocouple is connected
    Serial.println("No thermocouple attached!");
    return;
  }
  v >>= 3; // Discard the first three bits
  tempC = v * 0.25; // Convert raw data to temperature in Celsius
  temp = (tempC * (9/5)) + 32;
  Serial.print("Temperature: ");
  Serial.print(tempC);
  Serial.println(" C");
  //Particle.publish("Temperature", String(tempC));
  Particle.publish("Temperature", String(temp));
  Particle.publish("Recieved Servo Angle", String(SA));

delay(5000); // Wait for a second  
}

MotorControl

C/C++
Copy and paste to a particle app and flash it to a particle device to use it.
#include "Particle.h"
double tempF = 0;
const int servoPin = D1; 
Servo myServo;

// Define the Particle function prototype
void temperatureHandler(const char *event, const char *data);
int SA;
// Setup function
void setup() {
  // Connect to the Particle Cloud
  //Particle.connect();
  myServo.attach(servoPin);  
  // Subscribe to the "Temperature" event
  Particle.subscribe("Temperature", temperatureHandler);
   pinMode(D3,OUTPUT);
  pinMode(D4,OUTPUT);
  pinMode(D5,OUTPUT);
  Particle.variable("Servo Angle", SA);
  
  
}
void temperatureHandler(const char *event, const char *data) {
  // Convert the received data to a double
  tempF = atof(data);
// Callback function to handle the "Temperature" event
//Particle.publish("ReceivedTemp",String(tempF));
}
void loop()
{
  int SA = 0;
  
  if ( tempF > 120) {
    // Set servo to 0
    SA = 0;
    myServo.write(SA);
    delay(15);  
  }    
  else if (tempF > 90){
   // Set servo to 90
  SA=45;
    myServo.write(SA);
    delay(15);  // Adjust the delay as needed
  
  }
  else  {
    // set servo position to 180
    SA=90;
    myServo.write(SA);
    delay(15);  // Adjust the delay as needed
 
  }
  Particle.publish("Servo Angle", String(SA));
  Particle.publish("Recieved Temp", String(tempF));
  
delay(5000); // Wait for a second  
}

Credits

Christopher Reid
1 project • 1 follower
Contact
Michael Wiesecke
0 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.