LC-WF-1-1

From LCWIKI
Jump to: navigation, search

Product name

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


Overview

LC 5V 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 local area network.


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. 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



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.
LC-WF-1-1-1.png

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
LC-WF-1-1-2.png

(7) Use an Android phone to connect to the hotspot (AP) signal sent by the WIFI module
LC-WF-1-1-3.png

(8) Install the "EasyTCP_20" APP on the Android phone, click "connect" to enter the IP address and port number
LC-WF-1-1-4.png LC-WF-1-1-5.png

(9) Long press the function block in the APP interface, and input the content and name of the command [A00101A2 turns on the relay, A00100A1 turns off the relay, the format of the command is hexadecimal (hex)]
LC-WF-1-1-6.png LC-WF-1-1-7.png

(10) Click the function box to send serial commands through the mobile phone to control the relay
LC-WF-1-1-8.png


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
LC-WF-1-1-9.png

(8) Connect the mobile phone to the router
LC-WF-1-1-10.png

(9) Install the "EasyTCP_20" APP on the Android phone, click "connect" and enter the IP address and port number
LC-WF-1-1-11.png LC-WF-1-1-12.png

(10) Long press the function block in the APP interface, input the content and name of the command [A00101A2 to turn on the relay, A00100A1 to turn off the relay, the format of the command is hexadecimal (hex)]
LC-WF-1-1-13.png LC-WF-1-1-14.png

(11) Click the function block to control the relay by sending serial commands through the mobile phone

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 off the mobile phone. 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; "OK" or after inputting the AT command, press the "ENTER" key 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, connect the RX, TX, and GND pins of the USB to TTL module to the RX, TX, and GND pins on the module, and IN+ , IN-connect to 5V power supply, send A00101A2 to open the relay in hexadecimal form (hex), and A00100A1 to close the relay
5. If the relay cannot be closed or disconnected normally, it may be necessary to remove the resistor R4 on the module