ESP8266 ESP-07 Wifi Transceiver LED On Off

by Dimitris Harir

I bought a very inexpensive wifi transceiver the from ESP8266 ESP-07 ebay. The ESP8266 has powerful on-board processing and storage capabilities that allow it to be used with sensors and other application specific devices through its GPIOs with minimal development up-front and minimal loading during runtime. Its high degree of on-chip integration allows for minimal external circuitry.


I will show you how to update the firmware of the module and control a green led.


The ESP8266 has many versions mine has 16 pins VCC, GND, REST, CH_PD, ADC (analog to digital converter), RX, TX, and 9 GPIO pins. To send and receive data we need to connect it to the computer with an RS232 to serial converter, I used the CP2102. ESP8266 is 3.3 volt tolerant  so VCC RX TX need to be 3.3 volt. VCC will be connected to 3.3 volt output of the CP2102 to connect CP2102 RX and ESP8266 TX you may try without level shifter 3.3V should be enough for logical one in CP2102.  Just connect CP2102 RX and ESP TX pin. If that doesn’t work use level shifter. We must level shift the CP2102 TX to 3.3v before connecting it to the ESP8266 RX, just use a simple voltage divider like in the photo below.


I didn’t use any level shifting on the RX and TX of the CP2102 i connected them directly the TX RX on the ESP8266 but this may damage the module. You also have to pull up the CH_PD just connect it to VCC throw a 10K resistor. To flash new firmware you also need to connect GPIO0 to GND and now you are ready to connect the CP2102 to a COM port on the Coputer.

ESP8266                CP2102

VCC             –>          3.3V

CH_PD       –>         3.3V Throw a 10k resistor

RX              –>          TX

TX             –>           RX

GPIO0      –>          GNB

GND         –>           GND


Go to and download the nodemcu-flasher. After downloading the flasher extrack the .zip file and open the nodemcu-flasher-master folder and go to Win32 if you have 32 bit  windows or Win64  if you have 64 bit then find the δτφκιESP8266Flasher.exe and run it.








The ESP8266Flasher looks like this if you have connected the ESP8266 to the PC with CP2102 the COM Port will change automatically to the COM port that the CP2102 is connected if not change it. At Last press Flash(F) and wait. When it will finish it will look like the photo below.








Now disconnect GPIO0 from GND, close the nodemcu-flasher  and go to and download the latest version mine is unzip the file and open the LuaUploader. It will look like this.










Go to Immediate and copy paste the following code that i found in “” at Connect to your AP

    wifi.sta.config("SSID", "password")

press execute


then type

ip = wifi.sta.getip()

press execute
Great, our little ESP8266 module is connected to our local network with an IP


Lets control the led now.


Go to the Editor in the Lua Uploader and then got to and then to lua_examples and finally to webap_toggle_pin.lua. copy paste the code but comment out or delete the fist 2 lines because the causing  a problem. Also you mast add

ip = wifi.sta.getip()

in the top of the code.


in the Lua Uploader change the Filename from my.lua to init.lua and press Save to ESP.


ip = wifi.sta.getip()
gpio.mode(1, gpio.OUTPUT)
    conn:on("receive", function(client,request)
        local buf = "";
        local _, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP");
        if(method == nil)then 
            _, _, method, path = string.find(request, "([A-Z]+) (.+) HTTP"); 
        local _GET = {}
        if (vars ~= nil)then 
            for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do 
                _GET[k] = v 
        buf = buf.."<h1> Hello, Showme your code.</h1><form src=\"/\">Turn PIN1 <select name=\"pin\" onchange=\"form.submit()\">";
        local _on,_off = "",""
        if( == "ON")then
              _on = " selected=true";
              gpio.write(1, gpio.HIGH);
        elseif( == "OFF")then
              _off = " selected=\"true\"";
              gpio.write(1, gpio.LOW);
        buf = buf.."<option".._on..">ON</opton><option".._off..">OFF</option></select></form>";

OK that is it. Connect a LED to the GPIO05 throw a 100-200 Ohm resistor and from a phone or pc in the same network go to the module IP address mine is , you can tern on and off the led. I made this circuit. The ESP8266 want only 3.3V to work, the CP2102 is not needed. I made a hot spot with my phone and a can tern on and off the led gust be going to the browser and typing


6 Comments on “ESP8266 ESP-07 Wifi Transceiver LED On Off

  1. I simply want to mention I am just all new to blogging and site-building and definitely liked you’re web-site. Very likely I’m want to bookmark your site . You surely come with incredible posts. Thanks a lot for revealing your web page.

Leave a Reply

Your email address will not be published. Required fields are marked *