Introduction: Light Control by Hybrid WiFi Connection

This circuit allows the switch between on/off for your lights, by your smartphone, tablet or computer and by an ordinary switch. It will work like in the video of the bottom but by a webpage.

Este circuito te permite el cambio entre prendido/apagado de tus luces, desde tu celular inteligente, tu tablet o computadora y un switch comùn. Funcionara como el video de abajo pero con una pagina WEB en vez de una aplicacion.

Step 1: Material

  1. 1x ESP8266
  2. 1x WiFi conection
  3. 1x 7486 XOR (Or 7400 NAND)
  4. 1x Transistor NPN TIP41c
  5. 1x 100 Ohm resistor
  6. 1x 470 Ohm resistor
  7. 1x Relay module
  1. 1x ESP8266
  2. 1x Conexión WiFi
  3. 1x XOR 7486(o NAND 7400)
  4. 1x Transistor NPN TIP41c
  5. 1x Resistencia de 100 Ohms
  6. 1x Ressistencia de 470 Ohms
  7. 1x Modulo relevador

Step 2: Connections/Conexiónes

Proceed to connect the gate XOR (Or exclusive), in case of not have it, you can build it by a 7400 (NAND), in my case i used the 7400 NAND gate, i made the diagram in proteus for an easy understanding of any circuit.

P.D.: Dont forget to connect the GND and VCC pins of the IC almost in all IC those pins are GND = 7 VCC = 14

Like in the image says one input comes from the arduino, that in this case is the 13 pin, and another by the ordinary switch, well the ordinary switch needs to be connected with a pull-down connection like in the image explain and the resistor could be from 1K to 10K.

In the relay is such an easy thing you only need to change your ordinary switch to the switch of the relay like in the image PLEASE do NOT connect the relay with the power on.

Proceda a conectar la comperta XOR (Or exclusiva), en caso de no poseer una, tu puedes construirla con una 7400 (NAND), en mi caso yo use la compuerta 7400 NAND, hice el diagrama en proteus para un mejor entendimiento para cualquier circuito
P.D.:No olvides conectar los pines GND y VCC del CI casi en todos los circuitos integrados son GND = 7 y VCC = 14. Como en la imagen dice, una entrada viene del arduino, que en este caso es el pin 13, y otro viene del siwtch comun, bien el switch comun necesita esta conectado con una conexión tipo pull-down como en la imagen se explica y la resistencia puede ser desde 1k hasta 10k.

En el relé es muy fácil sólo tienes que cambiar el switch comun al interruptor del relé como en la imagen Por favor, al conectar el relé desconecte la corriente.

Step 3: Other Type of Connection/Otro Tipo De Conexión

If you have the two way light switch wiring like the shown in the picture, this circuit will be easier because de relay module has 3 terminals that can be used like and stair switch so you will only have to change one switch with the relay module, in my case i have this kind of connection so i did it like this.

Si tu tienes un circuito tipo escalera para tu lampara, el circuito se hará mucho mas sencillo ya que el relevador tiene 3 terminales, un comun y un NC y NA, lo que equivale al switch tipo escalera, ya lo unico que tendras que hacer sera cambiar el switch por el relevador, yo tengo este tipo de circuito asi que lo hice de esta manera.

Step 4: Connections of ESP8266/Conexiones Del ESP8266

The connection to the relay is very easy you only have to connect GPIO 13 from the ESP8266 to the base of the transistor with the 100 ohms resistor the collector to one part of the relay and the emitter to ground with the 470 ohms resistor we use the transistor because the current provided by the esp8266 isn't sufficient.

In case of not having the two way light switch wiring you will use te second circuit which we did in th step 3 and connecting the common switch to the XOR gate.

Español:

La conexión al relevador es muy sencilla solo tienes que conectar el GPIO 13 del ESP8266 a la base del transistor con la resistencia de 100 ohms, el relevadoral colector y el emisor a tierra por medio de la resistencia de 470 Ohms

En caso de no tener la conexión tipo escalera deberas usar la conexión de la segunda imagen con el circuito armado previamente en el paso 3 y de la salida de la XOR conectar el transistor y el relevador.

Step 5: Programming/Programación

English:

First of all you'll need to have the ESP8266 library and module installed in the Arduino IDE if you dont have it you can follow this instructable

"https://www.instructables.com/id/Programming-the-ES...

Now if you have all installed is time to program your ESP8266 this program made by me works in all version of the ESP8266 even in the ESP-01, if you use this you will need to change only the GPIO used in the program, this program creates a webpage on its IP where you can acces and it will ask you for an user and a password, before defined in the program, once verified your user you will enter to a very simple interface with only one button to toggle the state of the light.

Also you can acces by ESP866.local but is slower.

The program is here.

Español:

Antes que todo, necesitaras tener la libreria y el modulo ESP8266 instalado en tu IDE de arduino, si no lo tienes instalado puedes seguir este instructable

https://www.instructables.com/id/Programming-the-ES...

Ahora si tu ya tienes todo instalado es hora de programa tu ESP8266 este programa creado por mi trabaja en todas las versiones del ESP8266 incluso en la ESP-01 solo tendras que campiar el GPIO usadoen el programa, este programa crea una pagina web en su propia IP donde tu puedes accesar y esta te pedira un usuario y contraseña, previamente cambiados en el programa, una vez verificado el usuario entraras a una pagina muy sencilla con un botón para cambiar el estado de nuestra luz.

Ademas puedes accesar por ESP8266.local pero es mas lento.

El programa esta aqui.

Step 6: Testing/pruebas

Once you have done all your connections and programming is time to test so, open your favorite browser and your Serial monitor and restart your ESP8266 it will connect to your WiFi and it show you its IP which you'll need to access, once accessed put your user and password in order to proceed to the principal page and get access to our button to toggle our light

Español:

Una vez hechas todas las conexiónes y haber programado tu ESP8266 es hora de probarlo, abre tu explorador favorita y abre tu monitor serial y resetea tu ESP8266, se conectara a tu WiFi y mostrara su IP a la cual deberas accesar desde tu explorador, una vez dentro de la pagina deberas ingresar tu usuario y contraseña para accesar a la pagina principal donde se encuentra nuestro boton para apagar y prender la luz.

Hack Your Day Contest

Participated in the
Hack Your Day Contest