Language: EN

esp8266-nodemcu

NodeMCU, the popular development board with ESP8266

We continue moving forward with the ESP8266 SOC tutorials. In this post, we will look at our first development board based on the ESP8266, among the many available. As it couldn’t be otherwise, we will start with the well-known NodeMCU.

NodeMCU is a development board based on the ESP12E, which is probably the most popular module integrating the ESP8266 SoC. However, despite the popularity of NodeMCU boards, there is also a lot of confusion regarding terminology (Lua, Lolin, versions) and, at times, these terms are mixed or even used interchangeably.

Keep in mind that, unlike Arduino where there is a company that organizes the available designs and models, the development boards based on ESP8266 have evolved a bit haphazardly and alongside different manufacturers.

Things get even more complicated when we read the descriptions from some sellers, who mix concepts and contribute to generating even more confusion.

So let’s try to delve deeper and bring a bit of order around NodeMCU, one of the most popular ESP8266 development boards and one of the fundamental pillars on which the ESP8266 ecosystem has relied during its evolution.

What is NodeMCU?

NodeMCU is a name that refers to both an Open Source firmware and a development board based on the ESP8266.

Initially, the name NodeMCU mainly referred to the firmware. Currently, this has reversed, and when we talk about NodeMCU, we usually refer to the development board.

nodemcu

The NodeMCU firmware was created shortly after the ESP8266 appeared, on December 30, 2013. A few months later, in October 2014, the first version of the NodeMCU firmware was published on Github. Two months later, the first NodeMCU development board, called devkit v0.9, was released, also as Open Hardware.

Remember that in those early days of the ESP8266 there was barely any information and the little that existed was confusing. Most of the community’s interest was limited to the ESP01, which was considered more a cheap Wifi module for processors like Arduino than an independent development board.

The NodeMCU firmware could be flashed onto an ESP8266, after which we could program it using the Lua scripting language. Programming in Lua allowed for connecting and programming the ESP8266 in a much simpler way than the official tools provided by Espressif.

esp8266-lua

Lua is an imperative and structured programming language created in 1993 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes. It is based on C and Perl and is designed to be very lightweight. It has been implemented in a wide variety of embedded devices, from video game consoles to industrial robots. The official page is https://www.lua.org/.

Over time and with the emergence of other alternatives for programming the ESP8266, such as (especially) C++ with the Arduino environment and others like MicroPython, interest in Lua has decreased significantly.

Although programming in Lua had interesting aspects, it is not as widely used as C++ and Python. Furthermore, they never managed to make it completely stable on the ESP8266. On the other hand, being an interpreted language (rather than compiled), performance and resource utilization are lower.

In 2015, the original development team stopped maintaining the NodeMCU firmware. Although it is still maintained by a community of developers, interest in the firmware has almost completely waned. For this reason, we currently refer to NodeMCU more in terms of the development board than the firmware.

However, although the firmware has somewhat faded into obscurity, we must not forget the contribution that the NodeMCU project, both firmware and development board, has made to the proliferation and implementation of the ESP826.

NodeMCU Development Board

Now that we have seen a bit of history and the origin of NodeMCU as both firmware and development board, let’s dive into what currently interests us, which is NodeMCU as a development board.

Basically, the NodeMCU development board is based on the ESP12E and exposes its functionalities and capabilities. But additionally, it adds the following advantages typical of development boards:

  • Micro USB port and Serial-USB converter
  • Simple programming via Micro-USB
  • Power supply via USB
  • Terminals (pins) to facilitate connections
  • Integrated LED and reset button

We will not go into the hardware details of the ESP12E because we covered them extensively in its own post and they are common to all development boards based on the ESP12E (and it doesn’t make sense to repeat them for each development board we look at).

In this post, we will focus on the specific aspects of the NodeMCU board beyond those “inherited from using an ESP12E.” As we mentioned in the introduction, everything related to NodeMCU can be confusing because there is more than one manufacturer, and each has its own criteria.

To make matters worse, Chinese sellers on AliExpress or eBay write their item descriptions as if they were paid by the word, mixing everything and making it unnecessarily complicated.

To summarize, we have three main manufacturers of NodeMCU, Amica, Lolin/Wemos, and DOIT/SmartArduino. The boards are very similar (or even identical), although there may be some differences in pin designations.

On the other hand, we have three versions of the NodeMCU board, which we will see next. The designations of the versions do not make it worse intentionally also contribute to generating confusion. But, while it seems a bit complicated, it is actually simple if you follow the evolution from the beginning.

First Generation v0.9

The original version of NodeMCU was called devkit v0.9, and it mounted an ESP12 along with 4MB of flash (remember that the memory in the ESP8266 is external and connects via SPI). The ESP12 is similar to the ESP12E, but it lacks a row of pins, so it has fewer GPIOs.

esp8266-esp12-esp12e

Version 0.9 was ugly (well, to each their own), yellow-orange, and very wide. With dimensions of 47x21mm, it occupied 10 rows of pins on a breadboard, thus covering it completely. This made it very impractical to use because it does not leave free pins on the breadboard for making connections.

esp8266-nodemcu-v09

We will not spend more time on this board because it is an obsolete version and you can’t even buy it anymore. But know that it was the original NodeMCU and everything starts from here.

Second Generation v1.0 / V2

