Alexa Enabled Smart WiFi Switch

Hello world! Smart homes are coming and nothing short of an apocalypse can stop them. And no, we will not DIY an apocalypse, instead we will jump on the band wagon and build a smart switch to call our own. Read on to jump into the build!

  1. Following are the components you’ll need (The links given are affiliate ones, do consider buying from them if it doesn’t cost you any extra):
    1. ESP01:
    2. 4 channel relay module:
    3. 5V ac to dc converter:
    4. 5V to 3.3v step down power supply:
    5. Proto board:
    6. 10k resistor x 2
    7. Female header strip:
    8. 1000uF capacitor:
    9. Metal Oxide Varistor 400V (Optional)
    10. Jumper wires:
    11. Twisted 18AWG wires for AC
    12. A box to hold em all

Step 2: Prepare the interface board by referring to the connection diagram given below.

Step 3: Place the relay inside the box and wire up the output of relay with the twisted wires as shown below. Attach MOV to across the output of whichever relay you will use to control an inductive load like a fan or CFLs.

Step 4: Download the code from and upload it to the ESP01 module. Check out my previous post if you need help.

Step 5: Connect the interface board to the relay as shown in the connection diagram below.

Step 6 : Power up the project and setup your echo device by saying “Alexa, discover devices”. This will take some time, once its completed you will be able to see new devices on your alexa app.

Step 7: Try the commands! Say “Alexa, turn on fan” or whatever device names you used in the code.

Step 8: Connect it your switch board referring to the images given below.

I hope you enjoyed this post, see you in the next one!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: