กลับไปหน้ารวมไฟล์
bluetooth-voice-controlled-appliances-with-ok-google-be2642-en.md

Bluetooth Voice Controlled Appliances with 'OK Google'

Innovations in home automation have advanced rapidly, especially voice control via popular platforms like Google Home or Amazon Echo. However, a survey of most internet projects reveals that voice control systems are often primarily based on Wi-Fi networks. While highly efficient, this approach has limitations in terms of complex setup and constant reliance on an internet gateway.

For this reason, I conceived the idea of creating a more stable and energy-efficient control system using Bluetooth. However, a significant problem with existing Bluetooth applications on the market is their "lack of true automation." Users often have to pick up their phone and press a button on the screen to activate Google Speech Recognizer every time, which contradicts the hands-free principle of smart homes.

In this project, I designed a solution that integrates the power of Google Assistant ('OK Google') with Bluetooth technology to eliminate the need for pressing buttons. This allows us to control appliances instantly using only voice commands. Although Google Home typically supports Bluetooth only for audio streaming to speakers, by developing an Android application as an intermediary, we can seamlessly send commands via Bluetooth to a microcontroller.

Watch the demonstration video and construction steps here:

Block Diagram and System Architecture

This system operates by integrating several technologies. It begins with receiving voice commands via a smartphone, then converting the data into a Serial signal for transmission to the target hardware.

Key System Components:

  1. Google Assistant: Acts as the Voice Trigger or the command initiator. When the user says "OK Google" followed by an app launch command, the system activates the Speech-to-Text module to convert spoken words into a String.
  2. Bluetooth HC-05 Module: This is a wireless communication module that uses the Bluetooth 2.0 protocol and communicates via UART (Universal Asynchronous Receiver-Transmitter). It receives the String from the application and forwards it to the Arduino via the TX/RX pins.
  3. Arduino Microcontroller: The core for processing logic. It performs a String Comparison of the received message to check for specific conditions. For example, if it receives "light on," it sends a Digital High signal to the designated pin.
  4. Relay Module: Functions as an electronic switch that isolates the low-voltage control section (5V DC) from the high-voltage power section (220V AC) for safety and to enable control of actual electrical appliances.

Circuit Diagram and Technical Connections

The circuit design in this project emphasizes simplicity yet efficiency. A critical point to note is signal voltage level connectivity.

Technical Details of the Connections:

  • HC-05 Bluetooth Module: Connect the VCC pin to 5V and GND to the Arduino's GND. For the module's TX pin, connect it to the Arduino's RX pin, and the module's RX pin to the Arduino's TX pin (a Voltage Divider should be used if using a 3.3V board for module safety).
  • Relay Module: The Input pin of the Relay is connected to an Arduino Digital Pin (e.g., Pin 8, 9, 10). When the Arduino sends a 'LOW' or 'HIGH' signal (depending on whether the Relay is Active Low or High), the electromagnetic coil within the Relay creates a magnetic field to pull the contact, completing the AC circuit.
  • Code Logic: Within the Arduino program, a String variable is declared to store values received from Serial.readString(). For example:
    if (voice == "turn on fan") {
        digitalWrite(fanPin, HIGH);
    } else if (voice == "turn off fan") {
        digitalWrite(fanPin, LOW);
    }
    
    A crucial technique is to use functions for trimming whitespace or converting to lowercase to prevent errors in processing commands from Google Assistant.

This project demonstrates that existing technologies around us can be applied to create convenience in daily life without high investment. This system not only addresses modernity but also helps individuals with physical limitations easily control their home environment through the power of voice alone.

Bluetooth Voice Controlled Appliances with 'OK Google' Copyright (C) 2018 by Suman Kumar Das
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

ข้อมูล Frontmatter ดั้งเดิม

title: "Bluetooth Voice Controlled Appliances with 'OK Google"
description: "Control home appliances with voice, using Bluetooth and Google Assistant."
author: "sumanskd"
category: "Internet of Things, BT & Wireless"
tags:
  - "bluetooth"
  - "home automation"
views: 24732
likes: 11
price: 2450
difficulty: "Intermediate"
components:
  - "1x Soldering iron (generic)"
  - "1x jumper wires for arduino"
  - "1x Hot glue gun (generic)"
  - "1x Arduino UNO"
  - "1x 4 channel Relay board"
  - "1x HC-05 Bluetooth Module"
tools: []
apps:
  - "1x pro"
downloadableFiles:
  - "https://projects.arduinocontent.cc/75db1803-5db1-4524-abf4-fb33e689099d.ino"
documentationLinks: []
passwordHash: "dc9e775972551e08b5cd725704403e55d3295149636909fd76b7e385ad0a48ce"
encryptedPayload: "U2FsdGVkX1+cI5FJWEJ2rzNzzoQkehjEETUASp5kUbHMh4OG2iRbtOPVXnTWCUjO/vX7gXCIAHCJPwOeaDpXpg=="
seoDescription: "Control home appliances using voice commands with Bluetooth and Google Assistant. Simple Arduino Smart Home automation project."
videoLinks:
  - "https://www.youtube.com/embed/g4o0dipYuiw"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/bluetooth-voice-controlled-appliances-with-ok-google-be2642_cover.jpg"
lang: "en"