WiFi Food Thermometer

Parts list:

Probe – Replacement Probe for Thermopro, current generic replacement on amazon

ESP12-E

Sainsmart 20×4 LCD Screen

Coding –

// Food Thermometer
// Tony Parenti
// December 2018
#include
#include #include #include
#include
#include
#include
#include
ESP8266WebServer server(80); //instantiate server at port 80 (http port)
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address
String page = "";
String text = "";
double data;
int val; //Create an integer variable
double temp; //Variable to hold a temperature value
const char *INFLUXDB_HOST = "192.168.1.12";
const uint16_t INFLUXDB_PORT = 8086;
const char *DATABASE = "smart_house";
const char *DB_USER = "tony";
const char *DB_PASSWORD = "Tony1!2";
ESP8266WiFiMulti WiFiMulti;
Influxdb influxdb(INFLUXDB_HOST, INFLUXDB_PORT);
void setup()
{
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Food Temperature");
lcd.setCursor(0,1);
lcd.print(" Food 1-");
lcd.setCursor(0,2);
lcd.print(" Food 1 Target-");
lcd.setCursor(0,3);
lcd.print(WiFi.localIP());
WiFiMulti.addAP("N900", "Inter1!2");
while (WiFiMulti.run() != WL_CONNECTED) {
delay(100);
}
influxdb.opendb(DATABASE, DB_USER, DB_PASSWORD);
server.on("/data.txt", [](){
text = Thermister(val);
//text = (String)Temp;
server.send(200, "text/html", text);
});
server.on("/", [](){page = "

Food Temperature

Current Temp:

""

\r\n";
page += "\r\n";
server.send(200, "text/html", page);
});
server.begin();
}
double Thermister(int RawADC) { //Function to perform the fancy math of the Steinhart-Hart equation
double Temp;
Temp = log(((10240000/RawADC) - 10000));
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
Temp = Temp - 273.15; // Convert Kelvin to Celsius
Temp = (Temp * 9.0)/ 5.0 + 32.0; // Celsius to Fahrenheit - comment out this line if you need Celsius
return Temp;
}
void loop()
{
val=analogRead(0); //Read the analog port 0 and store the value in val
temp=Thermister(val); //Runs the fancy math on the raw analog value
lcd.setCursor(9,1);
String tempString = "food1,method=HTTP_API,pin=A0 value=";
tempString += temp;
influxdb.write(tempString);
lcd.print(temp); //Print the value to the LCD
delay(1000); //Wait one second before we do it again
server.handleClient();
}

Rev 1

For easy prototyping i am using a nodemcu for now.

 

Here is the super simple circuit diagram

Leave a comment

Your email address will not be published. Required fields are marked *