- This topic has 2 replies, 1 voice, and was last updated 4 years, 5 months ago by .
- You must be logged in to reply to this topic.
Home › Forums › Home automation (domotics) › DHT12 Esp8266 (D1Mini) OneWire conections & blynk
thanks a loot!! i use DHT12 Esp8266 (D1Mini) OneWire conections & blynk :
// //in blynk app use label value V0 and V1 for read data #define BLYNK_PRINT Serial #include <ESP8266WiFi.h> #include <BlynkSimpleEsp8266.h> #include <DHT12.h> #include <Wire.h> //The DHT12 uses I2C comunication. DHT12 dht12(D4, true); // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "***********"; // Your WiFi credentials. // Set password to "" for open networks. char ssid[] = "*********"; char pass[] = "********"; BlynkTimer timer; void myTimerEvent() { // You can send any value at any time. // Please don't send more that 10 values per second. Blynk.virtualWrite(V9, millis() / 1000); float tmp = dht12.readTemperature(); float hum = dht12.readHumidity(); Serial.printf("Temperatura: %2.2f*C Wilgotnosc: %0.2f%%\r\n", tmp, hum); Blynk.virtualWrite(V0, tmp); Blynk.virtualWrite(V1, hum); } void setup() {
// Debug console Serial.begin(9600); dht12.begin(); Blynk.begin(auth, ssid, pass); timer.setInterval(2000L, myTimerEvent);
} void loop() {
Blynk.run();
timer.run(); // Initiates BlynkTimer
}
Hi…you mention “-127 on Blynk” but this is nothing to do with Blynk. -127 is the default reading you get from a DS18B20 when you haven’t set it up correctly.So the way to proceed is to get the sensor working without Blynk and then Blynkify it. The internet has hundreds if not thousands of pages on the DS18B20.
Hi LottyZak,
The sensor is a DHT12, and the value -127 isn’t present.
Can you put an example of your idea.
Thanks Renzo
More
3D Printer 3D printer upgrade ABB Arduino Arduino IDE Arduino SAMD boards Aurora AWS CNC Cyclone PCB Factory Cyclone PCB Factory how to build It Display DynamoDB E32 E70 EByte esp01 esp32 esp8266 File System Firmware i2c Library LoRa MicroPython Milling PCB My PCB Networking PCB pinout Power saving Raspberry Pi REST API RF rp2040 SD Card Sensors Sleep and Wake UP SPI STM32 Temperature Tutorial Web Server Wemos D1 mini WiFi