10 Channel Wi-Fi Switch for Smart Home

by Northstrix in Circuits > Microcontrollers

1190 Views, 9 Favorites, 0 Comments

10 Channel Wi-Fi Switch for Smart Home

IMG_20210127_215221_hdr.jpg

This device can help you automate your home, backyard, or whatever you want.

Gather the Components

IMG_20210128_165006.jpg

To build this device, you'll need:

  1. ESP8266 x1;
  2. 4-stage ripple (binary) counter (I can suggest SN74LS93N) x1;
  3. 14-stage ripple counter (CD4020BE is the best choice) x1;
  4. Latches (SN74LS75) x6. Since each SN74LS75 consists of 4 latches, only 2 ICs are needed;
  5. LEDs x10;
  6. 470 ohm resistors x10;
  7. 10k resistor x1;
  8. 20k resistors x2;
  9. 33k resistors x2;
  10. 50k resistor x1;
  11. LM317 x1;
  12. ULN2003 x2;
  13. Relays x10;
  14. Power supply for ESP x1;
  15. Power supply for relays.

Note: You can use CD4024B Instead of CD4020BE and SN74LS93N.

Flash ESP

IMG_20210128_192048.jpg

You can find the code here:
https://github.com/Northstrix/10_Channel_Wi-Fi_swi...

You'll find these two strings in the code:

const char* ssid = "Mobile Hotspot 1290"; // Your SSID (Network's name)

const char* password = "seasidehills1234"; // Password from your network

Modify it to match your Wi-Fi credentials.

Enter the Device's IP Address in Any Browser

IMG_20210128_175758.png
Web interface.png

If you're using your phone as an access point, go to the device details, look at the IP address and enter it in any browser. After you've entered the device's IP address, you'll see the web interface.

Customize the Web Interface

1.png
2.png

Delete the highlighted string and change: 10 channel Wi-Fi switch; Channel1; Channel2; etc. For whatever you want. An example of a customized web interface is in the second screen.

Don't forget to flash ESP.

Check the Customized Web Interface

3.png

It should look like this. You can also play with colors or completely redesign the whole thing. It's up to you.

Schematic Diagram (CD4024B As a Counter)

10_ch_rel_theor.png

Finally, it's time to put all of the components together.

Schematic Diagram (CD4020B and SN74LS93 As Counters)

10_ch_rel.png

I picked this one.

Assemble the Chosen Circuit

10_ch_rel_esp.png

The best-case scenario is to solder every component to the PCB.

Connect the LEDs

10_ch_rel_led.png

Connect the Display

10_ch_rel_disp.png

Power Up the Device and Check If It Works

IMG_20210127_214658_hdr.jpg

I've already played with this staff and turned on the channels 2,4,5,7,10.

Connect the ULN2003 and Relays

10_ch_rel_ULN.png

WARNING!
High voltage is dangerous. Improper wiring on that step may lead to an injury, including potentially fatal injuries or even death. If you're not sure that you can wire the relays correctly, either stop at step 11 or don't supply a high voltage to the circuit.

Check the Whole Thing

IMG_20210128_120257.jpg
IMG_20210128_120304.jpg
IMG_20210128_120320.jpg
IMG_20210128_120325.jpg
IMG_20210128_120333.jpg
IMG_20210128_120345.jpg

Since I'm not going to actually use this device, I've only connected one relay to test it.

The reason why I didn't connect a high voltage load to the circuit is that I'm not going to show an example of crappy wiring.

And by the way. Don't use the relay which I've used if you intended to supply high voltage to this thing.

Known issues:

The display might not work correctly without a 0.1 µF capacitor between GND and +5V;
The content of the display might disappear after seconds (Although it's not always the case.)