LC-WF-2-1
Contents
Product name
ESP8266 12V WiFi Relay Internet of Things Smart Home Mobile APP Remote Switch.
Overview
LC 12V WiFi relay module is equipped with ESP8266 WiFi module and microcontroller, which can send serial port instructions to the module through the mobile phone APP to realize wireless control of the relay in the LAN.
Features
1. Onboard ESP8266 WIFI module, in AP mode can connect 5 clients at the same time
2. The module has two working modes
(1) The mobile phone is directly mounted on the WIFI module
(2) The mobile phone and WIFI module are installed on the router at the same time
3. Transmission distance
(1) In an open environment, when the mobile phone is mounted on the WIFI module, the maximum transmission distance is 400m
(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. On-board 12V, 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;
Introduction
Board size: 45*28mm
Board function description:
IN+, IN-: 5V power input
TX, RX, GND: serial debugging pins
How to use:
1. The onboard ESP8266 WIFI module has three working modes: STA (client), AP (hot spot), STA+AP (client + hotspot), and select the working mode of the WIFI module according to the working mode of the module .
2. The module needs to use the serial port debugging software on the computer and the USB to TTL module to send AT commands to configure the WIFI module. The RX, TX, GND, and 5V pins of the USB to TTL module are respectively connected to the TX, RX, GND, and 5V pins on the module. 5V pin, IN+, IN- connected to 5V power supply.
3. The default baud rate of the WIFI module is generally 115200 or 9600, which can be modified by sending AT commands, such as: AT+CIOBAUD=115200. Generally, it is recommended to use 115200,However, 9600 is required when controlling the relay with a mobile phone, because the baud rate of the MCU (STC15F104W/N76E003) on the module is 9600.
Working method 1 (the mobile phone is directly mounted on the WIFI module), open the serial port debugging software on the computer, and send AT commands to configure the WIFI module in the following order:
(1) AT+CWMODE=2, select AP mode
(2) AT+RST, reset
(3) AT+CIPMUX=1, enable multi-connection
(4) AT+CIPSERVER=1,8080, open TCP service, set port number
(5) AT+CIFSR, check the IP address in AP mode, for example: APIP, “192.168.4.1”
(6) AT+CIOBAUD=9600 or AT+UART_CUR=9600,8,1,0,0 set the baud rate to 9600
(7) Use an Android phone to connect to the hotspot (AP) signal sent by the WIFI module
(8) Install the "EasyTCP_20" APP on the Android phone, click "connect" and enter the IP address and port number
(9) Long press the function block in the APP interface, and input the content and name of the command [A00101A2 opens the relay, A00100A1 closes the relay, the format of the command is hexadecimal (hex)]
(10) Click the function box to send serial commands through the mobile phone to control the relay
Working method 2 (the mobile phone and the WIFI module are installed on the router at the same time), open the serial port debugging software on the computer, and send AT commands to configure the WIFI module in the following order:
(1) AT+CWMODE=1, select STA mode
(2) AT+RST, reset
(3) AT+CWJAP=<ssid>, <password>, make the WIFI module connect to the router, for example: AT+CWJAP="LCTECH","12345678"
(4) AT+CIPMUX=1, enable multi-connection
(5) AT+CIPSERVER=1,8080, open TCP service, set port number
(6) AT+CIFSR, check the IP address in STA mode, for example: STAIP, “192.168.1.103”
(7) AT+CIOBAUD=9600 or AT+UART_CUR=9600,8,1,0,0 set the baud rate to 9600
(8) Connect the mobile phone to the router
(9) Install the "EasyTCP_20" APP on the Android phone, click "connect" and enter the IP address and port number
[[File: LC-WF-1-1-11.png]]
(10) Long press the function block in the APP interface, and input the content and name of the command [A00101A2 opens the relay, A00100A1 closes the relay, the format of the command is hexadecimal (hex)]
(11) Click the function block to send serial commands through the mobile phone to control the relay.
Kind tips:
1. If the WIFI module is powered off and restarted, it needs to resend AT commands for configuration.
2. The ESP8266 module has a timeout mechanism. When the mobile phone does not send commands to the module for a period of time (default 180S), the module will kick the mobile phone off.You can send AT+CIPSTO= on the computer to modify this time (time range 0-7200), such as: AT+CIPSTO=3600.
3. If there is no response when sending AT commands, it may be that the baud rate of the serial port debugging software is not selected correctly, generally 115200 or 9600;It may be that you need to check "Send New Line" or press "ENTER" after entering the AT command and then click "Send".
4. If you want to directly use the serial port debugging software on the computer to control the relay, you can unplug the WIFI module on the module, and connect the RX, TX, and GND pins of the USB to TTL module to the RX, TX, and GND pins on the module respectively.Connect IN+ and IN- to 5V power supply, send A00101A2 in hexadecimal form (hex) to turn on the relay, and A00100A1 to turn off the relay.
5. If the relay cannot be closed or disconnected normally, it may be necessary to remove the resistor R4 on the module.