ESP8266 + Arduino WiFi connection /

by amine-M

ESP8266 + Arduino WiFi connection
Add to Favorite | اضف الى المفضلة

ESP8266 + Arduino WiFi connection

14 views

0   0

Comments | تعليقات

0 Comments | تعليقات

    Upload a project

    Project description | وصف المشروع

    ////////////////////////////////////////////////////////////////////////////////////////CONNECTIONS//////////////////////////////////////////////////////////////////////////////////////////////////////////

    UNO ///////////// ESP8266
    RX (D3) ----- TX
    TX (D2) ----- RX
    GND -------- GND
    3.3V --------- VCC
    3.3V --- CH_PD/EN

    ////////////////////////////////////////////////////////////////////////////////////////SOFTWARE SERIAL COMMUNICATION//////////////////////////////////////////////////////////////////////////////////////////////////////////

    Software Serial allows us to connect the ESP8266 module to an arbitrary microcontroller pins. The pins used must be select in the Arduino IDE (SEE CODE). Also in the A.IDE we must put the right the baud rate for serial port. ESP8266 is configured by default to 115200 baud, but to work through SoftwareSerial, we must configure the transmission speed ESP8266 to a lower speed. Stable operation of the module is possible at a speed of no more than 9600 baud. To change the speed of module, we must to connect it to the console to send AT command, but before changing anything we MUST upload the 115200 baud code first, then send AT command to change baud rate. After that, upload 9600 baud code. If you want a stable communication, add 1K and 2K resistors as shown in the image, or get a logic level converter, e.g: TXB0108 (good one)


    Module serial interface speed can be changed with the AT command => "AT+CIOBAUD=9600".


    ////////////////////////////////////////////////////////////////////////////////////////CODE 115200 BAUD//////////////////////////////////////////////////////////////////////////////////////////////////////////

    #include "SoftwareSerial.h" // SoftwareSerial library declaration
    SoftwareSerial SerialESP8266(3, 2); // RX, TX

    void setup()
    {
    Serial.begin(115200); // Start the serial monitor at 115200
    SerialESP8266.begin(115200); // Start ESP8266 module
    }


    void loop()
    {

    if (SerialESP8266.available())
    {
    char a = SerialESP8266.read() ;
    Serial.print(a);
    }
    if (Serial.available())
    {
    char a = Serial.read();
    SerialESP8266.print(a);
    }


    }


    ////////////////////////////////////////////////////////////////////////////////////////CODE 9600 BAUD//////////////////////////////////////////////////////////////////////////////////////////////////////////

    #include "SoftwareSerial.h" // SoftwareSerial library declaration
    SoftwareSerial SerialESP8266(3, 2); // RX, TX

    void setup()
    {
    Serial.begin(9600); // Start the serial monitor at 9600
    SerialESP8266.begin(9600); // Start ESP8266 module
    }


    void loop()
    {

    if (SerialESP8266.available())
    {
    char a = SerialESP8266.read() ;
    Serial.print(a);
    }
    if (Serial.available())
    {
    char a = Serial.read();
    SerialESP8266.print(a);
    }


    }

    Published | نشرت

    7 days ago

    Category | الفئة

    Pictures  /  Other | آخر

    Tags | الكلمات الرئيسية

    esp8266 esp12 esp07 wifi module arduino uno engineering programming sensor arduino project wifi wireless automation

    Related Stuntups
    More from this user