ESP8266-01 LED Control

20,523

107

21

About: I'm Electronics & Telecommunication Engineer, Android & Web developer.

ESP8266 is a wifi SOC (system on a chip) produced by Espressif Systems . It is an highly integrated chip designed to provide full internet connectivity in a small package. And it can be also controlled by our smartphone by using an App. In this toturial I'm going to show that how you can control four LEDs connected to ESP8266-01 through your android app. ESP8266-01 having two gpios but here we are using RX & Tx of the esp as a gpio for controlling the LEDs. Also on the place of LED you can control your home appliances using relay module, I also going to give a ckt diagram of relay module. I hope you have lots of fun making this project. It is cheap, easy & useful.

Lets begin....

Step 1: Parts You Need:

1. ESP 8266 programming board

here is the link how you can make it

https://www.instructables.com/id/DIY-ESP8266-Progra...

2. A breadboard

3. asm1117 3.3v regulator

4. 10uf capacitor

5. LED x4

6. Some wires

7. 9v Battery

For Relay Board

1. Small dot matrix PCB

2. Relay 9v or any

3. Bc547 transistor

4. 10k ohm resistor x2

5. 1k ohm resistor x1

6. LED x1

7. Male & female headers

8. Wires

9. 9v Battery

Step 2: Flashing ESP With Nodemcu:

Extract The given folder

if your system is 32bit > Open folder Win32

if your system is 64bit > Open folder Win64

> Release

> Run Espflasher.exe

Connect gpio0 to gnd of your Esp programming board And then Connect it to your Laptop or pc.

> Select COM Port

> Click On Flash

Wait for process to be completed

After green tick appear your esp8266 is flashed with node mcu.

Step 3: Uploading Sketch :

>Connect your esp programming board to pc

>Extract ESPlorer.rar

>Run ESPlorer.jar

if you don't having java in your pc download from here

https://java.com/en/download/

>Click on open

>Select init.lua file

>Open it

>Change "rishabh" with your SSID

>Change "12345678" with your Password

>Select Port in my case it is com10

>Click Open Port

> When it Show Communicating with MCU

Connect and remove reset pin to ground

>Now it shows your node mcu version

>Click on Save to ESP

Wait till upload is complete

Step 4: Circuit on Breadboard

Make a connector for Esp to make esp breadboard friendly.

And Assemble the Circuit.

Step 5: Android App

Install the App

Type your esp8266 ip address and save it.

Now you can control four leds from your smartphone.

Enjoy!!

Step 6: Relay Board

Instead of LEDs you can control four relays.

Circuit for Relay board is given assemble it on pcb and the relay board is ready.

Enjoy switching your appliances wirelessly.

Hope you Like the Project....

Step 7:

