Electronics

ESP8266 ESP-01 Wifi Transceiver Module Board

AED 10.50

1

Description

The ESP8266 ESP01 is a tiny, low-cost Wi-Fi microcontroller module based on the Espressif ESP8266 chip. It is designed for easy integration with microcontrollers and provides a simple, cost-effective solution for adding Wi-Fi connectivity to your projects.

Package Includes:

  • 1 x ESP8266 ESP01 WiFi Module

Features:

  • Microcontroller: The ESP8266 ESP01 is based on Espressif's ESP8266 microcontroller chip, providing a low-cost, powerful solution for a wide range of projects.
  • Onboard Wi-Fi: One of the most notable features of the ESP8266 ESP01 is its onboard Wi-Fi connectivity. This allows other microcontrollers to easily connect to a Wi-Fi network and make simple TCP/IP connections.
  • Dual Use: The ESP8266 ESP01 can be used as either a UART to Wi-Fi adapter or as a standalone microcontroller. This versatility makes it a popular choice for a wide range of hobbyist and professional projects.
  • Processing Power: The ESP8266 ESP01 is powered by a Tensilica Xtensa LX3 processor, which provides adequate processing power for most applications.
  • Cost-Effective: The low cost of the ESP8266 ESP01 makes it a popular choice for IoT projects where cost is a concern.
  • Compact Form Factor: With a compact form factor of 18mm x 25.6mm x 3mm, the ESP8266 ESP01 is easy to integrate into a wide range of projects.
  • TCP/IP Protocol Support: The ESP8266 ESP01 supports TCP/IP protocols for data transmission over the Internet, making it a popu+lar choice for IoT projects.
  • Wide Range of Applications: From hobbyist projects to professional applications, the ESP8266 ESP01 is a versatile solution that is used in a wide range of projects.

Description:

The ESP8266 ESP01 is a tiny, low-cost Wi-Fi microcontroller module based on the Espressif ESP8266 chip. It is designed for easy integration with microcontrollers and provides a simple, cost-effective solution for adding Wi-Fi connectivity to your projects. With its onboard Wi-Fi capabilities, the ESP8266 ESP01 can function as a UART to Wi-Fi adapter, allowing other microcontrollers to establish a Wi-Fi connection and transmit data over the Internet using TCP/IP protocols. This makes it an ideal solution for IoT projects, where you want to remotely control or monitor your devices over the Internet.

The ESP8266 ESP01 is also powerful enough to be used as a standalone microcontroller, with its Tensilica Xtensa LX3 processor providing the necessary processing power to run your applications. The compact form factor, low cost, and onboard Wi-Fi capabilities make the ESP8266 ESP01 a popular choice for a wide range of hobbyist and professional projects.

Principle of Work:

The ESP8266 ESP01 operates as a microcontroller with Wi-Fi capabilities. It is based on Espressif's ESP8266 microcontroller chip and features a Tensilica Xtensa LX3 processor. The device has an onboard Wi-Fi radio, which allows it to connect to a Wi-Fi network and communicate with other devices over the internet. The device operates by executing firmware code stored in its flash memory. The firmware provides the functionality to implement the Wi-Fi stack and communication protocols, such as TCP/IP and HTTP. When connected to a Wi-Fi network, the device can send and receive data, allowing it to perform a variety of functions, such as sending data to a cloud service or controlling other devices over the internet.

The ESP8266 ESP01 can be programmed using the Arduino Integrated Development Environment (IDE), which provides a simple and intuitive interface for writing, uploading, and executing code on the device. Additionally, the device has a simple interface and can be used as a UART to WiFi adaptor, allowing other microcontrollers to connect to a Wi-Fi network and make simple TCP/IP connections. the ESP8266 ESP01 is a versatile and cost-effective device that provides a powerful solution for IoT applications and allows for easy integration with a variety of other microcontrollers and devices.

Pinout of the Module:

  • GPIO0: This pin can be used as an input or output, and is used to determine the device's boot mode. For example, if it is pulled low during boot, the device will enter "UART download" mode.
  • GPIO2: This pin is used as an input/output.
  • GPIO4: This pin is used as an input/output.
  • GPIO5: This pin is used for the flash chip interface.
  • RX (GPIO3): This pin is used for serial communication as a receive (RX) pin.
  • TX (GPIO1): This pin is used for serial communication as a transmit (TX) pin.
  • GND: Ground pin.
  • VCC: Power pin, the device should be powered with 3.3V.
  • It is important to note that these pins are multiplexed, meaning they can be used for different purposes at different times. The actual functions of these pins will depend on the firmware that is running on the device.

