Introduction: Gate Control With Google Assistent Using ESP8266 NodeMCU
This is my first project on instructables so please comment below if there are possible improvements.
The idea is to use the google assistant to send a signal to the control board of a gate. So by sending a command there will be a relay that closes a contact on the input of the gate controller which sends a gate open signal to the controller.
To connect google assistant with IOT-devices we use the Blynk and IFTTT service.
In this project we will use NodeMCU ESP8266 module because of the small size.
Step 1: Hardware and Software
What you need:
1) NodeMCU (ESP8266) f.e. aliexpress
2) 5 or 12V relay with trigger current preferably <9mA of max 12mA: f.e. Aliexpress
3) Power supply 5 or 12V depending on relay (>700mA to be safe) f.e. aliexpress
Use the links to install, the board
1) Arduino IDE link
2) Blynk Library link
3) ESP8266 Board manager (next step)
Step 2: Nodemcu Board Install
1) Open Arduino IDE
2) Go to files -> preference
3) At Additional boards Manager add:
and then press OK to close the tab.
4) Go to Tools -> Board -> Boards Manager (at the top)
5) Navigate to esp8266 by esp8266 and install the software.
Step 3: Setup Blynk
1) Open de Blynk app and create an account.
2) Create new project (+ icon)
3) Choose device 'ESP8266' and create
4) In an E-mail you will receive your personal authorized token.
5) In the project you can add widgets using + icon, add button as shown in picture
Step 4: IFTTT Setup
1) Login or create an account on IFTTT.com or the app.
2) Create new applet: extra explanation
-At 'this' search for google assistant and select trigger say a simple phrase
-add something like Open the gate or choose your own
-At 'that' search for webhooks -> make web request and add like the picture.
For the IP you need to add the IP-address of Blynk server (open CMD on PC/laptop en type "ping blynk-cloud" and it should return the IP-address of your local Blynk server)
For auth code you need to add your personal authentic code from the email you received from Blynk.
Step 5: Connections
Vin of module to your 5V or 12V power supply (the input is max 20V
Vcc of relay to power supply 5 of 12V
GND relay to power supply 0V / GND
GND of module to power supply 0V / GND
D1 to input Relay (CH1 or something)
I've added an optional feedback on pin D8 like you can also see in my program but this is optional so you can do with that what you want.
Step 6: Upload Program to Module
Download my code
Open it using Arduino IDE
Change WiFi SSID and password to match your WiFi
Change Auth code to match the one from your email
Connect via USB and upload
Participated in the
Arduino Contest 2019