The next version of NodeMCU is v1.0 V2. In summary, Amica, a company created by German Gerwin Janssen, manufactured its own improved version of v0.9. The original NodeMCU team liked it and declared it the “official” version of NodeMCU.

esp8266-nodemcu-v2

The main difference of version v1.0 v2 is that it mounts an ESP12E instead of an ESP12, thus having more available pins than the original model. Additionally, it is narrower than version 0.9, covering only 8 rows of a breadboard. This leaves an additional row on each side for making connections.

esp8266-nodemcu-dev-kit-v2-pins

All three manufacturers, Amica, Lolin/Wemos, and DOIT/SmartArduino, manufacture, or have manufactured at some point, this version v1.0 V2.

As the NodeMCU team designated Amica’s version as “official,” it is sometimes said that Amica is the official distributor of NodeMCU. This is not true since it is Open Hardware, and any manufacturer is as valid as the others.

Third Generation v1.0 / V3

We arrive at what is sometimes referred to as the “third generation,” version 1.0 V3. Basically, the manufacturer Lolin/Wemos decided to create its own “improved” design with a few minor changes.

esp8266-nodemcu-v3

The main change is that the V3 uses a CH340G serial converter instead of the CP2102. The manufacturer claims that this makes the USB port more robust. On the other hand, they reused the two reserved pins from V2 to provide a GND and a VUSB.

esp8266-nodemcu-pinout-v3

Other than that, the specifications are the same. Conversely, the v1.0 V3 is once again wide and covers the entire breadboard, which is a real problem when making setups with a breadboard.

Nevertheless, the 1.0 V3 is probably the best-selling model right now. Although many people look for the V2 because they are practically identical in functionalities, the V2 is more convenient to use on a breadboard due to its narrower size.

Since version V3 is a version created by Lolin/Wemos, it has sometimes been labeled as “unofficial” (by NodeMCU itself). But considering that it is open hardware, the very concept of “unofficial” does not make much sense.

Summary of Versions

To summarize what we have seen,

GenerationVersionModuleWidthComment
First0.9ESP1210 pinsThe original, not for sale
Second1.0V2ESP12E8 pins“Official” version
Third1.0V3ESP12E10 pinsWemos/Lolin version. CH340G converter.

So far, the theory. Now comes the reality, which is a bit more “fun.” ¡Sellers on eBay and AliExpress (and others) mix everything up! For example, they might list “NodeMCU Lua Lolin V2” or “NodeMCU Amica devkit v3.” Just like that, randomly. But the most amusing part is that I have seen versions marked as V3 that are actually narrow. Versions sold as V2 that are wide.

The best way to differentiate between V2 and V3 at a glance is to look at the serial converter it uses. The CP2102, which is square, or the CH340G, which is elongated.

esp8266-nodemcu-v2-v3

Other than that, it is not worth spending more time than necessary on the topic of versions. They are practically similar, and any you have will work well for you.

Price

Let’s talk about the price of these development boards, which are currently really cheap. In both cases, for version v1.0 V2 and V1.0 V3, we can find them for the (incredible) price of €2-2.5, searching from international sellers on AliExpress or eBay.

Version V3 is generally a bit cheaper (around €2, compared to €2.5 for V2), likely due to using the CH340G or because of higher production. If you want a NodeMCU for a project without a breadboard, you might prefer the V3 for being slightly cheaper.

However, in setups that require using a breadboard, the preferred option is usually the V2 despite its slightly higher price, because its narrower width facilitates connections.

In any case, both NodeMCU board models are similar and have a truly unbeatable price for a development board with such power and Wifi connectivity, being the main reason for their success and high popularity.

NodeMCU Pinout

We cannot finish this post without looking at our always beloved and consulted pinout diagram.

esp8266-nodemcu-pinout

And here is a summary table with the pins, their functions, and some of their peculiarities.

PinGPIOInputOutputComments
D0GPIO16No interruptsNo PWM
No I2C
HIGH during boot

Pull-Down resistance

Connect to RST for Wake-Up
D1GPIO5OKOKSCL (I2C)

(frequently)
D2GPIO4OKOKSDA (I2C)

(frequently)
D3GPIO0Pulled UpOKBoot fails if pulled LOW

Connected to FLASH button
D4GPIO2Pulled UpOKHIGH during boot

Boot fails if pulled LOW

Built-in LED

TX1
D5GPIO14OKOKSLCK (SPI)
D6GPIO12OKOKMISO (SPI)
D7GPIO13OKOKMOSI (SPI)
D8GPIO15Pulled GNDOKCS (SPI)

LOW during boot

Boot fails if pulled HIGH

No Pull-Up
RXGPIO3OKRXHIGH during boot

Not usable if using UART
TXGPIO1TXOKHIGH during boot

Boot fails if pulled LOW

Debug output during boot

Not usable if using UART
A0ADC0Analog InputNO

However, as we have seen, there is a wide variety of small variations and manufacturers that label their development boards the same (and sometimes incorrectly). So there may be small differences in the development board you have.

Precisely for this reason, in case of doubts, refer to the post about the ESP12E, because what all these boards have in common is that they use the same module and, therefore, have the same functions.

What may change is the name they have labeled on each pin or that the integrated LED is connected to another pin or, in rarer cases, that they have connected the pins differently with the ESP12E. But by looking at the ESP12E pinout, you will be able to deal with any NodeMCU board even if they have small variations.