Introduction: Home Automation the Switch

About: learn alot and save the universe

This is a IOT socket designed as a part of full automation project

Step 1: Bill of MATERIALS

  1. ESP-01 8266 board
  2. raspberry pi { i used for local mqtt server BUT can be replaced with cloud server }
  3. piece of zero pcb
  4. a Ams 1117 (smd varient)
  5. an old charger chip (or any small 5v power supply)
  6. a relay module (or a relay combo made with transistor)
  7. a piece of ply board .5 cm thick
  8. a switch
  9. socket
  10. connecting wire
  11. soldering iron
  12. cutting saw 4 ply
  13. hot glue gun or any adhesive u prefer

Step 2: Making the Enclosure

cut a piece of ply bard such that the socket fits into that

then Screw it properly

now Do Same for the the switch and secure it with screws

now for side panel

try to stack all things like charger circuit and relay in such a way that it saves the space

them measure the height and cut sides accordingly

Step 3: THE Inner Electronics

power Supply for ESP_8266

esp works om 3.3v

BUT we have 220v ac, so we will use an old phone charger to convert 220v ac to 5v dc

and use AMS 1117 voltage regulator bring it down to 3.3 v

FOR RELAY

Relay works on 5 v so We will use same chargers output tp o power relay

(signal will be given by our esp )

Step 4: Mounting the Esp and RELAY

i used female header so that esp can be replaced or code could be uploaded

for Normal working

connect

CH_pd to Vcc

ground to ground

Gpio 1 as signal pin for Relay

RELAY CONNECTIONS

gnd --- gnd charger

5v --- charger 5 v

signal ---- GIOP 1 of ESP

Step 5: Setting Up the Broker

For Setting up a broker check

https://www.instructables.com/id/Installing-MQTT-B...

and one its done now its time for coding ESP8266

Step 6: Programming Esp

Step 7: The Code

https://github.com/johermohit/Rocket/blob/master/e...

code is on github just replace your info with mine

Step 8: The Control

Two ways to do that:

1. Paho mqtt - a python based esp client emulated on rpi itself letting u publish over mqtt by cli

2. android Apps on play store : recommended

So connect th box to mqtt and rock your world

Arduino Contest 2017

Participated in the
Arduino Contest 2017

Remote Control Contest 2017

Participated in the
Remote Control Contest 2017

Raspberry Pi Contest 2017

Participated in the
Raspberry Pi Contest 2017