Ad Code

Responsive Advertisement

Ticker

6/recent/ticker-posts

How To Make IOT Device using Blynk IOT and ESP32 - IOT Home Automation DIY Project by WTC Zone

 

To control three LEDs connected to an ESP32 (pins 27, 33, and 32) using the Blynk IoT mobile app from anywhere in the world, follow these steps:

1. Hardware Setup

  1. Connect the LEDs to the ESP32 pins:                              With 4 Channel Relay Module
    • Pin 27 → LED 1 (with a current-limiting resistor) - IN 1
    • Pin 33 → LED 2 (with a current-limiting resistor) - IN 2
    • Pin 32 → LED 3 (with a current-limiting resistor) - IN 3
    • Pin 25 → LED 4 (with a current-limiting resistor) - IN 4
  2. Connect the GND of all LEDs to the ESP32's GND.

2. Software Requirements

  • Install the Blynk Library in the Arduino IDE.
  • Configure the Blynk IoT platform.

3. Steps in the Blynk IoT Mobile App

  1. Set Up a Template:

    • Log in to Blynk Cloud.
    • Create a new template (e.g., LED Control) and note down:
      • Template ID
      • Device Name
    • Get the Authentication Token for the project.
  2. Configure the Mobile App:

    • Add buttons in the app for each LED.
    • Assign virtual pins (e.g., V1, V2, V3, V4) to the buttons.

Video Link: - Click Here For Video

How To Make IOT Device using Blynk IOT and ESP32 - IOT Home Automation DIY Project by WTC Zone simple Circuit: -





How To Make IOT Device using Blynk IOT and ESP32 - IOT Home Automation DIY Project by WTC Zone Arduino Programming: -

Arduino IDE Program

Code for Making IOT Device using Blynk IOT and ESP32 - IOT Home Automation DIY Project by WTC Zone


// Pin definitions
const int stepPin = 5;  // STEP pin
const int dirPin = 4;   // DIR pin
const int potPin = A0;  // Potentiometer pin
const int MS1 = 8;      // Microstepping pin 1
const int MS2 = 9;      // Microstepping pin 2
const int MS3 = 10;     // Microstepping pin 3

#define BLYNK_TEMPLATE_ID "YourTemplateID"
#define BLYNK_DEVICE_NAME "YourDeviceName"
#define BLYNK_AUTH_TOKEN "YourAuthToken"
#define BLYNK_TEMPLATE_NAME "TemplateName"

#include <WiFi.h>
#include <BlynkSimpleEsp32.h>

// Wi-Fi credentials
char ssid[] = "YourWiFiSSID";       // Replace with your Wi-Fi SSID
char pass[] = "YourWiFiPassword";   // Replace with your Wi-Fi password

// LED pins
const int LED1 = 27; // Unique GPIO pin for LED1
const int LED2 = 33; // Unique GPIO pin for LED2
const int LED3 = 32; // Unique GPIO pin for LED3
const int LED4 = 25; // Changed to pin 25 (unique pin)

void setup() {
  Serial.begin(115200);

  // Set LED pins as output
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(LED3, OUTPUT);
  pinMode(LED4, OUTPUT);

  // Initialize Blynk
  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
}

void loop() {
  Blynk.run();
}

// Virtual pin handlers
BLYNK_WRITE(V1) {
  int state = param.asInt();  // Get the button state
  digitalWrite(LED1, state);  // Control LED1
}

BLYNK_WRITE(V2) {
  int state = param.asInt();  // Get the button state
  digitalWrite(LED2, state);  // Control LED2
}

BLYNK_WRITE(V3) {
  int state = param.asInt();  // Get the button state
  digitalWrite(LED3, state);  // Control LED3
}

BLYNK_WRITE(V4) {
  int state = param.asInt();  // Get the button state
  digitalWrite(LED4, state);  // Control LED4
}
 

 5. Explanation
  • Template ID, Device Name, and Auth Token: Replace these placeholders with the actual values from your Blynk Cloud project.
  • Wi-Fi Credentials: Add your network's SSID and password.
  • Virtual Pins: Virtual pins (V1, V2, V3and V4) correspond to buttons in the Blynk app.

6. Upload and Test

  1. Upload the code to your ESP32 using the Arduino IDE.
  2. Power on the ESP32 and ensure it connects to Wi-Fi.
  3. Use the Blynk mobile app to control the LEDs.

Optional Features

  • Add Feedback: Display the LED status on the app using Blynk.virtualWrite().
  • Enhance Security: Use dynamic Wi-Fi provisioning with Blynk's Device Info feature.

Let me know if you'd like further assistance!


This setup and code will create a fun and responsive digital dice using your 7-segment servo display. Let me know if you encounter any issue.

Share, Support, and Subscribe!!! 1. PRO KAM EXPLAINED 2. Knowledge KAM 3. PRO KAM Follow us on 1. Facebook 2. Instagram 3. Pinterest 4. Blogspot 5 Twitter If you have any other ideas to make me design, you can describe them in the comment section and if I can, I will make a designing video on it. So I am waiting #prokam #wtc #Arduino #ideas #projects #diy #how #to #ArduinoProjects #Blynk #ESP32 #TechDIY #WeTechCreators #wtczo #led #iot #homeautomation

Post a Comment

0 Comments

Ad Code

Responsive Advertisement