Close
0%
0%

Voice-Controlled Home Light: ESP32 Switch Bot

Revolutionizing Switches with ESP32 and Servo Motor!

Similar projects worth following
432 views
0 followers

In this exciting project, we'll dive into the fascinating realm of voice-controlled home lighting. By combining the power of ESP32, a versatile microcontroller, and a trusty servo motor,  we'll transform ordinary light switches into intelligent, voice-activated devices. 
Imagine effortlessly turning your lights on or off with just a voice command, creating an environment that responds to your every word. So, let's embark on this adventure and unlock the potential of smart home technology!

The ESP32: Unleashing the Power of Connectivity:
At the heart of our project lies the ESP32, a powerful microcontroller known for its wireless capabilities and versatility. With built-in Wi-Fi and Bluetooth, the ESP32 enables seamless communication between our voice-controlled system and the surrounding devices. Its processing power and ample memory provide the foundation for creating a responsive and intelligent lighting control system.

Servo Motor: Transforming Switches into Automated Wonders:
To translate voice commands into physical action, we employ a trusty servo motor. 
The servo motor, with its precise control and rotational capabilities, serves as the bridge between the voice-controlled system and the physical light switch. It acts as a mechanical finger, mimicking our actions to turn the switch on or off based on our voice commands.

Building the Voice-Controlled System:
To bring our voice-controlled lighting system to life, we need to build a circuit that connects the ESP32, servo motor, and the existing home light switch. We'll delve into the circuit design, wiring connections, and ensure the integration is seamless. Additionally, we'll explore the necessary programming steps to enable voice recognition and motor control, leveraging the ESP32's vast ecosystem of libraries and tools.

Bluetooth Voice Control App: Empowering Interaction:
Our project wouldn't be complete without a user-friendly interface to control the lights. 
We'll introduce a Bluetooth voice control app that pairs with the ESP32, allowing us to send voice commands wirelessly. We'll dive into the app's features, interface, and demonstrate how to set up the communication between the app and our ESP32-based system.

From Manual to Voice-Activated: Witnessing the Magic:
Once everything is set up, it's time to experience the magic of voice-controlled lighting firsthand. We'll showcase the system's ability to understand voice commands, execute them flawlessly using the servo motor, and witness the lights responding accordingly. 
This seamless integration of cutting-edge technology and human interaction truly brings the future into our homes.

Check the project instructions to build this project by yourself effortlessly.

  • 1 × ESP32
  • 1 × Servo Motor
  • 2 × Connector wires
  • 1 × One Mobile charger to power the ESP32

  • 1
    Circuit Connection

    The only circuit connection we need is connection between ESP32 and servo motor :

    ESP32 ------------ Servo motor
    VIN ----------------- VCC (Red pin)
    GND ---------------- GND (Brown pin)
    D12 ----------------- PWM pin (Orange pin)

  • 2
    The Voice Control App

    Following is the app I used to send the voice commands from our smartphone to ESP32 via Bluetooth :
    https://play.google.com/store/apps/details?id=com.locominder.bluetoothvoicecontrol


    This voice control app is very quick to get started and It has some example codes for both Arduino and ESP32. Next, let us see the project code.

  • 3
    Project Code

    I used Arduino IDE to program ESP32. We need the ESP32Servo library needs to install in Arduino IDE to control the servo motor using ESP32. Check the attached image for the ESP32Servo library. After installing the library upload the following code to the ESP32 and the project will work like a charm. Check the project in action in the above video

    #include "BluetoothSerial.h"
    #include <ESP32Servo.h>
    #if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
    #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
    #endif
    #if !defined(CONFIG_BT_SPP_ENABLED)
    #error Serial Bluetooth not available or not enabled. It is only available for the ESP32 chip.
    #endif
    BluetoothSerial SerialBT;
    Servo light_servo;
    const int light_servo_pin = 12;
    void setup()
    {
    Serial.begin(115200);
    SerialBT.begin("ESP32Circuit"); //BLUETOOTH DEVICE NAME
    light_servo.attach(light_servo_pin);
    light_servo.write(133);
    }
    void loop() {
    if (SerialBT.available()) {
    String value = SerialBT.readStringUntil('\n');
    value.toLowerCase();
    Serial.println(value);
    if(value == "light on")
    {
    light_servo.write(70);
    }
    if(value == "light off")
    {
    light_servo.write(133);
    }
    }
    }

View all 4 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates