Introduction: Turn on Led With Esp8266 & Arduino Through Web

About: I like to make things in free time

The easiest way to turn on & off led via web, with arduino and esp8266 module

Its works by sending http request & url to turn on led.

Step 1: Connection With Arduino

Components Needs

Arduino UNO



220 ohm Resistor

1k ohm Resistor

2.2k ohm Resistor


Connect RX pin of esp8266 to arduino pin 3 | NOTE :- esp8266 RX pin use 3.3v more than that will kill the module, use resistor as shown in diagram.

Connect TX pin of esp8266 to arduino pin 2

esp8266 vcc pin to 3.3v output of arduino

and ground to ground.

Connect led to pin 12 of arduino.

Upload Code To Arduino

Before uploading codes to arduino be sure to check your esp8266 baud rate an set it, mine is (115200).

Then set up your SSID and password, or use it as a Access point mode.

// If you are using Access poin mode

remove the trailing slash from the front of this code, this will activate as access poin mode = > sendData("AT+CWMODE=1\r\n",1000,DEBUG);

And add trailing slash in front of => sendData("AT+CWMODE=1\r\n",1000,DEBUG);

and also in front of => sendData("AT+CWJAP=\"SSID\",\"password\"\r\n", 6000, DEBUG);

Because we don't need this code any more it is for Station mode.\\

After uploading code to arduino wait for the esp8266 to connect to the Router.

Find the IP address of the device and then go to your browser and see the magic.

Some Link For this project

See this project in Tinkercad =>

See this project in Github gist=>

Download Code from Github Gist