Home Automation the Switch
by Johermohit in Circuits > Microcontrollers
1395 Views, 15 Favorites, 0 Comments
Home Automation the Switch
This is a IOT socket designed as a part of full automation project
Bill of MATERIALS
- ESP-01 8266 board
- raspberry pi { i used for local mqtt server BUT can be replaced with cloud server }
- piece of zero pcb
- a Ams 1117 (smd varient)
- an old charger chip (or any small 5v power supply)
- a relay module (or a relay combo made with transistor)
- a piece of ply board .5 cm thick
- a switch
- socket
- connecting wire
- soldering iron
- cutting saw 4 ply
- hot glue gun or any adhesive u prefer
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
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 )
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
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
Programming Esp
The Code
https://github.com/johermohit/Rocket/blob/master/e...
code is on github just replace your info with mine
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