Timer control led using esp32

Circuit Diagram

pin connection 
  1. Negative of led -- Gnd
  2. Positive of led -- gp23 

blynk app 

To download the click here 


NOTE:
"enter your wifi-name and password and your blynk auth in the code"

code


#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
SimpleTimer timer;

char auth[] = "BLYNK AUTH";

char ssid[] = "wifi-name";
char pass[] = "password";
void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
}
void loop()
{
  Blynk.run();
  timer.run();
}

youtube tutorial:



Iot Temperature & Humidity Monitoring - Esp32

circuit diagram

pin connection:
  1. Vcc -- Vcc
  2. Gnd -- Gnd
  3. Data -- D15

code :



#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

#include "DHTesp.h"
#define DHTpin 15    //D15 of ESP32 DevKit
DHTesp dht;

float temperature;
float humidity;

char auth[] = "blynk auth";

char ssid[] = "wifi-name";
char pass[] = "password";
void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
   dht.setup(DHTpin, DHTesp::DHT11);
  
}

void loop() {
  // put your main code here, to run repeatedly:
 Blynk.run();
 float temperature = dht.getTemperature();
float humidity = dht.getHumidity();

 Blynk.virtualWrite(V1, temperature); 
 Blynk.virtualWrite(V2, humidity); 
delay(1500);


Youtube video tutorial:


Home automation using bluetooth

circuit diagram:



pin connection :

  1. Relay1 --2
  2. Relay2 --3
  3. Tx of bluetooth -- Rx of arduino
  4. Rx of bluetooth -- Tx of arduino

App used for controll the led 


Download the app by click here 


code for the project


int relay1 = 2;
int relay2 = 3;
char val;

void setup()

{
pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
Serial.begin(9600);
}


void loop()

{
  while (Serial.available() > 0)
  {
  val = Serial.read();
  Serial.println(val);
  }


  if( val == 'a') // relay1 on
    {
      digitalWrite(relay1,HIGH);
    }
  else if(val == 'b') //relay2 on
    {
     digitalWrite(relay2,HIGH);
    }
    else if(val == 'd') // relay1 off
    {
     digitalWrite(relay1,LOW);
    }
    else if(val == 'e') // relay2 off
    {
     digitalWrite(relay2,LOW);
     }
}  




youtube tutorial:



No comments:

Bluetooth controlled led


circuit diagram:



pin connection :

  1. led1 --2
  2. led2 --3
  3. led3 --4
  4. Tx of bluetooth -- Rx of arduino
  5. Rx of bluetooth -- Tx of arduino

App used for controll the led 


Download the app by click here 


code for the project

  int led1 = 2;
int led2 = 3;
int led3 = 4;

char val;
void setup()

pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
Serial.begin(9600);
}

void loop()
{
  while (Serial.available() > 0)
  {
  val = Serial.read();
  Serial.println(val);
  }

  if( val == 'a') // led1 on
    {
      digitalWrite(led1,HIGH);
    }
   
  else if(val == 'b') //led2 on
    {
     digitalWrite(led2,HIGH);
    }
    else if(val == 'c') // led3 on
    {
     digitalWrite(led3,HIGH);
    }
    else if(val == 'd') // led1 off
    {
     digitalWrite(led1,LOW);
    }
    else if(val == 'e') // led2 off
    {
     digitalWrite(led2,LOW);
    }
    else if(val == 'f') // led3 off
    {
     digitalWrite(led3,LOW);
    }






youtube tutorial:



Older Posts Home

Timer control led using esp32

...