Robert Korn
Published © MIT

Bacon With A Blynk

I've made a few smoker controllers in the past and monitoring tools to go with them.

BeginnerFull instructions provided1 hour2,407
Bacon With A Blynk

Things used in this project

Hardware components

SparkFun Blynk Board - ESP8266
SparkFun Blynk Board - ESP8266
×1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1
Meat Thermometer Probe
×1
Resistor 100k ohm
Resistor 100k ohm
×1
Resistor 4.75k ohm
Resistor 4.75k ohm
×1

Software apps and online services

Blynk
Blynk
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Schematic

Code

Arduino IDE Sketch

Arduino
/**************************************************************
 * Blynk is a platform with iOS and Android apps to control
 * Arduino, Raspberry Pi and the likes over the Internet.
 * You can easily build graphic interfaces for all your
 * projects by simply dragging and dropping widgets.
 *
 *   Downloads, docs, tutorials: http://www.blynk.cc
 *   Blynk community:            http://community.blynk.cc
 *   Social networks:            http://www.fb.com/blynkapp
 *                               http://twitter.com/blynk_app
 *
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 *
 **************************************************************
 * This example runs on Sparkfun Blynk Board.
 *
 * You need to install this for ESP8266 development:
 *   https://github.com/esp8266/Arduino
 *
 * NOTE: You can select NodeMCU 1.0 (compatible board)
 * in the Tools -> Board menu
 *
 * Change WiFi ssid, pass, and Blynk auth token to run :)
 *
 **************************************************************/

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <DHT.h>

int sensorPin = A0; 
int sensorValue = 0; 
int probeTemp = 0; 

SimpleTimer timer;

WidgetLED led1(V7);
WidgetLED led2(V6);

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "auth token goes here";

#define DHTPIN 0     
#define DHTTYPE DHT11     // DHT 11
//#define DHTTYPE DHT22   // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21   // DHT 21, AM2301

DHT dht(DHTPIN, DHTTYPE,11);

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "SSID";
char pass[] = "password";

void sendNotify()
{
  long uptime = millis() / 1000L;

  // Actually send the message.
  // Note:
  //   We allow 1 notification per 15 seconds for now.
  Blynk.notify(String("Running for ") + uptime + " Seconds.");
}

void sendSeconds() {
  
 if (led1.getValue()) {
    led1.off();
  } else {
    led1.on();
  }

}
  void send5Seconds() {
  sensorValue = analogRead(sensorPin);

// 34 = 886 , 68 = 766 , 150 = 350 , 185 = 270 , 200 = 190
   probeTemp = map(sensorValue, 350, 190, 150, 200);
     
  Blynk.virtualWrite(V2,probeTemp);
  Blynk.virtualWrite(V3,probeTemp);

  float h = dht.readHumidity();
  float t = dht.readTemperature(true); // or dht.readTemperature(true) for Fahrenheit

  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
  
  Blynk.virtualWrite(V8, t);
  Blynk.virtualWrite(V9, h);
  
}

BLYNK_WRITE(V4)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V4 to a variable
  // You can also use:
  // String i = param.asStr();
  // double d = param.asDouble();
  Serial.print("V4 value is: ");
  Serial.println(pinValue);
}

BLYNK_WRITE(V5)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V5 to a variable
  // You can also use:
  // String i = param.asStr();
  // double d = param.asDouble();
  Serial.print("V5 value is: ");
  Serial.println(pinValue);
  digitalWrite(5, pinValue);
}


void setup()
{
  Serial.begin(9600);
  pinMode(5, OUTPUT);

  Blynk.begin(auth, ssid, pass);
  
  // Setup a function to be called every second
  timer.setInterval(1000L, sendSeconds);
  timer.setInterval(5000L, send5Seconds);
//  timer.setInterval(20000L, sendNotify);

  while (Blynk.connect() == false) {
    // Wait until connected
  }
}

void loop()
{
  Blynk.run();
  timer.run();
}

Credits

Robert Korn

Robert Korn

15 projects • 27 followers
I Made the Internet of Things before people had a name for it.

Comments