Simple to Implement WiFI Control in Your Home

by kevinmaker2018 in Circuits > Wireless

8321 Views, 14 Favorites, 0 Comments

Simple to Implement WiFI Control in Your Home

ESP01S Relay

ESP-01S is a cheap and easy to use wireless solution. By combining with other sensors and actuator, remote monitoring and control can be realized conveniently.

In this project, I am going to built a smart switch to control the Fan by the ESP-01S Relay module via Android app.

Package List:

1 x ESP-01S Relay Module

1x USB- UART Convertor- CP2102

1x 5V-1A AC/DC Power Adapter with Cable

Flashing Your ESP With NodeMCU

esp8266_pinout_h-569x236.png
flashing_esp-01.png

In this tutorial we are going to use the NodeMCU. You have to flash your ESP with NodeMCU firmare.

1.Hardware Connection

Wiring:
· RX -> TX

· TX -> RX

· CH_PD -> 3.3V

· VCC -> 3.3V

· GND -> GND

2.Downloading the NodeMCU Flasher for windows.

Win32 Windows Flasher

Win64 Windows Flasher

You can click here to find all the information about NodeMCU flasher.

3.Flashing your ESP8266 using Windows

Open the flasher that you just downloaded and a window should appear.

Press the button “Flash” and it should start the flashing process immediately (You might have to change some of the settings on the Advanced tab). After finishing this process, it should appear a green circle with a check icon.

Uploading Code

ESP-01 Program set.png
ESP-01 Program set-1.png
ESP-01 Program set-2.png
ESP-01 Program set-3.png

1.Dowloading LuaLoader

Click here to download LuaLoader

2.Schematics (3.3V USB- UART Convertor)

The schematics for this project are very straight forward. You only need to establish a serial communication between your USB- UART Convertor and your ESP8266.

3.Uploading code

Run LuaLoader.exe

Select your USB-UART Conventor port

Click ''Connect'' ,

Upload the file: init.lua(the ESP-01 Relay v4.0.lua)

Hardware Connection

ESP-01 Relay.jpg
ESP-01 Fan.png

After upload the code, Connect the power and Fan to the ESP-01 Relay board.

Installed the ESP8266 Controller to Your Android Phone

ESP8266 Controller.png

1.Click here to download the .apk file

2.Unzip the folder

3.Move the .apk file to your Android phone

4.Run the .apk file to install the app

Relay Control

Relay phone control.jpg

Run the ESP8266 Controller, Click the button “Set IP Address” on the bottom of the screen and type your IP address (in my case 192.168.1.1).

Now you can turn the GPIO0 high and low with your smartphone.

GPIO0 ON : Open the fan

GPIO0 OFF: Close the fan