In this ESP32 project, I have explained how to make an IoT project using ESP RainMaker with Google Assistant & Alexa. With this internet of things project, you can control 8 home appliances with Google Assistant, Alexa, and manual switches. You can also control the relays from Google Home and Amazon Alexa App from anywhere in the world.
And you don’t need any Google Nest or Amazon Echo Dot devices for this voice control home automation project.
With this home automation project, you can control & monitor the real-time feedback of the relays in the Google Home, Amazon Alexa, and ESP RainMaker app from anywhere in the world. If the Wi-Fi is available, the ESP32 will automatically connect with the Wi-Fi.
For this project, I have used all the FREE tools. So if you follow all steps, you can easily make this Smart Home System with Google Assistant and Alexa to control the appliances with voice commands.
Table of Contents
Required Components for the ESP32 project
ESP32 DevKIT V1 Amazon
4-channel or 8-channel 5V SPDT Relay Module Amazon
Manual Switches or Pushbuttons Amazon
Amazon Echo Dot (optional) Amazon
Google Nest Mini (optional)
Circuits of the IoT Project with ESP RainMaker
Circuit for ESP32 control 8 Relays
For the 8-channel relay module, I have used D23, D22, D21, D19, D18, D5, D25 & D26 GPIO to control the 8 relays.
And the GPIO D13, D12, D14, D27, D33, D32, D15 & D4 are connected with switches to control the relay module manually.
I have used the D2 (GPIO-2) pin as the Wi-Fi indicator. (D2 pin connected with the blue LED, mounted on ESP32 board).
If you want to use the pushbuttons instead of latched switches, then just connect the pushbuttons instead of the latched switches across GPIO pins and GND.
Circuit for ESP32 control 4 Relays
For this circuit, I have used D23, D22, D21 & D19 GPIO to control the 4-channel relay module.
And the GPIO D13, D12, D14 & D27 are connected with switches to control the relay module manually.
The board LED connected with the D2 pin will act as the WiFi indicator.
If you want to use pushbuttons for manual control, then just connect pushbuttons instead of switches across the GPIO pins and GND.
I have used the INPUT_PULLUP function in Arduino IDE instead of using the pull-up resistors with each push button.
As per the source code, when the control pins of the relay module receive a LOW signal the relay will turn on and the relay will turn off for the HIGH signal in the control pin.
I have used a 5V 5Amp mobile charger to supply the circuit.
Tutorial video on ESP RainMaker Home Automation
In the tutorial video, I have covered the following steps in detail.
- Control 8 relays with Google Assistant, Alexa, and switches.
- Programming the ESP32 for RainMaker with Arduino IDE
- Add devices in the ESP RainMaker app.
- Connect ESP RainMaker with Amazon Alexa App.
- Connect ESP RainMaker with Google Home App.
Program ESP32 with Arduino IDE
In the Tutorial video, I explained all the steps to program the ESP32 using Arduino IDE.
- Update the Preferences –> Additional boards Manager URLs: http://arduino.esp8266.com/stable/package_esp8266com_index.json,https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Then install the ESP32 board (Version: 2.0.3) from the Board manager or Click Here to download the ESP32 board.
- Download the required libraries from the following links:
- AceButton Library.
Source Code for ESP32 IoT Project
Source Code for ESP32 control 8 Relays
Source Code for ESP32 control 4 Relays
In the code, if you want you can change the device names. Google and Alexa will identify the devices with these names.
// define the Device Names
char deviceName_1[] = "Switch1";
char deviceName_2[] = "Switch2";
char deviceName_3[] = "Switch3";
char deviceName_4[] = "Switch4";
char deviceName_5[] = "Switch5";
char deviceName_6[] = "Switch6";
char deviceName_7[] = "Switch7";
char deviceName_8[] = "Switch8";
After uploading the code to ESP32, please refer to the following article to add the devices with the ESP RainMaker app.
QR code for this IoT Project
Now, please refer to the following articles to connect the ESP RainMaker with Amazon Alexa and Google Home App.
After doing all these steps, now you control the appliances with Google Assistant and Alexa.
PCB for this ESP32 Home Automation system
To make the circuit compact, I have designed a PCB for this ESP32 IoT project.
If you want, you can also use this PCB to make the circuit compact and give the project a professional look. This PCB can be used for any ESP32 Home Automation project.
About PCBWay and their services
You can order any custom design PCBs from PCBWay at very reasonable prices.
PCBWay not only produces FR-4 and Aluminum boards but also advanced PCBs like Rogers, HDI, Flexible and Rigid-Flex boards, at very affordable prices.
For the online instant quote page please visit – pcbway.com/orderonline
You can also explore different PCB projects from their Open-source community pcbway.com/project/.
For more details please visit the following articles.
Why PCBway
PCB Capabilities
High-Quality PCB
Steps to order PCB from PCBWay
To order the PCB first visit PCBWay.com.
Then enter the following details:
- PCB Size (Length & Width) in mm & PCB quantity
- Select masking color for the PCB
- Select country and shipping method
- Click on the “Save to Cart” button
Now click on the “Add Gerber Files” to upload the PCB Gerber file.
Then click on the “Submit Order Now” to place the order.
After that, they will review the Gerber file and accordingly confirm the order.
I have used their services for my different home automation projects, I always received the PCB on time and the quality is very good in this price range.
Control Relay with ESP RainMaker App
If the ESP32 is connected to Wi-Fi, you can control the relays and monitor the real-time feedback from anywhere in the world on the ESP RainMaker App.
ESP32 control Relays with Google Home & Alexa App
If the ESP32 is connected to Wi-Fi, then you can ask Alexa or Google Assistant, to turn on the switch [“Alexa, Turn ON Room Light“] or [“Hey Google, Turn ON Switch 1″]. Thus, you can control the appliances like lights, fan etc with voice commands, and also monitor the real-time feedback of the switches from anywhere in the world on the Google Home and Amazon Alexa App.
ESP32 control Relays with Manual Switch
You can always control the appliances manually with switches or push buttons. If the ESP32 is connected to Wi-Fi, you can monitor the real-time feedback.
I hope you like this Smart house IoT project idea with the Espressif ESP32.
Click Here for more such ESP32 projects.
Please do share your feedback on this IoT project. Thank you for your time.