Hc-sr04 & dht11

Hello!
It has been a week since I am using BLYNK
and now i want that I get live update of my DHT11{ TEMP & HUMIDITY} & HC-SRO4 {ULTRASONIC } SENSOR’S DATA using ARDUINO UNO
CAN ANY ONE HELP ME OUT!
WITH THE CODE AND THE SCHEMATIC

{ For BLYNK Developers- You people are awesome and have created a really good stuff, contracts for your success}
and when it will have the bluetooth function .

Hello. Here is example. You can also google for “Bylnk DHT11”. Regarding HC-SRO4 - don’t know. Didn’t see here on forum anyone with it.

THANKS FOR THE REPLY

#include <dht.h>

dht DHT;

#define DHT11_PIN 5

void setup()
{
  Serial.begin(115200);
  Serial.println("DHT TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");
  Serial.println(DHT_LIB_VERSION);
  Serial.println();
  Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
}

void loop()
{
  // READ DATA
  Serial.print("DHT11, \t");
  int chk = DHT.read11(DHT11_PIN);
  switch (chk)
  {
    case DHTLIB_OK:  
                Serial.print("OK,\t"); 
                break;
    case DHTLIB_ERROR_CHECKSUM: 
                Serial.print("Checksum error,\t"); 
                break;
    case DHTLIB_ERROR_TIMEOUT: 
                Serial.print("Time out error,\t"); 
                break;
    case DHTLIB_ERROR_CONNECT:
        Serial.print("Connect error,\t");
        break;
    case DHTLIB_ERROR_ACK_L:
        Serial.print("Ack Low error,\t");
        break;
    case DHTLIB_ERROR_ACK_H:
        Serial.print("Ack High error,\t");
        break;
    default: 
                Serial.print("Unknown error,\t"); 
                break;
  }
  // DISPLAY DATA
  Serial.print(DHT.humidity, 1);
  Serial.print(",\t");
  Serial.println(DHT.temperature, 1);

  delay(2000);
}
//
// END OF FILE
//

PLS PROVISE ME WITH THE CORRECT CODE

THANKS

Hi @Raghav_Kapoor,

As someone stated on our forum before, this community is not a “code factory”. If you wish to learn - you are very welcome to try things out. Share your progress, then ask for code help. The code you need was posted many many times here and online.

Please respect other’s time, do your homework and come back if something doesn’t work or you can’t solve your task.

Thanks.

2 Likes