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
- 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
- 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
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.
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 definitionsconst int stepPin = 5; // STEP pinconst int dirPin = 4; // DIR pinconst int potPin = A0; // Potentiometer pinconst int MS1 = 8; // Microstepping pin 1const int MS2 = 9; // Microstepping pin 2const 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 credentialschar ssid[] = "YourWiFiSSID"; // Replace with your Wi-Fi SSIDchar pass[] = "YourWiFiPassword"; // Replace with your Wi-Fi password
// LED pinsconst int LED1 = 27; // Unique GPIO pin for LED1const int LED2 = 33; // Unique GPIO pin for LED2const int LED3 = 32; // Unique GPIO pin for LED3const 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 handlersBLYNK_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}
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
0 Comments