- This topic has 2 replies, 1 voice, and was last updated 5 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
Just like a well-organized workbench, this website uses cookies to function properly and efficiently.
🛠️ The Essentials (Necessary): Some cookies are categorized as necessary and are stored on your browser because they are critical for the basic working of the site.
📊 The Analytics (Third-party): We also use third-party cookies to help us analyze traffic and understand which projects you like the most. These are stored only if you give us the green light.
You can choose to opt-out, but keep in mind that disabling them might make the site experience a bit less "smooth".
| Cookie | Duration | Description |
|---|---|---|
| cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
| cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
| cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
| cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
| cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
| viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