Applications: 

  • Wi-Fi connectivity: The onboard Wi-Fi capability of the ESP8266 ESP01 makes it a popular choice for adding Wi-Fi connectivity to projects and devices that previously lacked it.

  • Internet of Things (IoT) applications: The ESP8266 ESP01 can be used as a microcontroller that can connect to a Wi-Fi network and communicate with other IoT devices, such as sensors and actuators.

  • Smart home automation: The ESP8266 ESP01 can be used to create home automation systems that can be controlled remotely over Wi-Fi, such as smart lighting and heating systems.

  • Wireless data logging: The ESP8266 ESP01 can be used to collect data from sensors and transmit it wirelessly to a central repository for analysis.

  • Wi-Fi-enabled projects: The ESP8266 ESP01 can be used to add Wi-Fi functionality to various projects, such as robots, drones, and other hobbyist or educational projects.

Circuit:

to connect the ESP8266 to Arduino Follow these steps.

  • connect both ESP's VCC/3.3V/Power Pin and Enable Pin (red wires) to 10K resistor then to Uno's +3.3V power pin.
  • connect ESP's Ground/GND Pin (Black Wire) to Uno's Ground/GND Pin.
  • connect ESP's TX (green wire) to Uno's Pin 3
  • connect ESP's RX (blue wire) to 1K resistor then to Uno's Pin 2.
  • connect ESP's RX (blue wire) to 1K resistor and then to Uno's GND Pin

Library:

After uploading the code in the code section and connecting the last circuit:

set up your ESP8266 Wifi, follow these steps:

  1. Download the TCP Client app for Android. You can use any app available in the Play Store, but I recommend using TCP Client by Sollae Systems.

  2. Connect your phone to the ESP8266 Wifi. If it does not appear in the list of available networks, ensure that your Arduino is running and everything is connected correctly. If there are issues, refer to the ESP documentation for troubleshooting. The name of the wifi will typically start with "ESP" followed by the version name.

  3. Once connected, find the static IP address. You can do this by going to the Wifi Settings on your phone and clicking on network info. The default IP address in AP mode is 192.168.4.1, but you can change it by following the Wifi. config() reference.

  4. Open the TCP Client app you downloaded earlier. Connect to the ESP by clicking the connect button and entering the ESP's IP and port 80.

  5.  Wait for the TCP Console to say "Connected".

  6. Talk to you Arduino Uno via Smart Phone

    Once connected send a request by typing the following code to TCP Client:

    esp8266:

 

Check the AT Commands table attached to review the codes.

Or turn on the built-in LED using the command

LEDON

Or turn off the built-in LED using the command

LEDOFF

Or just say

HELLO

You can change what response from what you send depending on the logic you put into the code.

Code:  

This is an Arduino sketch code that communicates with an ESP8266 Wi-Fi module over a serial interface. The code sets the ESP8266 as an access point, gets its IP address, enables multiple connections, and turns on a server on port 80. It listens to incoming messages on the serial port and performs various actions depending on the message, such as sending AT commands to the ESP8266 or turning on or off the built-in LED on the Arduino. The code also has functions to read incoming messages from the serial port, match strings, and send data to the ESP8266.

