Control LED from Your Phone in Just Minutes!💡📲 | ESP8266 + Blynk for Beginners
How to Control LED using ESP8266 + Blynk IOT
This project demonstrates how to control an LED using your smartphone through the Blynk app and an
ESP8266 (NodeMCU) board. It's beginner-friendly and a great introduction to IoT and home automation using
Blynk
Components Required
- ESP8266 NodeMCU
- LED
- 220 Ohm Resistor
- Breadboard and Jumper Wires
- Smartphone with Blynk App Installed
- Micro USB Cable
STEPS TO CONTROL LED USING BLYNK APP
Step:1
OPEN https://blynk.io/
Signup using your email id
Step:2
follow the tutorial to setup the Blynk App to control LED
Step:3
copy
#define BLYNK_TEMPLATE_ID "TMPL22B8JI4Gr"
#define BLYNK_TEMPLATE_NAME "Home automation series"
and Token
Step:4
CODE Below
Step:5
confirm the board and port before uploading the code
board: esp8266 > NodeMCU 1.0
port: check it in device manager and ports
Step:6
now check in Blynk iot > my device > device should be online and connected to your wifi
try to switch on and off to check whether the LED is Blinking or Not, if not try to check the steps clearly
Step:7
open Blynk app in Mobile and follow the tutorial
Step:8
now your successfully able to control the LED using your Mobile.
Step:9
DO SUBSCRIBE AND LIKE THIS VIDEO
Circuit Diagram:
Code:// TECH WITH REDDIX 2024// Use for Educational purpose only//@techwithreddix follow on Instagaram#define BLYNK_TEMPLATE_ID "TMPL2zBvoHbGd"#define BLYNK_TEMPLATE_NAME "Home automation series" // TECH WITH REDDIX
#define BLYNK_PRINT Serial#include <ESP8266WiFi.h>#include <BlynkSimpleEsp8266.h>
#define LED_PIN 5 // D1 is GPIO5
char auth[] = "nd5XBGvSHgjblsrQt-M7mt-trSOO8tmm"; // Blynk Auth Tokenchar ssid[] = "Godreddix"; // WiFi SSIDchar pass[] = "1234567890"; // WiFi Password
BLYNK_WRITE(V1) { int buttonState = param.asInt(); digitalWrite(LED_PIN, buttonState);}
void setup() { Serial.begin(115200); pinMode(LED_PIN, OUTPUT); digitalWrite(LED_PIN, LOW); // Ensure LED starts OFF Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);}
void loop() { Blynk.run();}// TECH WITH REDDIX
// TECH WITH REDDIX 2024
// Use for Educational purpose only
//@techwithreddix follow on Instagaram
#define BLYNK_TEMPLATE_ID "TMPL2zBvoHbGd"
#define BLYNK_TEMPLATE_NAME "Home automation series" // TECH WITH REDDIX
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#define LED_PIN 5 // D1 is GPIO5
char auth[] = "nd5XBGvSHgjblsrQt-M7mt-trSOO8tmm"; // Blynk Auth Token
char ssid[] = "Godreddix"; // WiFi SSID
char pass[] = "1234567890"; // WiFi Password
BLYNK_WRITE(V1) {
int buttonState = param.asInt();
digitalWrite(LED_PIN, buttonState);
}
void setup() {
Serial.begin(115200);
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW); // Ensure LED starts OFF
Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
}
void loop() {
Blynk.run();
}
// TECH WITH REDDIX
Comments
Post a Comment