iriandaabdullah
Published © GPL3+

Monitoring temperature with thinger. io

Create data for temperature by utilizing IoT and Platfrom thinger. io

IntermediateProtip1 hour2,523
Monitoring temperature with thinger. io

Things used in this project

Hardware components

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

Software apps and online services

Arduino IDE
Arduino IDE
Thinger.io Platform
Thinger.io Platform

Story

Read more

Code

Thinger,io

C/C++
#include <SPI.h>
#include <ESP8266WiFi.h> //ESP8266 WiFi connection library
#include <ThingerESP8266.h> //THINGER.IO library
#include “DHT.h”
#define DHTPIN D1
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
// Thinger.io connection parameters
#define user “triyan”
#define device_Id “test”
#define device_credentials “desember31”
ThingerESP8266 thing(user, device_Id, device_credentials);

void setup() {
pinMode(5,OUTPUT);
// Setup WiFi
thing.add_wifi(xx, xxx);
// Define the ‘thing’ with a name and data direction
thing[LED] << [](pson& in){
if(in.is_empty()){
in = (bool) digitalRead(5);
}
else{
digitalWrite(5, in ? HIGH : LOW);
}
};
thing[dht11] >> [](pson& out){
// Add the values and the corresponding code
out[humidity] = dht.readHumidity();
out[celsius] = dht.readTemperature();
};

}

void loop() {
thing.handle();
}

Credits

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

Comments

Please log in or sign up to comment.