Home Applience Switch Control Using Google Assistant
by Shoeb ALI in Circuits > Remote Control
259 Views, 1 Favorites, 0 Comments
Home Applience Switch Control Using Google Assistant
On 2021 I've made this project using in which I've used the DVD writer of my old PC and using it I was able to control the buttons. Now I'm sharing this project here also I've uploaded the youtube video link so you can go through it in detail if you need
About the Project : I've used esp8266 as microcontroller and then I've used an old DVD stepper motor driver (because of the length of the stepper motor slider the system is able to control only 3 buttons) at the platform of stepper motor I've attached an servo motor which push the button for ON/OFF .
Supplies
Hardware :
ESP8266 microcontroller
LM293D motor Driver IC
LM2596 Buck Controller
12V Power Adapter
OLD DVD writer (PC)
Servo motor(SG90 or MG90)
some wires for connection
and Zero PCB
Software / Application
Arduino IDE (Desktop)
Google Home(android app)
Google assistant(android app)
Online platform
Adafruit IO
IFTTT - Premium account
Design the Box With Buttons and Sockets
First image is the internal circuit connection of second image(connection between buttons and sockets) and we have to attach the stepper motor slider just above these buttons.
Preparing the Circuit Board
[PDF FILE OF THE CIRCUIT DIAGRAM IS ALERADY ATTACHED IN THE BOTTOM]
Let's start with the power supply
I've supplied the power through 12V, 1.5mp power adapter and then i've used an LM2596 buck convertor which will step down the voltage from 12V to 9V
(I don't have the 9V power adapter that's why i used LM2596 if you have 9V power adapter then you can eliminate the buck converter from your design)
now this 9V power supply is then fed to the VSS pin of L293D IC(for supplying power to stepper motor ) and then I've used another step down module (7805) which will convert this 9V power supply to 5V for supplying power to the ESP8266, servo motor and L293D IC
(I faved several issues while supplying 5V to stepper motor sometime the slider got does'nt move and sometime it struck before reaching the desired position and it works well when i've used 9V power supply for it)
In this circuit I've add two power option for ESP8266 first one is from the common 12V aapter for this you have you attach the jumper (shown in the circuit diagram)
and in second option if you are supplying power in ESP8266 through USB cable then you've to remove the jumper from the circuit
for interfacing stepper motor with the nodeMCU I've used L293D IC and for controlling it I've connected Pin D5,D6,D7,D8 of nodeMCU with input pins of L293D IC and its output pin is then connected with the stepper motor .
For servo motor I've used D1 pin of esp8266
After fixing and soldering all the components in PCB i attached this circuit board in the stepper motor slider
Downloads
Fixing Stepper Motor Slider With the Switch Box
On top of the switch box I've attached the stepper motor slider (shown in the second image) with the help of 4 bolts having length of 90mm and diameter of 5mm.
(while attaching the slider above the box leave enough space between them so that it can easliy mover above all three buttons and it's servo arm can easily reach on the buttons)
Arduino Code Configuration
Code is available below ("NODEMCU_ESP8266_G_ASSISTANT_SMART_ELECTRIC_BOARD.ino")
download below file and make a new folder in your arduino file directory and keep that folder name with the same name of this file (excluding the extension)
OR
open below file in notepad copy all the code and then paste it in the arduino IDE and upload that code but before uploading the code make some changes based on your adafruit IO configuration.
Now change the wifi credentials based on your network.
Adafruit Setup
- Go to adafruit.io website and click on feed > create new feed > give the name for the feed > create(1st image)
- Now click on the dashboard > create new dashboard > give name for the dashboard > create (2nd image)
- Now go to the dashboard
- Now inside dashboard Click on setting button > create new block > select "Number pad" block > attach the feed we created earlier > give the name of the block > create
- As shown in the 4th image the number pad is used to send data to ESP8266 for controlling 3 switches it have to use total 6 buttons of number pad
button 1 -> turn ON switch 1
button 2 -> turn ON switch 2
button 3 -> turn ON switch 3
button 4 -> turn OFF switch 1
button 5 -> turn OFF switch 2
button 6 -> turn OFF switch 3
Adafruit Configuration in Code
For AIO credential
Click on the key Icon > copy IO username and IO key and then paste it in the code (1st image)
For Feed :
Copy the feed name and paste it in the code in line number 30 under io.feed() function
IFTTT Setup and Configuration
Now create 6 applets in IFTTT for controlling the switches (Watch the video for detail understaing of applets creation and configuration with adafruit and google assistant)
Final Run
Now open google assistant in your phone and
give the command for controlling the buttons