The ESP-01 is a popular, inexpensive microcontroller board with built-in Wi-Fi. It makes use of the, now, widely used ESP8266 microcontroller chip.
ESP8266 microcontroller chip
ESP8266 microcontrollers are designed for communicating over the internet whrough Wi-Fi radio signals. It has on-board processing and memory that allows it to be integrated with electronics through its GPIOs. With the ESP-01, two GPIO pins are available (GPIO0 and GPIO2).
Today, ESP8266 microcontrollers have been incorporated into many microcontroller boards (e.g. the ESP-01, ESP-02, etc.). The first ESP8266 chips were developed and manufactured by the Chinese company, Espressif Systems. What makes these chips popular are their full set of networking protocols with Wi-Fi connectivity.
Even when fully functional, ESP8266 chips are considered low power consumers. The voltage requirement is 3.3 V DC. Typically, the chip draws about 80 – 170 mA It also supports three lighter power modes: light sleep (0.5 mA), modem sleep (15 mA) and deep sleep (10 mA). The peak operating current draw is 300 mA.
3.3 V DC power is supplied to the ESP-01 module via the VCC and GND pins. 3.3 V also needs to be supplied to the CH_PD pin. Each I/O pin will supply up to 12 mA.
Currently the ESP-01 has two editions (the older blue edition and the newer black edition). The main difference between the two editions is that the newer black edition has 1 Mb of flash memory whereas the blue edition has 512 Kb (basically more space). Some has also found that a baud rate of 115200 bps is better to use for the newer edition.
Number of cores: 1
CPU clock speed: 80 MHz (default) – 160 MHz (programmable)
Memory: External flash memory chip
Flash memory: 512 KB – 1 MB (edition dependent)
Operating voltage (logic level): 3.6 V DC (max)
Input voltage: 2.5 – 3.6 V DC
Input voltage (recommended): 3.3 V DC
Power source: GPIO pins (Vc & CH_PD – both need to be connected)
Networking: Wi-Fi (IEEE 802.11 b/g/n)
Antenna: On-board PCB trace
Frequency range: 2.4G ~ 2.5G (2400 m ~ 2483.5 m)
Tx power: 802.11 b: +20 dBm, 802.11 g: +17 dBm, 802.11 n: +14 dBm
Rx sensitivity: 802.11 b: -91 dbm (11 Mbps), 802.11 g: -75 dbm (54 Mbps), 802.11 n: -72 dbm (MCS7)
Security modes: WPA, WPA2
Network protocols: IPv4, TCP/UDP/HTTP/FTP
Digital I/O (read/write) pins: 2 (GPIO0 & GPIO2)
Analog input pins: none (can be manipulated though programming)
Operating current: 300 mA (peak)
Operating current per I/O pin: 12 mA
Size: 25 x 14.5 mm
Operating temperature: -40 ~ 125 °C
Interfaces: Serial, SDIO, SPI
Breadboard friendly: almost
Pin size: male, 5 x 2.54 mm
The ESP-01 has three working GPIO pins (one is connected to the blue onboard LED). The ultimate goal is to be able to control these three pins using Wi-Fi. In order to achieve this, the chip needs software – called firmware. The firmware allows access to the chip, determines what commands can be used and how to respond to them.
Terms such as ‘flashed’ and uploaded are commonly used for the process of adding software to a microcontroller. Programming (or ‘flashing’) refers to uploading (custom or pre-configured) software (or firmware) to the ESP8266’s flash memory – where it is stored until it is flashed again. Flashing is done using a serial-UART interface. For more software information, see the Programming libraries section below.
The ESP8266 chip has (at least) two different boot modes: ‘normal mode’ and ‘programming mode’. To be able to upload new software/firmware to the chip, it needs to boot up in programming mode. Flashing will overwrite the previous software (including the AT command set if that was flashed).
Because the ESP-01 does not have, for example, a FT232R chip, an external serial to USB converter (e.g. FTDI USB/UART module) is needed to be able to flash it. The serial to USB converter has a mini-B USB port which is connected to a device with an USB input (e.g. a PC), and on the other side it has breakout pins (Tx, Rx, Vc and GND) that is connected to the ESP-01 module. Not all the pins on the converter are used for the purpose of communicating with the ESP-01.
There are more than one serial to USB converter option available. With the correct information, an Arduino can also be used. The FTDI USB/UART module in the Getting started section below has a 3.3/5V DC jumper and will supply 500 mA through its Vc pin. For more information on how to connect the ESP-01 module to a breadboard and FTDI programmer for flashing, see this post.
The ESP-01‘s current firmware can be replaced using downloadable or custom software written with an appropriate software development kit (SDK). There are a few different firmware, software and SDK options available.
AT command processors
Many ESP-01s will come pre-programmed with firmware that uses AT commands. Various other ESP8266 AT command processor firmware options are available for download on the internet.
When an AT command processor is installed, AT commands can be used to change some of the default hardware settings or to trigger the GPIO pins. Although the AT command set is stored in the memory, the hardware settings, e.g. after being changed, are not – meaning that these settings need to be updated after each boot. AT commands can be given using a serial-UART interface or by using an external software application (TCP connection software) which is able to send commands over Wi-Fi using the same baud rate that was set up on the ESP8266.
With this option, no specific programming language, just the AT commands, is necessary to be able to use the module.
Fortunately, Espressif made a Software Development Kit (SDK) available that allowed users to flash different firmware options to the ESP8266.
NodeMCU is one of the more popular alternatives for firmware running on the ESP8266. It runs a Lua interpreter on the ESP8266 processor, which is able to execute commands written in the Lua scripting language (almost like a little operating system).
Lua script files are written and saved in .lua format. NodeMCU allows GPIO and hardware functionality such as i2c and PWM. These script files also allow the setup of hardware settings.
With this option the user has access to an extensive range of the Lua functions and sample code for writing their own applications.
More recently, the ESP8266 community created an add-on for the Arduino IDE that allows Arduino-like (C or C++) programming to be uploaded as software. The Arduino IDE allows GPIO functionality.
This option uses a compiled solution. There is no interpreter. The Arduino IDE takes a sketch and compiles it, includes the related library functions and produces a complete standalone piece of firmware in the form of a binary file. The entire binary file is then uploaded.
Script files (or more specifically sketch files) are written and saved in .ino format. Arduino IDE sketches allow GPIO functionality and allows the setup of hardware settings.
With this option the user has access to an extensive range of libraries and sample code that are easy to get started with.
Like many microcontroller boards, the ESP-01 has an on-board power (red) LED and a Wi-Fi indicator/Tx (blue) LED. The blue LED and
Serial.print() commands cannot be used at the same time.
To get started you will need
- ESP-01 (buy 1 from BangGood | buy 3 from BangGood | buy 5 from BangGood)
- 5 VDC 1 A power supply converter module (buy 1 from BangGood | buy 3 from BangGood | buy 5 from BangGood)
- 5 VDC to 3.3 VDC 800 mA step-down buck module (buy 1 from BangGood | buy 5 from BangGood | buy 10 from BangGood)
- FTDI USB/UART module (buy 1 from BangGood)
- Mini-B USB cable (buy 1 from BangGood)
- Breadboard (buy 1 from BangGood | buy 5 from BangGood)
- Solderless breadboard jumper cable set (buy 1 from BangGood)
- 30 cm female to female jumper wire set (optional) (buy a set from BangGood)
- 30 cm male to female jumper wire set (optional) (buy a set from BangGood)
- NPN 2N2222 switch transistors (optional) (buy 50 from BangGood)
- Metal film resistors (optional) (buy a set from BangGood)
- 2x 4 Pin 2.54 mm stackable long legs female connector headers
- 6 Pin 2.54 mm stackable long legs female connector header (optional) (buy a small set from BangGood)
More ESP8266 related posts
26 April 2018
Improve your knowledge on anything from programming to business skills with Lynda.com’s huge range of professional video courses.
12 September 2017 | Updated 11 January 2018
See #howto connect the #ESP-01 to a breadboard and FTDI programmer...
6 July 2017
Read more about the digital read pin on a #microcontroller... #Arduino #ESP32 #DIY
1 July 2017
See #howto install the #Arduino IDE on a #RaspberryPi 3...
25 June 2017 | Updated 26 June 2017
#ESP32 #microcontroller development boards with build-in Wi-Fi & Bluetooth... #tinkering #DIY #homeautomation #IoT
3 January 2016 | Updated 31 October 2017
See #howto get started with the #Arduino Nano... #ArduinoNano