Share

    Recommendations

    • First Time Author

      First Time Author
    • Big and Small Contest

      Big and Small Contest
    • PCB Contest

      PCB Contest

    21 Discussions

    0
    None
    Ghulamf1

    1 year ago

    Good job. I made it and working fine the only issue is " ESP is not connecting or working after off and on the system or rest. something is wrong ?

    7 replies
    0
    None
    RishabhLGhulamf1

    Reply 1 year ago

    When using a generic ESP8266 module, make sure you have a 100nf capacitor or similar over the power lines, as close to the chip as possible and Sufficient current supply.

    0
    None
    RishabhLGhulamf1

    Reply 1 year ago

    Use battery with voltage regulator asm1117 with capacitor. Remove ftdi or usb to ttl cable after programming esp8266..

    0
    None
    Ghulamf1RishabhL

    Reply 1 year ago

    Now every thing working fine but when I restart the esp it get freeze on load(LEDs) and without load(LEDs) restart also fine. restart without LEDs and than connect the LEDs also working fine. Some thing is wrong?

    0
    None
    RishabhLGhulamf1

    Reply 1 year ago

    No .. All fine.. Turning on esp with load make esp stuck that is drawback of that esp. You can do one thing connect a single switch between gnd terminal of all leds with gnd.

    0
    None
    Ghulamf1RishabhL

    Reply 1 year ago

    Finally get another solution with add one delay on relay at GND So, when power up the system esp will get connection after 02 sec delay relay will activate which will connect GND to GND.Furthermore modify the lua sketch to fix the IP of esp. Still i am looking for another smart way to solve this. Thanks for the idea

    0
    None
    Ghulamf1RishabhL

    Reply 1 year ago

    Yes it is working but it is not possible when project is installed. Is there any other solution for smooth operation. I also try to add diode but it is working only with GPIO 2 pin.

    0
    None
    ÁkosB8

    6 months ago

    Hi RishabhL!

    Thanks for this awsome tutorial, I have tried many other, but this was the fastest easiest, and best becouse of the 4 pin control, not only 1 or 2.

    I would like to have web URL shortcuts on my phone's homescreen, but for that, i have to know what web codes does your app send to the ESP. So could you help me with writing down the codes please?
    This is what I mean: 192.168.1.2:8080/LED1/ON or 192.168.1.2:8080/LED1/OFF

    Thank you again!

    1 reply
    0
    None
    RishabhLÁkosB8

    Reply 6 months ago

    for eg.... http://192.168.12.1/esp_ip?pin=1
    pin number will change from 1 to 8

    temp_464396531.jpg
    0
    None
    ufukagdas

    Question 10 months ago

    Hello. Does the nodemcu bin file have a sequence?

    0
    None
    HaqnawazA

    11 months ago

    connections

    serial out >>>>Esp8266

    TX>>>>>>>>Rx,--------, RX>>>>>>>>Tx,------,3.3v>>>>> CH_PD & vcc,-----,GND>>>>>GND & Gpio2. when i click "FLASH" nothing happens , 5-10 mins , help

    ScreenShot_20171228182815.pngScreenShot_20171228183541.png
    1 reply
    0
    None
    RishabhLHaqnawazA

    Reply 11 months ago

    try process after connecting gpio0 to ground. and reset the esp while flashing..

    0
    None
    FATIHK32

    1 year ago

    Communication with MCU proccess take too much time.

    Is it normal ? Where am I doing wrong ?

    1 reply
    0
    None
    RishabhLFATIHK32

    Reply 1 year ago

    Reset the Esp8266 by connecting rst pin to gnd. Or connect a push button between gnd & rst pin... While it takes too much time press the reset button.

    0
    None
    HamidZ12

    1 year ago

    Hi

    Thanks for your kind descriptions

    I have two problems:

    1- would you please share your MIT app inverter file

    2- when I want to upload code to ESP, ESPlorer gives this message:

    Communication with MCU...

    ..........

    ..........

    ..........

    ......Got answer! AutoDetect firmware...

    Communication with MCU established.

    Can't autodetect firmware, because proper answer not received (may be unknown firmware).

    Please, reset module or continue.

    ŒcŒûg'Ÿlogœãäcp8ä‡lrl;lWaiting answer from ESP - Timeout reached. Command aborted

    1 reply
    0
    None
    RishabhLHamidZ12

    Reply 1 year ago

    Check port selected correctly. Reset eap8266 several times when error occure. Again flash the esp8266. Connect gpio0 to gnd then plug into ur pc.

    0
    None
    zoha imran

    1 year ago

    Aoa sir my project is remote control of home appliance with arduino through webpage for interfacing arduino with webpage i am using esp8266 esp 12...in project i am using master slave technique ...which means webpage will interface with master arduino through esp8266 then that master arduino will send signal to slave arduino through rf module ..and this slave will now light up the appliances....now main issue is i have made webpage communication between master slave has been done ...but interfacing of arduino with webpage is making problem ....my code is correct connections are correct but the code is not burning in wifi module it is giving error "

    Error : failed to open com6
    Error: espcom_open failed
    Error: espcom_upload_mem failed "
    Do you have some idea about it ?
    Moreover sir i wana ask we have to remove arduino chip when we are buring code in esp8266 ?
    Or we have to write the code in the same arduino file which we have developed while communication between master and slave ?

    0
    None
    MTKapp27

    1 year ago

    Can you please provide a screenshot of the app? this is really cool.