Hello everyone, I am going to share my project of wifi switch.
My requirements:
It should incur low cost as far as hardware is concerned.
The device should be reliable as I would be using it to control lights at my home while I am on a vacation.
I should get an update on my mobile once the switch changes state.
Opted Solution:
For the hardware I chose ESP 8266-01 as the wifi and control module from Aliexpress with few other discreet low cost components.
A four channel relay board from NSK electronics India.
A 12-0-12, 500 milliamps transformer that was lying around with me.
For 3.3 volt supply required for the module I used a LM317 three terminal regulator.
The setup:
In this project I am going to use pins GPIO0, GPIO1 (RX pin), GPIO2, GPIO3 (TX pin) pins to control a four channel relay board.
Problems Faced:
During power up if the pins of the ESP8266-01 remain connected to relay board the module hangs and becomes useless, photo coupler on the IO pins even failed to be fruitful but if the unit is powered on without the relay module initially connected everything works nice as expected.
Solution:
To overcome this situation I used a strange but effective low cost idea. A small analogue delay circuit using 555 timer IC was used to power up the relay module that puts a 10-15 second delay so that the wifi module gets access to network before the relay board gets powered on.
Flashing the ESP is really easy just copy the code from the attachment and open in Arduino (I used version 1.6.8) have the necessary files copied in the libraries folder, select upload speed as 115200 and program the ESP. Regarding procedure to program the module there are lots of tutorials on the internet.
http://www.instructables.com/id/Low-Cost-4-Channel-Wifi-Switch-IOT-Application/