Upload
others
View
9
Download
0
Embed Size (px)
Citation preview
1
LC 5VWIFI Relay Module
ESP8266 5V WiFi Cellphone APP Relay Module
Internet of Things, Smart Home Teleswitch
36400-MP
Information including Drawings, Schematics, Links and Code (Software) Supplied or Referenced in this Document is supplied by MPJA inc. as a service to our customers and accuracy or usefulness is not guaranteed nor is it an Endorsement of any particular part, supplier or manufacturer. Use of information and suitability for any application is at users own discretion and user assumes all risk.
All rights are retained by the respective Owners/Author(s)Information is Subject to Change Without Notice
POWERRELAY CONTACTS
+-NO COM NC COM PORT
MANUAL
2
1. SummarizeLC 5V WiFi relay module carried a ESP8266 WiFi module and microcontroller.It will
send the serial port instructions to the cell phone APP and Implementation within the localarea network (LAN) for wireless control relay.
2. The function and characteristics
1. Onboard ESP8266 wifi module,In AP mode, it can be connected by 5 clients at thesame time;
2. Wifi relay module has two work modes:(1)cell phones carry on the wifi module directly;(2)cell phone and wifi module carry on the same router;
3. Transmission distance:(1) In the open environment, the maximum transmission distance is 400m when the cellphone carry on the wifi module directly ;(2) when the wifi module and cell phone carrying on the same router ,the transmissiondistance depend on the router’s signal intensity;
4. Onboard 5V, 10 A / 250VAC 10A /30 VDC relay, operates 100000 times continuously;Module with diode protection, fast response time;
3. Hardware and InstructionsSize: 45*28mmThe board function description:IN +,IN-: 5VDC power input;TX ,RX and GND: serial port debug pins;
Instructions:
1. Onboard the ESP8266 wifi module has three work modes: STA (client), AP (hot),STA + AP( hot +client), According to the work mode of wifi relay module to choose thecorresponding mode of ESP8266 wifi module .
2. Module need configuration by serial debugging software and USB to TTL modulesend serial command , TX ,RX ,GND,5V pin of USB to TTL module connect toRX ,TX ,GND,5V pin of ESP8266 relay module,and IN+,IN- connect to DC5V power.
3
3. The default Baud rate of wifi module maybe is 115200 or 9600,you can send ATcommand change it,such as: AT+CIOBAUD=115200. Recommend that you use 115200 in general conditions, but you should change it to 9600 when you use a cell phone to control the relay (because the Baud rate of the on-board MCU STC15F104W/N76E003 is 9600).
For work mode 1: (cell phones connected to the wifi module directly), Open the “USR-TCP232-Test-V1.3” Serial debugging software on the PC, send the following commands step by step:
1, AT+CWMODE=2, select AP mode;2, AT+RST, reset;3, AT+CIPMUX=1, open multiple connections;4, AT+CIPSERVER=1,8080, configure the TCP server, set the port number;5, AT+CIFSR, view the IP address in AP mode, such as: APIP, “192.168.4.1";6, AT+CIOBAUD=9600, set Baud rate to 9600.
4
7,Connect to the AP(Access Point) of ESP8266 wifi module on Android cell phone
8,Install the “EasyTCP_20” APP on the Android cell phone and open it, click“connect” and enter the IP address and port
5
9, Press the function blocks and enter the name and content of the serial command(A00101A2 open relay,A00100A1 closed relay,command format must be hex)
6
10, Finally you can send serial command to control the relay by click the functionblocks.
7
For work mode 2: (cell phone and wifi module carry on the same router), Open the “USR-TCP232-Test-V1.3” Serial debugging software on the PC, send the following commands step by step:
1, AT+CWMODE=1, select STA mode;2, AT+RST, reset;3, AT+CWJAP=<ssid>, <password>, let WiFi module connect to the router, forexample: AT+CWJAP="LCTECH","12345678";4, AT+CIPMUX=1, open multiple connections;5, AT+CIPSERVER=1,8080, configure the TCP server, set the port number;6, AT+CIFSR, view the IP address in STA mode, such as: STAIP, “192.168.1.103”;7,AT+CIOBAUD=9600,set Baud rate to 9600.
8
8, Using cell phone connect to the router
9, I nstall the “EasyTCP_20” APP on the Android cell phone and open it, click “connect” and enter the IP address and port
9
10, Press the function blocks and enter the name and content of the serial command(A00101A2 open relay,A00100A1 closed relay,command format must be hex)
10
11, Finally you can send serial command to control the relay by click the function blocks.
11
NOTE:
1. Wifi relay module need to reconfigure if restart
2. ESP8266 wifi module has a timeout mechanism, when the cell phone haven’t sentcommands to the ESP8266 wifi module over a period of time (default is 180s) , theESP8266 wifi module will kick off your cell phone, you can sendAT + CIPSTO = < time > on the PC to modify this time (time range 0-7200), such as:AT + CIPSTO = 3600.
3. If it not return OK and just return what you’ve sent commands when you use“USR-TCP232-Test-V1.3” configure the wifi module,you can press the ENTERbefore send commands
4. If it no response when you use “USR-TCP232-Test-V1.3” configure the wifimodule, maybe the baud rate is incorrect,You can try 115200 or 9600. but whenyou use cell phone control the relay, you must make sure the baud rate of wifi moduleis 9600(send AT+CIOBAUD=9600 can change it),because the baud rate of onboardMCU(STC15F104W/N76E003) is 9600
5. If you want to use a computer to control relay directly (baud rate is 9600), you canunplug the ESP8266 wifi module,and TX ,RX ,GND pin of USB to TTL module connect to TX ,RX ,GND pin of wifi relay module, IN+ and IN- connect to DC5V power. Send serial command(A00101A2 open relay; A00100A1 closed relay, command format must be hex) with serial debugging software on the PC tocontrol the relay.6. If the relay doesn't open or close, maybe you need remove the R4
11
22
33
44
DD
CC
BB
AA
Title
Num
ber
Rev
isio
nSi
ze A4
Dat
e:20
18/1
/2Sh
eet
of
File
:C
:\Use
rs\..
\ESP
8266
_Rel
ay_V
1.3.
SchD
ocD
raw
n By
:
IN3
OU
T2
GND 1
U2
ASM
1117
-3.3
C1
10uF
C2
10uF
C3
0.1u
F
GN
D
+3.3
+5
K1
R1
10k
R3
10K
R4
4.7K
R2
4.7KD
2
Q1
J3Y
D3 1N
4148
GN
D
1 2
J1 Hea
der 2
1 2 3
J2 Hea
der 3
NO
CO
MN
C
IN1
OU
T3
GND 2
U1
78M
05C
51u
FC
60.
1uF
R5
0R/n
ull
GN
D
VC
C
VC
C
R5=
0R V
CC
=5V
R5=
NU
LL V
CC
=12V
1 2 3 4
5 6 7 8
J4 Hea
der 4
X2A
_
GPI
O2
GPI
O0
RX
D
TXD
CH
_PD
RST
+3.3
RX
D+3
.3
TXD
GN
DG
ND
YX
W
V3
Nuv
oton
CPU
Rel
ay B
oard
1 2 3 4
J3 Hea
der 4
+5
SX
TXD
RX
D
C4
NC
GN
D
R8 10
K
C7
0.1u
F
GN
D
NR
ST
NR
ST P16
P02
PA3
P04
+3.3
+3.3
R6
NC
R7
NC
GPI
O2
+3.3
1 2 3
J5 Hea
der 3
P02
NR
STP1
6
P04
P0.5
/AIN
4/T0
/IC6/
PWM
21
P0.6
/AIN
3/TX
D2
P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