Esp8266 sp01 tutorial| Blynk iot + Esp 8266 sp01+ relay 5v

Duy Thuc 3/25/2024
2 likes
iot esp

Blynk iot web sever Esp8266 Sp01 tutorial . 

Hi everybody. In this article, I will show you how to control Esp8266 Sp01 from the internet via the Blink App.

What is Arduino IDE?

The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board. This software can be used with any Arduino board.

What is APP Blink? 

Build custom mobile apps and web dashboards with our drag-and-drop app builder. Get a complete, hardware-agnostic IoT solution with an integrated back-end ...

1. Installing Arduino IDE( Add library Esp 8266)

2.Create account Blynk:

2.Login Iot Blynk :

3.Programming Arduino IDE: + uploading the Code

code google drive:https://drive.google.com/drive/folders/1ag7VHHl7X9cQUMjfpZ3rnsPsXeuIb2_K?usp=sharing


3.connection between ESP8266 and FTDI Converter


As for the connection between ESP8266 and FTDI Converter, it is shown as diagram above or listed as below:

  1. RX -> TX
  2. TX -> RX
  3. VCC -> VCC
  4. CH_EN -> VCC
  5. GPIO-0 -> GND
  6. GND -> GND

explain code:

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud

// See the Device Info tab, or Template settings

#define BLYNK_TEMPLATE_ID           "TMPLub98IFYu" 

#define BLYNK_DEVICE_NAME           "Quickstart Device"

#define BLYNK_AUTH_TOKEN            "RO_jE2xVdVnV6iPVf4oM-R0mgM1QxD-8"

// Comment this out to disable prints and save space

#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>

char auth[] =  "RO_jE2xVdVnV6iPVf4oM-R0mgM1QxD-8";

// Your WiFi credentials.

// Set password to "" for open networks.

char ssid[] = "BabyKonkrete"; //Your wifi's name

char pass[] = "nvdt2002"; //Your Wifi's password

BlynkTimer timer;

int pin=0;// using GPO0 esp8266 sp1

// This function is called every time the Virtual Pin 0 state changes

BLYNK_WRITE(V0)

{

// Set incoming value from pin V0 to a variable

  int value = param.asInt();

  digitalWrite(pin,value);

  // Update state

  Blynk.virtualWrite(V1, value);//status of led

}

void setup()

{

  // Debug console

  Serial.begin(115200); //Speed baut 

  Blynk.begin(auth, ssid, pass);

  pinMode(pin,OUTPUT); //GPO0 is Output pin

  digitalWrite(pin,HIGH);//Set GPO0 is High

  // You can also specify server:

  //Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);

  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);

}

//over loop

void loop()

{

  Blynk.run();

  timer.run();

  // You can inject your own code or combine it with other sketches.

  // Check other examples on how to communicate with Blynk. Remember

  // to avoid delay() function!

}

Powered by Froala Editor

;
Comments