How to Make WiFi Switch Using ESP8266

by MrSottong in Circuits > Arduino

1295 Views, 1 Favorites, 0 Comments

How to Make WiFi Switch Using ESP8266

photo_2019-10-06_11-32-23.jpg
photo_2019-10-06_10-58-26.jpg

In this tutorial I will show you how to make a wirelles switch using ESP8266. the communication media that I will use is a WiFi network.

In the previous tutorial I discussed about using ESP8266 to communicate using a WiFi network. You can read this article first to add insight into the working modes of ESP8266 for communicating via WiFi networks.

Required Component

IMG_7152.JPG
image823.png
IMG_6885.JPG
photo_2019-10-05_10-36-43.jpg

The components you need for this tutorial:

Assemble All Components

bitmap.png

The picture above is the circuit scheme that will be used.

In this tutorial I used Pin D0 as Output.

Programming

Capture.PNG

For this tutorial I will use Wifi Station Mode on ESP8266. With this mode, we can make Wirelless Switch without using internet networks. But the switch can only be used on the local network between Mobile and ESP8266.

I have provided a Sketch that you can download below.

Before uploading a sketch to NodeMCU. Make sure the NodeMCU board has been added in the Arduino IDE. If you haven't already you can see the way in this atikel "Get Started With ESP8266 (NodeMCU Lolin V3)"

Access Webpage

1.PNG
photo_2019-10-06_11-32-33.jpg

Here is how to operate this wireless switch:

After Sketch uploaded successfully

  • Open the Wifi menu on the android phone
  • Connect an android phone to SSID "NodeMCU"
  • Open Serial Monitor on Arduino
  • See the IP address displayed
  • Open the browser on an android phone
  • Enter the IP address on the monitor serial (192.168.4.1)

  • Then a web page will appear to control the LED

Result

photo_2019-10-06_11-32-17.jpg
photo_2019-10-06_11-32-23.jpg
photo_2019-10-06_11-32-26.jpg

To turn on the LED, press the "on" button

To turn off the LED, press the "off" button