iriandaabdullah
Published © GPL3+

Ubidots Dht 11

Featuring a great room temperature display with ubidots platform

IntermediateFull instructions provided1 hour675
Ubidots Dht 11

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
Jumper wires (generic)
Jumper wires (generic)
×1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1

Software apps and online services

Ubidots
Ubidots

Story

Read more

Code

dht

C/C++
#include "DHT.h"
#include "UbidotsMicroESP8266.h"
#define DHTPIN 5//pin sensor DHT di pin D1

#define TOKEN "xxxxxxxxxx"  //beda
#define ssid "xxxxxxxxxxx"
#define pswd "xxxxxxxxxxx"

 DHT dht(DHTPIN,DHT11);
 Ubidots client(TOKEN);
 unsigned long last =0;

void setup() {

  Serial.begin(9600);
  dht.begin();
  delay(20);
  client.wifiConnection(ssid,pswd);  // klau ssid memakai pass
 
  //  client.wifiConnection(ssid,NULL); // klau ssid tdk memakai pass
}

void loop() {

  if(millis()-last>1000){
    float hum = dht.readHumidity();
    float temp = dht.readTemperature();
    last=millis();
    client.add("kelembaban",hum);
    client.add("Temp",temp);
    client.sendAll(true);
  }
}

Credits

iriandaabdullah
5 projects • 2 followers
Iam a web frontend and android developer, I went to college in the Information Technology major.

Comments