ESP8266 - Hello World

Hardware Preparation

1×ESP8266 NodeMCU
1×Micro USB Cable
1×(Optional) 5V Power Adapter for ESP8266
1×(Optional) ESP8266 Screw Terminal Adapter

Or you can buy the following sensor kit:

1×DIYables Sensor Kit 30 types, 69 units
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you. We appreciate your support.

Detailed Instructions

To get started with ESP8266 on Arduino IDE, follow these steps:

  • Check out the how to setup environment for ESP8266 on Arduino IDE tutorial if this is your first time using ESP8266.
  • Wire the components as shown in the diagram.
  • Connect the ESP8266 board to your computer using a USB cable.
  • Open Arduino IDE on your computer.
  • Choose the correct ESP8266 board, such as (e.g. NodeMCU 1.0 (ESP-12E Module)), and its respective COM port.
Arduino IDE - How to select ESP8266 NodeMCU board
  • Choose the serial port associated with ESP8266 (the number may vary).
Arduino IDE - How to select com port
  • Copy the above code and open with Arduino IDE
void setup() { // put your setup code here, to run once: Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: Serial.println("Hello World!"); Serial.println("I am ESP8266!"); delay(1000); }
  • Click the Upload button on the Arduino IDE to compile and upload the code to the ESP8266.
How to upload code to ESP8266 NodeMCU using Arduino IDE
  • Click on the Serial Monitor icon to open it.
Arduino IDE - How to open serial monitor
  • View the outcome in the Serial Monitor.
COM6
Send
Hello World! I am ESP8266! Hello World! I am ESP8266! Hello World! I am ESP8266! Hello World! I am ESP8266!
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

Modifying ESP8266 Code

  • Replace “Hello World!” with a different text, such as “ESP8266 Get Started”.
  • Then, upload the code to ESP8266.
  • Finally, view the result on the Serial Monitor.
COM6
Send
ESP8266 Get Started
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

Video Tutorial

Function References

. Congratulations!
. You have accomplished the initial step in your ESP8266 education experience. Keep going!