LC-WF-1-2

From LCWIKI
Jump to: navigation, search

Product name

5V ESP8266 2-way WiFi Relay Internet of Things Smart Home Mobile APP Remote Switch


Overview

LC 5V ESP8266 2-way WIFI relay module uses ESP-01 as the WIFI module, and cooperates with ST's mature and stable 8-bit MCU chip. It only needs a simple configuration process to realize the wireless control of the 2-way relay in the LAN using the mobile APP.
LC-WF-1-2-1.png



Features

1. Onboard high-performance microprocessor STM8S103 and ESP-01 WIFI module
2. The module has 2 working modes
Mode 1: The mobile phone is directly mounted on the WIFI module
Mode 2: The mobile phone and WIFI module are installed on the router at the same time
Additional function: It can also be used as a USB relay when the ESP-01 is unplugged

3. Transmission distance:
(1) In an open environment, when the mobile phone is mounted on the WIFI module, the maximum stable transmission distance is 100m
(2) When the WIFI module and the mobile phone are installed on the router at the same time, the transmission distance depends on the signal strength of the router

4. Use Smartconfig technology to complete the configuration of the ESP-01 WIFI module account and password on the mobile phone APP. The configured account and password have a power-off memory function
5. Onboard 5V, 10A/250V AC 10A/30V DC relay, which can continuously pull in and out 100,000 times, has diode effusion protection, and short response time
6. Onboard mode selection and real-time working status indicators
7. Reserve UART debugging interface and STM8 SWIM program download interface



Interface description

Board size: 59*40mm
Board function description:
1. Onboard resource introduction:
IN+, IN-: 5V power input TX, RX: UART serial port pins
5V, GND, SWIM, NRST: STM8S MCU program download port.
Button S1: mode switching, the default is mode 1
Button S2: restore factory settings
LED D2 and D4 (red light): Relay working indicator light, light up when turned on
LED D7 (red light): mode 1 indicator light
LED D5 (blue light): mode 2 indicator
LED D6 (green light): working status indicator, described as follows:
(1) When it is off, it means it is self-configuring or loses connection with the router
(2) When the 0.5S blinks quickly, it means waiting for the mobile APP to configure the WIFI account and password for the ESP-01 module
(3) When 2S flashes slowly, it means the configuration is complete, waiting to establish a TCP connection with the mobile phone
(4) When it is always on, it means that the TCP connection with the mobile phone has been successfully established.

Reserved 2 jumper caps: Please insert them to the bottom during normal use (that is, RX connects to RX1, TX connects to TX1). Otherwise there may be interference)
COM1: Common port
NC1: normally closed terminal, short circuit with COM1 before the relay pulls in, and hang in the air after the pull-in
NO1: Normally open, suspended in the air before the relay pulls in, shorted with COM1 after the pull-in
COM2: Common port
NC2: normally closed terminal, short circuit with COM2 before the relay pulls in, and hang in the air after the pull-in
NO2: Normally open, suspended in the air before the relay pulls in, shorted with COM2 after the pull-in

  • Relay control command (hexadecimal format):

Open the first relay: A00101A2
Close the first relay: A00100A1
Open the second relay: A00201A3
Close the second relay: A00200A2



Instructions for use

Preparation before use:
1. 5V/1A power adapter, the positive and negative poles of the power supply are respectively connected to the IN+ and IN- of the module;
2. Install the APP "EspTouch_Demo" on the Android phone to configure the WIFI account and password for the ESP-01 module when using working mode 2 for the first time;
LC-WF-1-2-2.png

3. Install the APP "EasyTCP_20" on the Android mobile phone, a TCP transmission tool for sending relay control commands, click "SWITCH", and then long press the gray square in the interface to input the name and content of the 2-way relay control commands (the command format is HEX format).
LC-WF-1-2-3.png LC-WF-1-2-4.png

LC-WF-1-2-5.png LC-WF-1-2-6.png


  • Mode 1:

