ESP01/01S RELAY MODULE TUTORIAL

34,128

14

13

Description

This WiFi relay based on AI-Thinker ESP-01/ 01S WiFi module, we use the GPIO0 of ESP-01/ 01S to control the relay by low level. It’s easy to DIY your smart switch to any device by your phone anywhere with this smart relay.

Specifications

  • Working voltage: DC 5V-12V
  • Working current: ≥250mA
  • Communication: ESP01 or ESP 01S
  • WiFi module Transmission distance: the maximum transmission distance is 400m (open environment, mobile phone equipped with WiFi module)
  • Load: 10A/ 250VAC, 10A/ 30VDC, 10A/ 30VDC, 10A/ 28VDC
  • Size: 37 x 25mm

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Material Preparation

In this tutorial, we only used the following materials:

  1. USB to UART FTDI Converter
  2. ESP8266 WiFi Serial Transceiver Module

and last but not least, ESP01/01S Relay Module.

We connect ESP8266 WiFi Serial Transceiver Module to ESP01/01S Relay Module so that we can control the relay via WiFi. To program ESP8266, FTDI Converter is required to be connected with ESP8266.

Step 2: Hardware Installation

As for the connection between ESP8266 and FTDI Converter, it is shown as diagram above or listed as below:

  1. RX -> TX
  2. TX -> RX
  3. VCC -> VCC
  4. CH_EN -> VCC
  5. GPIO-0 -> GND
  6. GND -> GND

The pins for ESP8266 is also labeled as diagram 2.

After done uploading the code to ESP8266, simply connect it to ESP01/01S Relay Module.

Step 3: Uploading the Code

For coding part, change the SSID and PASSWORD to your WiFi SSID and Password respectively. In the code, it is mentioned that serial begin is 115200, so make sure that the serial monitor is 115200 otherwise it will not display anything. We set the URL to https://192.168.0.178/ and it will be used later on.

Step 4: Results

When we access the URL, it will show as diagram 1 above. Make sure that you have been activated the ESP8266 along with ESP01/01S Relay Module with a range of 5V to 12V so that you can access the URL. The results for the module is shown as diagram 2 which LED lighted up indicated that the relay is ON.

Once we pressed the OFF in URL, the relay will be turned OFF simultaneously and vice versa for ON option.

1 Person Made This Project!

Recommendations

  • CNC Contest

    CNC Contest
  • Make it Move

    Make it Move
  • Teacher Contest

    Teacher Contest

13 Discussions

0
None
Rohan rai

Tip 15 days ago on Step 3

Does it need FTDI converter and how can I know the IP address ?

15676250754721192344624.jpg15676251406651310374356.jpg
0
None
trxgt05

Question 3 months ago

Thank you for this tutorial. With this and several other resources I got mine working with the relay module. I had issues getting the esp8266 to boot until I modded the relay board.

Also, the code does not set the IP to what you said. The router assigned what it wanted via DHCP. Good thing your code had the serial print out to see what it used.

My only problem now is the web page hangs and will not connect after a little while. When I reset the board it will work again for a bit. It doesn't matter how many time I turn on or off the relay while it is working. It just seems to be more time based like after a minute or two. Once it stops and the page no longer loads, I can still ping the IP. Any ideas why maybe the code is hanging up or something else is going on?

2 answers
0
None
steelcorsytrxgt05

Answer 23 days ago

Explain to me how you fixed the energy blink of PIN 0 when booting and I help fix your problem or improve it still

0
None
hto1678trxgt05

Answer 3 months ago

hola amigo buenas tardes serias tan amable de ayudarme que estoy colgado con la configuracion este es mi correo hto1678@gmail.com
gracias amigo.

0
None
steelcorsy

Question 23 days ago

I have a flickering energy when the module boots, do you can say me what I should to do? I would'nt like my garage door opened at every restart

0
None
skabens

Question 4 weeks ago on Step 4

dear All

can you please help to set wifi ssid network in the esp8266 device connected to a relay board

could not set it with my smartphone with the ESP Connect App and the esp8266 smartconfig APPLICATION.

it doesnt detect the device

in my wifi networks, i can see the Farylink_0375DD wifi network of the esp8266 device as an Access point and can ping its adress 192.168.4.1

i see its adress 192.168.4.1 but can't get to its web interface to set ip adress according to my network (i think it hasn't a web interface)

when i press the configuration button on the relay board it switches on and off quickly.

in my opinion problem comes from AccesPoint mode instead of Station Mode.

but i dont know how to switch to station mode. (dont have Arduino board)
can you please help ?
--
thank you very much for your support
--
Best Regards
Skabens

0
None
Rickybk

Question 3 months ago

I have the ESP01 (Without S) and doesn't work, i heard that they are not compatibles, or maybe my DC supply is not enough, according with specs this relay requires 250mA is this true ?

1 answer
0
None
wyoshioRickybk

Answer 7 weeks ago

I think a pull-up resister is required for CHPD pin.

0
None
YoottanaT

2 months ago

In this relay module , how can I attach button switch to control relay too?

0
None
k-vov

Question 6 months ago on Step 4

Good day! Please tell me which program you need to install on your smartphone to control the relay?
thank


Добрый день! Подскажите пожалуйста, какую программу нужно установить на свой смартфон для управления реле?
Спасибо

2 answers
0
None
trxgt05k-vov

Answer 3 months ago

All you need on your phone is an internet browser once the board is programmed.

0
None
rtootikk-vov

Answer 5 months ago

Могу написать небольшое рабочее приложение (под iOS)

0
None
rtootik

5 months ago

Specially registered on this site to thank you!!!