yilmazyurdakul
Published © GPL3+

Temperature Monitor with IoT

Blynk app makes everything easy! Notifications, settings, probe, battery level and more...

AdvancedFull instructions provided51
Temperature Monitor with IoT

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1
Adafruit Waterproof DS18B20 Digital temperature sensor
Adafruit Waterproof DS18B20 Digital temperature sensor
×1
Arduino Nano 33 IoT
Arduino Nano 33 IoT
×1
Arduino MKR WiFi 1010
Arduino MKR WiFi 1010
×1

Software apps and online services

Blynk
Blynk
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Code

Arduino IDE Codes

Arduino
This is esp8266 code
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

#include <dht11.h>
#define DHT11PIN 14
dht11 DHT11;


char auth[] = "uGDn56XGhJS7TkEb0D_gAzkFL66czQDs";
char ssid[] = "y-home";
char pass[] = "Yurdakul9988!";
BlynkTimer timer;


int temp;
int lowTemp;
int hiTemp;
float ambTemp;
float ambHum;

byte notifState = 0;

bool isFirstConnect = true;
BLYNK_CONNECTED() {
  if (isFirstConnect) {
    Blynk.syncAll();
    isFirstConnect = false;
  }
}

void setup()
{

  Blynk.begin(auth, ssid, pass);
  timer.setInterval(60000L, tempSend);
  timer.setInterval(5000L, probeSend);
  timer.setInterval(5000L, notifSend);
  sensors.begin();
}

BLYNK_WRITE(V1) {
  byte value = param.asInt();
  lowTemp = value;
}

BLYNK_WRITE(V2) {
  byte value = param.asInt();
  hiTemp = value;
}

BLYNK_WRITE(V3) {
  byte value = param.asInt();
  notifState = value;
}

void tempSend() {

  int chk = DHT11.read(DHT11PIN);
  ambTemp = (float)DHT11.temperature;
  ambHum = (float)DHT11.humidity;
  Blynk.virtualWrite(V11, ambTemp);
  Blynk.virtualWrite(V12, ambHum);

  // Blynk.setProperty(V0, "color", "#FF0000");
  // Blynk.setProperty(V0, "color", "#00FF00");
}

void probeSend() {
  sensors.requestTemperatures();
  temp = sensors.getTempCByIndex(0);
  Blynk.virtualWrite(V10, temp);
}

void notifSend() {
  if (notifState == 1 && ambTemp >= hiTemp) {
    Blynk.notify("Oda sicakligi cok yusek!");
    delay(300);
    Blynk.virtualWrite(V3, 0);
    notifState = 0;
  }
  if (notifState == 1 && ambTemp <= lowTemp) {
    Blynk.notify("Oda sicakligi cok dusuk!");
    delay(300);
    Blynk.virtualWrite(V3, 0);
    notifState = 0;
  }
}


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

Credits

yilmazyurdakul

yilmazyurdakul

8 projects • 15 followers

Comments

Add projectSign up / Login