#include "SoftwareSerial.h"
SoftwareSerial wifiSerial(2, 3); // RX, TX for ESP8266
bool DEBUG = true; //show more logs
int responseTime = 10; //communication timeout
void setup()
{
 pinMode(13,OUTPUT); //set build in led as output
 // Open serial communications and wait for port to open esp8266:
 Serial.begin(115200);
 while (!Serial) {
 ; // wait for serial port to connect. Needed for Leonardo only
 }
 wifiSerial.begin(115200);
 while (!wifiSerial) {
 ; // wait for serial port to connect. Needed for Leonardo only
 }
 sendToWifi("AT+CWMODE=2",responseTime,DEBUG); // configure as access point
 sendToWifi("AT+CIFSR",responseTime,DEBUG); // get ip address
 sendToWifi("AT+CIPMUX=1",responseTime,DEBUG); // configure for multiple connections
 sendToWifi("AT+CIPSERVER=1,80",responseTime,DEBUG); // turn on server on port 80
 sendToUno("Wifi connection is running!",responseTime,DEBUG);
}
void loop()
{
 if(Serial.available()>0){
 String message = readSerialMessage();
 if(find(message,"debugEsp8266:")){
 String result = sendToWifi(message.substring(13,message.length()),responseTime,DEBUG);
 if(find(result,"OK"))
 sendData("\nOK");
 else
 sendData("\nEr");
 }
 }
 if(wifiSerial.available()>0){
 String message = readWifiSerialMessage();
 if(find(message,"esp8266:")){
 String result = sendToWifi(message.substring(8,message.length()),responseTime,DEBUG);
 if(find(result,"OK"))
 sendData("\n"+result);
 else
 sendData("\nErrRead"); //At command ERROR CODE for Failed Executing statement
 }else
 if(find(message,"HELLO")){ //receives HELLO from wifi
 sendData("\\nHI!"); //arduino says HI
 }else if(find(message,"LEDON")){
 //turn on built in LED:
 digitalWrite(13,HIGH);
 }else if(find(message,"LEDOFF")){
 //turn off built in LED:
 digitalWrite(13,LOW);
 }
 else{
 sendData("\nErrRead"); //Command ERROR CODE for UNABLE TO READ
 }
 }
 delay(responseTime);
}
/*
* Name: sendData
* Description: Function used to send string to tcp client using cipsend
* Params:
* Returns: void
*/
void sendData(String str){
 String len="";
 len+=str.length();
 sendToWifi("AT+CIPSEND=0,"+len,responseTime,DEBUG);
 delay(100);
 sendToWifi(str,responseTime,DEBUG);
 delay(100);
 sendToWifi("AT+CIPCLOSE=5",responseTime,DEBUG);
}
/*
* Name: find
* Description: Function used to match two string
* Params:
* Returns: true if match else false
*/
boolean find(String string, String value){
 return string.indexOf(value)>=0;
}
/*
* Name: readSerialMessage
* Description: Function used to read data from Arduino Serial.
* Params:
* Returns: The response from the Arduino (if there is a reponse)
*/
String readSerialMessage(){
 char value[100];
 int index_count =0;
 while(Serial.available()>0){
 value[index_count]=Serial.read();
 index_count++;
 value[index_count] = '\0'; // Null terminate the string
 }
 String str(value);
 str.trim();
 return str;
}
/*
* Name: readWifiSerialMessage
* Description: Function used to read data from ESP8266 Serial.
* Params:
* Returns: The response from the esp8266 (if there is a reponse)
*/
String readWifiSerialMessage(){
 char value[100];
 int index_count =0;
 while(wifiSerial.available()>0){
 value[index_count]=wifiSerial.read();
 index_count++;
 value[index_count] = '\0'; // Null terminate the string
 }
 String str(value);
 str.trim();
 return str;
}
/*
* Name: sendToWifi
* Description: Function used to send data to ESP8266.
* Params: command - the data/command to send; timeout - the time to wait for a response; debug - print to Serial window?(true = yes, false = no)
* Returns: The response from the esp8266 (if there is a reponse)
*/
String sendToWifi(String command, const int timeout, boolean debug){
 String response = "";
 wifiSerial.println(command); // send the read character to the esp8266
 long int time = millis();
 while( (time+timeout) > millis())
 {
 while(wifiSerial.available())
 {
 // The esp has data so display its output to the serial window
 char c = wifiSerial.read(); // read the next character.
 response+=c;
 }
 }
 if(debug)
 {
 Serial.println(response);
 }
 return response;
}
/*
* Name: sendToUno
* Description: Function used to send data to Arduino.
* Params: command - the data/command to send; timeout - the time to wait for a response; debug - print to Serial window?(true = yes, false = no)
* Returns: The response from the esp8266 (if there is a reponse)
*/
String sendToUno(String command, const int timeout, boolean debug){
 String response = "";
 Serial.println(command); // send the read character to the esp8266
 long int time = millis();
 while( (time+timeout) > millis())
 {
 while(Serial.available())
 {
 // The esp has data so display its output to the serial window
 char c = Serial.read(); // read the next character.
 response+=c;
 }
 }
 if(debug)
 {
 Serial.println(response);
 }
 return response;
}

Technical Details:

  • Wi-Fi Direct (P2P), soft-AP
  • 802.11 b/g/n
  • Integrated TCP/IP protocol stack
  • Integrated TR switch, balun, LNA, power amplifier, and matching network
  • Integrated PLLs, regulators, DCXO, and power management units
  • +19.5dBm output power in 802.11b mode
  • Power down leakage current of <10uA
  • 1MB Flash Memory
  • SDIO 1.1 / 2.0, SPI, UART
  • STBC, 1×1 MIMO, 2×1 MIMO
  • A-MPDU & A-MSDU aggregation & 0.4ms guard interval
  • Wake up and transmit packets in < 2ms
  • Standby power consumption of < 1.0mW (DTIM3)

Resources:

Comparisons:

ESP01 and NodeMCU v1 are both microcontroller modules based on the ESP8266 chip. However, they have some differences:

  1. Form factor: ESP01 is a smaller module with only two GPIOs, while NodeMCU v1 is a development board that comes with more pins, including GPIOs, a USB port for power and data transfer, and micro-USB for programming.

  2. On-board memory: ESP01 has limited memory (1 MB), while NodeMCU v1 has more memory (4 MB).

  3. Wi-Fi capabilities: Both modules have Wi-Fi capabilities, but NodeMCU v1 has a better antenna design and is capable of longer-range Wi-Fi connections.

  4. User-friendliness: NodeMCU v1 is easier to use and set up, as it has a built-in micro-USB port for programming and debugging, while ESP01 requires an external USB-to-Serial converter.

In conclusion, NodeMCU v1 is a better option for projects that require more GPIOs, better Wi-Fi capabilities, and ease of use, while ESP01 is a good option for projects that have limited space or need only a few GPIOs.