Yarana Iot Guru
Published © MIT

Smart Home Automation with Google Assistant & Alexa

Control your home appliances with your voice using Google Assistant & Alexa — a complete smart home project by YaranaIoT Guru

BeginnerFull instructions provided8 hours52
Smart Home Automation with Google Assistant & Alexa

Things used in this project

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

💻 Step-by-Step Setup

C/C++
1️⃣ Setup in Arduino IDE

Install ESP32 board support using this link in Preferences:
Then install board → select ESP32 Dev Module.
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

3️⃣ Upload the Code

C/C++
2️⃣ Connect to IoT Platform

You can use:

Blynk Cloud (for app & Google Assistant integration)

or Sinric Pro / IFTTT (for Alexa control)

Each platform provides an API key / Auth Token that you’ll use in your code.

3️⃣ Upload the Code

Here’s an example for Blynk + Google Assistant (via IFTTT):
#include <WiFi.h>
#include <BlynkSimpleEsp32.h>

char auth[] = "YourBlynkAuthToken";
char ssid[] = "YourWiFiSSID";
char pass[] = "YourWiFiPassword";

BLYNK_WRITE(V1) { digitalWrite(23, param.asInt()); }
BLYNK_WRITE(V2) { digitalWrite(22, param.asInt()); }
BLYNK_WRITE(V3) { digitalWrite(21, param.asInt()); }
BLYNK_WRITE(V4) { digitalWrite(19, param.asInt()); }

void setup() {
  pinMode(23, OUTPUT);
  pinMode(22, OUTPUT);
  pinMode(21, OUTPUT);
  pinMode(19, OUTPUT);
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
}

void loop() {
  Blynk.run();
}

4️⃣ Integrate Google Assistant

C/C++
Open IFTTT app → create new applet

Choose “Google Assistant” as trigger → e.g., “Turn on light”

Choose “Webhooks” as action → send a request to your Blynk API URL

Example URL:
https://blynk.cloud/external/api/update?token=YourAuthToken&V1=1

Credits

Yarana Iot Guru
36 projects • 5 followers
Yarana Iot Guru Yarana IoT Guru: Arduino, ESP32, GSM, NodeMCU & more. Projects, Tutorials & App Development. Innovate with us!
Thanks to YaranaIoT Guru.

Comments