Jacob EasonHunter Ketchie
Published

MEGR 3171 IOT Temperature Sensor Team 4

The BBQ buddy will tell you what temperature your grill or oven is from anywhere in your house!

IntermediateFull instructions provided19
MEGR 3171 IOT Temperature Sensor Team 4

Things used in this project

Hardware components

Argon
Particle Argon
×2
Jumper wires (generic)
Jumper wires (generic)
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
ELEGOO Upgraded 37 in 1 Sensor Modules Kit V2.0
ELEGOO Upgraded 37 in 1 Sensor Modules Kit V2.0
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1
Breadboard (generic)
Breadboard (generic)
×2
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×2

Software apps and online services

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

Story

Read more

Schematics

Temperature LCD Schematic

Temperature Schematic

Temperature LCD Configuration

Temperature Sensor configuration

Temperature Sensor configuration 2

Code

LCD Display Code

C/C++
// This #include statement was automatically added by the Particle IDE.
#include <LiquidCrystal.h>

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

LiquidCrystal lcd(5, 4, 3, 2, 1, 0);

void setup() {
  lcd.begin(16, 2);
  // Display oven temperature on LCD
  lcd.print("Oven Temperature:");
  //Subscribe to cloud to grab data given from other particle argon
      Particle.subscribe("temp", temper, ALL_DEVICES);
  
}
  void temper(const char *event, String data ) 
  {
 int dvalue;
dvalue = String(data).toInt();
  lcd.begin(0,0 );
  lcd.print("Oven Temperature:");
    // do something with the temperature value, such as display it on an LCD screen
    
    lcd.setCursor(0, 1);
    //Print data value
    lcd.print(dvalue);
    lcd.print("'Fahrenheit");
}
void loop()
{
    delay(10000);
    // display every 10 seconds
}

Temperature Sensor Code

C/C++
// Temperature sensor is on pin A0
int tempPin = A0;


// Create a value to store temperature in 
double tempC = 0.0;
double tempF = 0.0;

void setup()
{
  // Particle Variable
  Particle.variable("tempC", &tempC, DOUBLE);
  Particle.variable("tempF", &tempF, DOUBLE);  

// Temperature sensor A0 is now an input
  pinMode(tempPin, OUTPUT);
}

void loop() {
  // Reads the value of the pin
  int reading = analogRead(tempPin);

  // The returned value from the device is going to be in the range from 0 to 4095
  
  // Calculate the voltage from the sensor reading
  double voltage = (reading * 2.5) / 4095.0;

  // Calculate the temperature in degrees celsius
  tempC = (voltage - 0.5) * 100;

  // Now convert to Farenheight
  tempF = ((tempC * 9.0) / 5.0) + 32.0;


  String temp = String(tempF);
  Particle.publish("temp", temp, PRIVATE);
  
  // Wait for 10 seconds
  delay(10000); 

}

Credits

Jacob Eason

Jacob Eason

1 project • 1 follower
Hunter Ketchie

Hunter Ketchie

1 project • 0 followers

Comments

Add projectSign up / Login