Sunday 3 July 2016

Automation using Wi-Fi

Automation using Wi-Fi


Wi-Fi(Wireless-Fidelity) is a Wireless communication protocol part of IEEE 802.11 standard
Wi-Fi is commonly used to create ad-hoc  network by creating access point.Unlike Bluetooth Many wifi devices can connect to same access point. ESP8266 is a Serial Wi-Fi module.
It has eight pins starting from 
Row-1
Top right (1) Vcc(3.3v) level sensitive  
Top left (2) Rx 
Row-2
 Right(3) Reset - connect it to 3.3v for normal operation
 Left (4) GPIO1 - Can be used as I/O
Row-3
 Right(5) CH_PD- connect it to 3.3v for normal operation
 Left(6) GPIO2- Can be used as I/O
Row-4
Right(7) Tx
Left(8) Gnd

Similar to Bluetooth configure Wi-Fi in AT command mode 
using USB-TTL converter 
 CoolTerm software

1. AT - OK
2. AT+CIOBAUD ?
GIVES COMMUNICATION BAUD RATE
3. AT+CIPMUX=1
CONNECT WITH MANY DEVICES
4. AT+CWMODE=3
STATION+ACCESS POINT
5. AT+CIFSR
GIVES DEVICE IP
6.AT+CWSAP="NAME","PASSWORD",5,3
TO CREATE ACCESS POINT
7.AT+CIPSERVER=1,80
START SERVER AT PORT-80







Microcontroller pins cannot drive relay directly hence a driver circuit is required.
Driver should have good current gain. CE or CC configuration is preferred
Relay has 5 terminals 
1. Vdc - 5v
2.Gnd- connect it to  Collector pin of BJT
3. Common - Connect it to AC/DC source
4. NC- Normally close connect it to load1 
5. NO- Normally open connect it to load2

or else connect only one load to any of these two pins (4,5)
so that you can switch only one device at a time.


Download-code

1 comment: