DHT11 SSOR USING BHARAT PI BOARD,LED AND BLYNK CLOUD, CONTROLE THE WHOLE CIRCUIT USING a SWITCH ONLY IN a BLYNK CLOUD NOT AS EXTERNAL HARDWARE

by tmvinay95 in Craft > Art

3 Views, 0 Favorites, 0 Comments

DHT11 SSOR USING BHARAT PI BOARD,LED AND BLYNK CLOUD, CONTROLE THE WHOLE CIRCUIT USING a SWITCH ONLY IN a BLYNK CLOUD NOT AS EXTERNAL HARDWARE

dht1123.jpg
81EpQtmrrqL.jpg
download.jpg

1. DHT11 Sensor:

The DHT11 is a widely used sensor for measuring temperature and humidity. It's affordable, reliable, and easy to interface with microcontroller boards like Arduino and ESP32.

  1. Features:
  2. Measures temperature in the range of 0°C to 50°C with ±2°C accuracy.
  3. Measures humidity in the range of 20%-90% RH with ±5% accuracy.
  4. Digital output makes it easy to integrate with microcontroller platforms.
  5. Low power consumption and compact design.
  6. Applications:
  7. Weather monitoring systems.
  8. Environmental monitoring.
  9. Smart home applications (e.g., HVAC systems).
  10. How It Works: The sensor uses a resistive humidity measurement component and a Negative Temperature Coefficient (NTC) thermistor to detect environmental conditions. It communicates with a microcontroller using a single digital pin.

2. Bharat Pi Board:

The Bharat Pi Board is a microcontroller board, often similar in functionality to boards like Arduino or ESP32. It is designed for educational and IoT purposes in India. While not as universally known as other boards, it is tailored for beginners and hobbyists, often preconfigured to work with sensors and cloud platforms.

  1. Features:
  2. Equipped with GPIO pins for connecting sensors and actuators.
  3. Supports Wi-Fi and Bluetooth connectivity (if based on ESP32/ESP8266 chips).
  4. Designed to work seamlessly with IoT applications.
  5. Ideal for learning and prototyping in IoT and robotics.
  6. Advantages:
  7. Affordable and locally available in India.
  8. Preloaded libraries for popular sensors like DHT11.
  9. Compatible with platforms like Blynk Cloud for easy IoT integration.

3. Blynk Cloud:

Blynk Cloud is a popular IoT platform that enables developers to create connected applications with minimal effort. It provides an intuitive mobile app interface to interact with devices like sensors and actuators via virtual pins.

  1. Features:
  2. Device Control: Manage connected devices using the Blynk app.
  3. Data Monitoring: Real-time visualization of sensor data such as temperature, humidity, and more.
  4. Cloud Connectivity: Securely stores and processes data in the cloud.
  5. Virtual Pins: Enable communication between the app and hardware without complex coding.
  6. Automation: Create rules and triggers for automated device behavior.
  7. How It Works:
  8. Install the Blynk app on a smartphone.
  9. Connect your microcontroller (e.g., Bharat Pi Board) to the Blynk Cloud using Wi-Fi credentials and an authentication token.
  10. Use the app to monitor sensor data, control devices, and create automation.
  11. Advantages:
  12. Simplifies IoT development.
  13. No need to set up a dedicated server.
  14. Cross-platform: Supports Android, iOS, and web.
  15. Scalability: Suitable for both small projects and industrial applications.
  16. Applications:
  17. Home automation.
  18. Weather stations.
  19. Remote monitoring systems.
  20. Industrial IoT solutions.


Supplies

Untitled Diagram.drawio.png
WhatsApp Image 2025-01-11 at 08.13.43_45e0bf1c.jpg
WhatsApp Image 2025-01-10 at 21.18.56_7d6e7f52.jpg

Pin Connections for ESP32 with DHT11:

  1. DHT11 Pinout:
  2. VCC: Power (3.3V or 5V)
  3. GND: Ground
  4. DATA: Data signal pin
  5. Connection to ESP32:
  6. DHT11 VCC3.3V or 5V on ESP32 (depends on your DHT11 module; many work on both voltages)
  7. DHT11 GNDGND on ESP32
  8. DHT11 DATAGPIO 5 on ESP32 (defined in your code as #define DHT_PIN 5)
  9. Optional (if your DHT11 module doesn’t have a built-in pull-up resistor):
  10. Connect a 10kΩ pull-up resistor between the DATA pin and the VCC pin of the DHT11.

Diagram:

lua
Copy code
DHT11 ESP32
VCC ------> 3.3V/5V
GND ------> GND
DATA ------> GPIO 5 (D5)

Ensure all connections are secure, and double-check that your ESP32 board and DHT11 sensor are powered appropriately. If the sensor has issues reading, try switching between 3.3V and 5V for the power source.

Coding

#define BLYNK_TEMPLATE_ID "TMPL39ljvPtqB"

#define BLYNK_TEMPLATE_NAME "dht11"

#define BLYNK_AUTH_TOKEN "--pAnHDSkocYnvfpq1g54OYYkIrQheEu"

#include <SimpleTimer.h>

#include <WiFi.h>

#include <BlynkSimpleEsp32.h>

#include <DFRobot_DHT11.h>

const char*auth= "D85f1FIRZcAgxPx8J08FiST-c3RZhFM9";

const char* ssid = "Yogesh";

const char* pass = "Yogi5244";

SimpleTimer timer;

float temperature=0.0;

float humidity=0.0;


#define DHT_PIN 5

DFRobot_DHT11 mydht;


void setup() {

 

 Serial.begin(115200);



 Serial.print("Connecting to WiFi");

 WiFi.begin(ssid, pass);

 while (WiFi.status() != WL_CONNECTED) {

  Serial.print(".");

  delay(1000);

 }

 Serial.println("\nConnected to WiFi");

 Serial.print("IP Address: ");

 Serial.println(WiFi.localIP());


 

 Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);

 timer.setInterval(5000L, sendSensorData);

 

 

}

void sendSensorData(){

  mydht.read(DHT_PIN) ;

 float temperature = mydht.temperature;

 float humidity = mydht.humidity;


 

 if (isnan(temperature) || isnan(humidity)) {

  Serial.println("Failed to read from DHT sensor!");

  return;

 }


 

 Serial.print("Temperature: ");

 Serial.print(temperature);

 Serial.println(" °C");


 Serial.print("Humidity: ");

 Serial.print(humidity);

 Serial.println(" %");


 Blynk.virtualWrite(V0, temperature);

 Blynk.virtualWrite(V1, humidity);


 Serial.println(" data is transmitting to Blynk");

}

void loop() {

 

 Blynk.run();

 timer.run();


 

 

 

 delay(2000);

}