In this tutorial, we learn how to get started with NodeMCU ESP8266. We program the Nodemcu board using the Arduino IDE.
NodeMCU is just like the Arduino board with onboard Wi-Fi. It is small in size than Arduino Uno but similar to Arduino Nano. It is capable to connect to the internet using Wi-Fi and you can take your projects online.
It runs on the ESP8266 Wi-Fi Soc from Espressif Systems, and hardware which is based on the ESP-12 module. Lua scripting language is used by the firmware.
Read More about NodeMCU.
- NodeMCU (ESP8266) Board.
- Arduino IDE.
Setting Up Arduino IDE for NodeMCU
Download and Install Arduino IDE.
- Now go to Files >> Preferences and paste the below link in Additional Boards Manager URLs.
Installing the ESP8266 Board:-
- Go to Tools >> Board >> Board Manager (at the top in the list).
- Search or Scroll down to Find ESP8266.
- Click on install.
Select Board (NodeMCU 1.0):-
After Selecting the Board, follow below settings:-
- Upload Speed: “115200”
- CPU Frequency: “80Mhz”
- Flash Size: “4M (no SPIFFS)”
- Debug Port: “Disabled”
- Debug Level: “None”
- IWIP Variant: “V2 Lower Memory”
- VTables: “Flash”
- Exceptions: “Disabled”
- Erase Flash: “Only Sketch”
- Port: “Where the device is connected”
Code for Blink Builtin LED of NodeMCU
- Goto Files >> Examples >> ESP8266
- Select the Blink Program and upload it.
NodeMCU GPIO Pins
|Pin Names on NodeMCU Board||ESP8266 Internal GPIO Pin Number|
Circuit Diagram For Blinking External LED using NodeMCU
In the below circuit, we connect the led to D0 pin whose GPIO number is 16.
Code For Blinking External LED using NodeMCU
For blinking an external led using NodeMCU upload the below code.