Thursday, November 21, 2024

Voice-Controlled Home Automation System

This is a project for a voice controlled home automation system to control appliances with your voice through an Android app. An Arduino Mega board is used for controlling the relay through which an appliance is switched on/off. You can modify the Android app to add more functions.

Contents

First, download Bluetalk app and install it on your Android phone. Screenshot of Bluetalk app is shown in Fig. 1. Block diagram of the voice-controlled home automation system is shown in Fig. 2.

Fig. 1: Screenshot of Bluetalk app
Block diagram for voice controlled home automation system
Fig. 2: Block diagram of the voice-controlled home automation system

Circuit and working of the voice controlled home automation system

Circuit diagram of the voice-controlled home automation system is shown in Fig. 3. The circuit consists of Arduino Mega 2560 board (Board1) for comparing the input string received through Bluetooth with the stored string to give output to digital pin 6 of Board1 to control the relay.

- Advertisement -
voice controlled home automation circuit diagram
Fig. 3: Circuit diagram of the voice-controlled home automation system

Bluetooth module HC-05 transmits and also receives data serially via Board1 that can be read by the microcontroller (MCU). A relay is used here to control only one appliance, though you can use a multichannel relay board to control multiple appliances. Mega 2560 has 54 digital pins, each of which can be used to control an appliance. The MCU can be programmed to compare the relative strings (speech).

Software

There are two software programs used in this project. One is Arduino sketch (Bluetalk.ino) for the MCU and the other is Android app (Bluetalk.apk).

- Advertisement -

Arduino IDE is used for programming the MCU. For developing Android app, MIT App Inventor is used, as it is easier to use as compared to Android SDK. MIT App Inventor is good for hobby projects and DIY enthusiasts to create small apps for their project-specific use.

Bluetalk.apk app uses Google’s speech-recognition function and transmits the text to the MCU via the connected Bluetooth (HC-05). The .apk code can be read by importing Bluetalk.aia file in MIT App Inventor.

Both .apk and .aia files can be downloaded from the source folder present at the end of the article.

Install Arduino IDE (v1.6.9) in your PC and connect Arduino board (here, Arduino Mega is used but we can use any other Arduino board) to the PC with the help of a serial cable. Choose correct serial COM port of the board and then upload the sketch to the MCU. Disconnect the serial cable from Arduino board and connect to the relay and Bluetooth module HC-05.

Again connect Arduino board to the PC via a serial cable. An LED (not shown here) on Bluetooth module will start blinking rapidly, which means it is not connected. Once HC-05 module is connected via the smartphone, the LED will blink just twice after some delay.

Now, say something on the smartphone and check data on the serial monitor of Arduino IDE. After confirming that you are receiving data from HC-05 module, you are good to go. Make sure you select the appropriate baud rate (9600 here). Next, disconnect the serial cable and connect the relay to the appliance as shown in the circuit diagram.

Construction and testing

A single-side PCB pattern of the voice-controlled home automation circuit is shown in Fig. 4 and its component layout in Fig. 5.

PCB Layout for voice controlled home automation
Fig. 4: PCB pattern of the home automation system
Fig. 5: Component layout of the PCB

Assemble the circuit on the PCB to minimise time and assembly errors. CON1 is used to connect HC-05 module, CON2 and CON3 are 2-pin connectors used to connect 230V AC mains and load (bulb), respectively. CON4 is used to connect Arduino board (Board1).

Power on Arduino board using a 9V DC battery (or any USB 5V DC power supply) to enjoy wireless control of your home appliances via speech. Upload Bluetalk.ino sketch into Arduino board and install Bluetalk.apk on your Android phone.

  • Pair your Android’s Bluetooth to HC-05 module.
  • It will prompt you to enter a password.
  • Default password is 1234.
  • Open the app and connect to HC-05 again.
  • Your voice controlled home automation system is ready to work.

Touch ‘Speak’ icon on the app, say ‘Turn On’ in front of your smartphone to turn the appliance on and ‘Turn Off’ to turn it off. Author’s prototype is shown in Fig. 6.

A voice controlled home automation system
Fig. 6: Author’s prototype for voice controlled home automation system

Download PCB and component layout PDFs: click here

Download source folder


Madhav Shyam Lakhera is a Space science enthusiast interested in DIY projects, engineering and research.

This article was first published on 1st October 2016 and was updated on 22 May 2019.

41 COMMENTS

  1. Is the code that was posted is sufficient to run the project?? or Do we need anything more? If so.,please post the complete code of this project. Hoping that we will get the reply soon 🙂 !!

  2. hey actually i cant understand the software part of this article regarding the mit app inventor and bluetooth part.So could you just elaborate it a bit more,actually in my project the only thing i cant do is the voice sending from the android mobile to the bluetooth module.The module gets connected to the smartphone but wgat to do after that????

SHARE YOUR THOUGHTS & COMMENTS

EFY Prime

Unique DIY Projects

Electronics News

Truly Innovative Electronics

Latest DIY Videos

Electronics Components

Electronics Jobs

Calculators For Electronics