Introduction: 10 Channel Wi-Fi Switch for Smart Home
This device can help you automate your home, backyard, or whatever you want.
Step 1: Gather the Components
To build this device, you'll need:
- ESP8266 x1;
- 4-stage ripple (binary) counter (I can suggest SN74LS93N) x1;
- 14-stage ripple counter (CD4020BE is the best choice) x1;
- Latches (SN74LS75) x6. Since each SN74LS75 consists of 4 latches, only 2 ICs are needed;
- LEDs x10;
- 470 ohm resistors x10;
- 10k resistor x1;
- 20k resistors x2;
- 33k resistors x2;
- 50k resistor x1;
- LM317 x1;
- ULN2003 x2;
- Relays x10;
- Power supply for ESP x1;
- Power supply for relays.
Note: You can use CD4024B Instead of CD4020BE and SN74LS93N.
Step 2: Flash ESP
You can find the code here:
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.
Step 3: Enter the Device's IP Address in Any Browser
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.
Step 4: Customize the Web Interface
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.
Step 5: Check the Customized Web Interface
It should look like this. You can also play with colors or completely redesign the whole thing. It's up to you.
Step 6: Schematic Diagram (CD4024B As a Counter)
Finally, it's time to put all of the components together.
Step 7: Schematic Diagram (CD4020B and SN74LS93 As Counters)
I picked this one.
Step 8: Assemble the Chosen Circuit
The best-case scenario is to solder every component to the PCB.
Step 9: Connect the LEDs
Step 10: Connect the Display
Step 11: Power Up the Device and Check If It Works
I've already played with this staff and turned on the channels 2,4,5,7,10.
Step 12: Connect the ULN2003 and Relays
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.
Step 13: Check the Whole Thing
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.
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.)