Turn on Led With Esp8266 & Arduino Through Web

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 => https://www.tinkercad.com/things/0oQMS0nq33i

See this project in Github gist=> https://gist.github.com/shahid249/421029a5fc65fbd30ab6c3e71af8efed

Download Code from Github Gist

1 Person Made This Project!


  • Leather Challenge

    Leather Challenge
  • Build a Tool Contest

    Build a Tool Contest
  • Make It Modular: Student Design Challenge

    Make It Modular: Student Design Challenge



Question 3 years ago

I'm new to this, but how do I find the IP address of the device? (I'm working on TinkerCAD with this, not a physical device)


Answer 3 years ago

Sorry for late reply!
In TinkerCAD there is no ip address because web app didn't provide network connectivity or client that can sent request to arduino, I use it for showing the connection diagram.
In physical device if you are using station mode the ip address is

DIY Hacks and How Tos

Cool project. You should enter this into the Microcontroller contest.