Cov txheej txheem:

Siv ESP8266 Nrog Arduino thiab Blynk: 4 Cov Kauj Ruam
Siv ESP8266 Nrog Arduino thiab Blynk: 4 Cov Kauj Ruam

Video: Siv ESP8266 Nrog Arduino thiab Blynk: 4 Cov Kauj Ruam

Video: Siv ESP8266 Nrog Arduino thiab Blynk: 4 Cov Kauj Ruam
Video: Controlador WiFi - SIV 2024, Kaum ib hlis
Anonim
Siv ESP8266 Nrog Arduino thiab Blynk
Siv ESP8266 Nrog Arduino thiab Blynk

Txuas koj Arduino Mega rau blynk app siv espp8266 ntaub thaiv npog.

Kauj Ruam 1: Cov Ntaub Ntawv Xav Tau

Cov Ntaub Ntawv Xav Tau
Cov Ntaub Ntawv Xav Tau
Cov Ntaub Ntawv Xav Tau
Cov Ntaub Ntawv Xav Tau
Cov Ntaub Ntawv Xav Tau
Cov Ntaub Ntawv Xav Tau

1. ESP8266 ntaub thaiv npog - Cov khoom lag luam.com.com - ESP8266 serial WIFI

2. Arduino UNO - Cov khoom lag luam.com.com - Arduino UNO R3

3. Arduino Mega - Cov khoom lag luam.com.com - Mega 2560 R3…

4. Breadboard - AliExpress.com Khoom - Khoom noj khoom haus board khoom

5. Jumper xov hlau - AliExpress.com Khoom - Dupont Jumper hlau

Kauj Ruam 2: Kho ESP - 1

Kev teeb tsa ESP - 1
Kev teeb tsa ESP - 1

Txhawm rau teeb tsa ESP Wi-Fi module nws yuav tsum txuas nrog Arduino Uno raws li qhia hauv kab lus. Qhov tau txais tus pin thiab hloov tus lej (RXD thiab TXD) tau siv los sib pauv cov ntaub ntawv nrog lub microcontroller. GP100 thiab GP102 tus pin tsis tas yuav txuas nrog.

ESP thiab Arduino Pin-out

TXX - RX (0)

TXC - TX (1)

GRD - NPE

CH_PD - 5V

Kauj Ruam 3: Kho Esp - 2

Txhawm rau xa cov lus txib ncaj qha mus rau ESP module tus GND tus pin ntawm Arduino txuas nrog nws Pib pin.

Thaum Arduino tau txuas mus rau ESP thiab Arduino txuas nrog lub khoos phis tawj lub khoos phis tawj yuav tsum tau teeb tsa los ntawm kev saib xyuas txuas ntawm Arduino los ntawm kev siv AT cov lus txib. Txhawm rau tuaj yeem sib txuas lus rau daim ntaub thaiv tus nqi baud tau teeb tsa rau 115200 vim qhov no yog qhov nrawm uas ESP sib txuas lus thiab teeb tsa "Ob NL THIAB CR" tau xaiv.

AT– thaum xa qhov no, cov lus OK tshwm. Qhov no txhais tau tias ESP ua haujlwm tau raug.

AT+CWJAP = "WIFI_NAME", "WIFI_PASSWORD"- qhov lus txib no ESP txuas rau Wi-nkaus router.

Kauj Ruam 4: Txuas mus rau Arduino Mega

Txuas mus rau Arduino Mega
Txuas mus rau Arduino Mega

Tom qab cov kauj ruam no GND thiab RESET uas tau txuas nrog ntawm UNO tuaj yeem raug tshem tawm. Txij li ESP yuav siv nrog Arduino Mega, lwm cov txheej txheem yuav tsum tau xa mus rau Arduino Mega thiab ESP yuav tsum tau txuas rau Arduino Mega.

#define BLYNK_PRINT Serial

#suav nrog "ESP8266_Lib.h"

#suav nrog "BlynkSimpleShieldEsp8266.h"

char auth = "input blynk token";

// Koj li ntawv pov thawj WiFi.

char ssid = "ssid";

char pass = "password";

#feem EspSerial Serial1

// Koj li ESP8266 baud tus nqi:

#define ESP8266_BAUD 9600

ESP8266 wifi (& EspSerial);

void teeb tsa () {

// Debug console

Serial.begin (9600);

ncua (10);

// Teeb tsa ESP8266 baud tus nqi

EspSerial.begin (ESP8266_BAUD); ncua (10);

Blynk.begin (auth, wifi, ssid, dhau); ncua (10);

}

Cov teeb tsa no tso cai rau microcontroller siv Wi-Fi network ntawm ESP los txuas rau Blynk daim ntawv thov. Thaum rub tawm qhov program, pawg thawj coj tau teeb tsa xa thiab tau txais cov ntaub ntawv mus rau lub ntsej muag ntsais ntsais thiab raug programmed los ntawm app.

Pom zoo: