Blink LED Using ESP8266 NodeMCU Lua WiFi Tutorial




Introduction: Blink LED Using ESP8266 NodeMCU Lua WiFi Tutorial


NodeMCU is an open source IoT platform. It includes firmware which runs on the ESP8266 WiFi SoC from Espressif, and hardware which is based on the ESP-12 module. The term "NodeMcu" by default refers to the filmware rather than the dev kits. The firware ESP8266 uses the Lua scripting language. It is based on the eLua project, and built on the Espressif Non-OS SDK for ESP8266. It uses many open source projects, such as lua-cjson and spiffs. LUA based interactive firmware for Expressif ESP8622 Wi-Fi SoC, as well as an open source hardware board that contrary to the $3 ESP8266 Wi-Fi modules includes a CP2102 TTL to USB chip for programming and debugging, is breadboard-friendly, and can simply be powered via its micro USB port.


  • Wi-Fi Module – ESP-12E module similar to ESP-12 module but with 6 extra GPIOs.

  • USB – micro USB port for power, programming and debugging

  • Headers – 2x 2.54mm 15-pin header with access to GPIOs, SPI, UART, ADC, and power pinsMisc – Reset and Flash buttons

  • Power – 5V via micro USB port

  • Dimensions – 49 x 24.5 x 13mm

Step 1: Material Preparation

Before you are getting started, prepare all the item needed:

  1. Breadboard
  2. ESP8266 NodeMCU Lua Wifi
  3. LED
  4. Jumper (if needed)
  5. micro USB

Step 2: Pin Connection

This is one of the most simple connection and suitable for a beginner. What u need is to connect LED's anode to ESP8266's D7 pin and LED's cathode to ESP8266 GND.

Step 3: Sample Source Code

Download this sample source code and compile it in your Arduino IDE

Step 4: Uploading

When u have succesfully building your connection on breadboard and write coding, you have to upload the coding into the ESP8266 by using a micro USB. Before uploading the coding, you have to install esp8266 into your Arduino IDE, you can check here.

Step 5: Blinking the LED

Now, you can see your LED succesfully blinking

Step 6: Videos

Be the First to Share


    • Electronics Contest

      Electronics Contest
    • Origami Speed Challenge

      Origami Speed Challenge
    • Science Fair Challenge

      Science Fair Challenge


    Mustafa tai
    Mustafa tai

    4 years ago

    thank ,

    but i want to on off led using ios device


    4 years ago

    That's a less than ideal instructable for two reasons:

    - while the title says "Lua" your code is actually for Arduino

    - if you don't put a resistor between the device and the LED you're gonna fry it sooner or later


    5 years ago

    The code you have provided seems to be written in Arduino. If you are indeed using an Arduino firmware on your ESP please remove the misleading "Lua" from the title.