1. Plug in the ESP-01 module, power on the module, and after about 4S minutes, the green light changes from off to 2S slow flashing, indicating that the configuration is complete;
LC-WF-1-2-7.png

2. Connect the mobile phone to the AP hotspot signal sent by the ESP-01 module;
LC-WF-1-2-8.png

3. Open the "EasyTCP_20" APP, click "CONNECT", enter the IP address: 192.168.4.1 and port number 8080, and then click "Connect". After the connection is successful, the green light will change from flashing slowly for 2 seconds to always on, and click the gray box to Commands can be sent to control the switching of the relay.
LC-WF-1-2-9.png LC-WF-1-2-10.png

LC-WF-1-2-6.png LC-WF-1-2-11.png

LC-WF-1-2-12.png


  • Mode 2:

1. Plug in the ESP-01 module, power on the module, wait for the green light to flash slowly, then press the S1 key to switch to mode 2, the blue light is on, and the green light changes from off to 0.5S fast flashing after about 1 minute, indicating Waiting for the "EspTouch_Demo" APP to configure the WIFI account and password for it;
LC-WF-1-2-13.png

2. At this time, the mobile phone is connected to the router first, open the "EspTouch_Demo" APP, enter the router password, and click "Confirm";
LC-WF-1-2-14.png LC-WF-1-2-15.png

3. Wait for the configuration to be successful. When the IP address of ESP-01 (such as 192.168.0.174) appears on the APP interface, it means that the ESP-01 module has successfully connected to the router, and automatically remembers the account and password. The next time you enter mode 2, it will automatically Connect (about 20-60S to connect);
LC-WF-1-2-16.png LC-WF-1-2-17.png
Note: The IP address of 192.168.0.174 is dynamically assigned to the ESP-01 module by the router. The address may change after the next reconnection. You can check the ESP-01 module in the device list of the router. The real-time IP address of the group.

4. Open the "EasyTCP_20" APP, click "CONNECT", enter the IP address of the ESP-01 module: 192.168.0.174 and port number 8080, and then click "Connect". After the connection is successful, the green light will change from flashing slowly for 2 seconds to constant On, click the gray square to send commands to control the switch of the relay;
LC-WF-1-2-9.png LC-WF-1-2-18.png

LC-WF-1-2-6.png LC-WF-1-2-11.png

LC-WF-1-2-21.png

  • Additional features:

Prepare a USB-to-TTL serial port module, connect the GND, TX, and RX of the TTL module to the GND, TX, and RX of the relay module respectively, unplug the ESP-01 module, select mode 1, and wait for the green light to flash slowly for 2 seconds before running on the computer Open the serial port debugging software (such as SSCOM32), select the baud rate as 115200, and send A0 01 01 A2 in hexadecimal (hex) form to open the relay; take the first relay as an example, send A00101A2 to open the first relay relay;
LC-WF-1-2-22.png

LC-WF-1-2-23.png
Kind tips:
1. It will take a little longer (about 1 minute) for the first use to configure the WIFI password, etc. After the configuration is completed, it only takes 20 seconds to automatically connect to the next startup.
2. If you want to replace the router, you can power off and restart or press the S2 key (pressing the S2 key will clear the previously memorized WIFI account and password), and reconfigure the WIFI account and password for ESP-01 in mode 2.
3. When the signal of the router remembered by ESP-01 is weak or the connection is interrupted because it is not in the service area, the green light will go out and automatically try to connect. During this process, the button is invalid. When the green light changes to 2S slow flashing, it means that the connection has been resumed .
4. In mode 1 and mode 2, the button is only available when the green light flashes slowly or is always on for 2 seconds. In other cases, the chip is self-configuring or waiting for the configuration process, and the button is invalid.
5. ESP-01 has a timeout mechanism. If there is no data exchange between the mobile phone and ESP-01 for more than 6 minutes, the TCP connection will be automatically disconnected. At this time, click "CONNNECT" in the upper right corner of the "EasyTCP_20" APP to re-establish the connection.