0% found this document useful (0 votes)
20 views13 pages

Iot Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views13 pages

Iot Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Voice Controlled Lights using Raspberry Pi

A MINI PROJECT REPORT

By

BATCH-2

NAMES : S.LIKHITHA T.PUSHPITHA T.SUSMITHA T.JYOTIRMAYEE

ROLLNO.:322103211045 322103211046 322103211047 322103211048

Under the esteemed guidance of


Mrs. Ch Sirisha
Assistant Professor
ECE Department

Department of Information Technology


GAYATRI VIDYA PARISHAD COLLEGE OF ENGINEERING FOR WOMEN
[Approved by AICTE NEW DELHI, Affiliated to Andhra University,Vishakapatnam]
[Accredited by National Board of Accreditation (NBA) for B.Tech. CSE, ECE & IT – Valid from
2019-22 and 2022-25]

[Accredited by National Assesment and Accreditation Council(NAAC)– Valid from 2022-27]

Kommadi , Madhurawada, Visakhapatnam–530048

2025–2026
Abstract
This project demonstrates a voice-controlled LED system using a Raspberry Pi and Bluetooth
communication. Voice commands given through an Android smartphone are converted to text
using the AMR Voice app and sent to the Raspberry Pi via the HC-06 Bluetooth module. The
Raspberry Pi processes these commands and controls three LEDs accordingly.

The system provides a hands-free way to interact with devices, making it user-friendly and
accessible. It can be easily extended to control AC appliances using relays, forming the basis for
a simple and affordable voice-controlled home automation system.

The LEDs are connected to GPIO pins on the Raspberry Pi and respond to specific commands
such as "red light on" or "all lights off." The HC-06 Bluetooth module receives data wirelessly
from the phone and communicates with the Pi over serial communication. This project highlights
the potential of voice recognition technology in IoT applications. It is low-cost, easy to build,
and scalable for more complex tasks. It is particularly useful for elderly or disabled individuals
who may benefit from voice-operated controls. The setup involves minimal hardware and
leverages open-source tools, making it ideal for beginners.
Voice Controlled Lights using Raspberry Pi
Aim: To design and implement a voice-controlled system using a Raspberry Pi and Bluetooth
module to control multiple LED lights, thereby showcasing the potential for voice-based home
automation.

Components Required:

 Raspberry Pi 3
 Bluetooth Module HC-06
 Bread board
 100 ohm Resistors (3)
 LED’s (blue, red, green)
 Connecting wire
 Power Supply
 Ethernet cable
 Android Phone

Theory: Bluetooth communication enables short-range wireless data exchange. The HC-06
Bluetooth module is a slave device that receives commands from a master device (smartphone)..
The Raspberry Pi processes the command string and triggers the appropriate GPIO pins to
control the LEDs. AMR Voice app, along with Google Voice Services, converts spoken
commands to text and transmits them over Bluetooth.

Raspberry Pi and GPIO : The Raspberry Pi is a compact, versatile single-board computer


featuring General Purpose Input/Output (GPIO) pins. These pins allow the Raspberry Pi to
interface with external electronic devices such as sensors, displays, and actuators. Each GPIO pin
can be programmed as an input or output, making the Raspberry Pi a powerful platform for
embedded system applications and IoT projects.

Bluetooth module :Bluetooth module (HC-06) is used to establish a wireless connection


between the Android smartphone and the Raspberry Pi. It receives voice command data
(converted to text) from the mobile app via Bluetooth. The module operates in slave mode,
waiting for the phone to connect and transmit instructions. Its default baud rate of 9600 makes it
easy to integrate without additional setup. The HC-06 eliminates the need for physical wires,
offering convenient and flexible control. It plays a key role in enabling real-time, wireless
communication for voice-controlled automation.

Working principle:

1. Three LEDs (Red, Blue, Green) are connected to Raspberry Pi GPIO pins.
2. The user gives voice commands using the AMR Voice App on an Android phone.
3. The app uses Google Voice to convert speech into text format.
4. This text is sent via Bluetooth to the HC-06 module.
5. The HC-06 sends the command to the Raspberry Pi through UART (serial
communication).
6. A Python script on the Raspberry Pi reads the command and checks it against predefined
commands.
7. LED Control Logic:

 "blue light on" → Turns ON blue LED


 "blue light off" → Turns OFF blue LED
 "red light on" → Turns ON red LED
 "red light off" → Turns OFF red LED
 "green light on" → Turns ON green LED
 "green light off" → Turns OFF green LED
 "all lights on" → Turns ON all LEDs
 "all lights off" → Turns OFF all LEDs
 "blink" → All LEDs blink repeatedly with 100ms delay

8.This setup allows wireless, voice-based control of LEDs and can be extended for smart
home automation.

Circuit Explanation :
Circuit of this project is very simple, which contains Raspberry Pi 3 Board, LEDs and
Bluetooth Module (HC-06). Raspberry Pi reads the Bluetooth Module and control the LEDs
accordingly. LEDs Blue, Red and Green are connected at GPIO 17, 27 and 22. Rx and Tx of
Bluetooth Module are directly connected to Tx and Rx pins of Raspberry Pi. Remaining
connections are shown in circuit diagram.

Procedure:

1. Hardware Setup:

 Connect the HC-06 Bluetooth module to the Raspberry Pi (Tx → Rx and Rx →


Tx, Vcc to 5V, GND to GND).
 Connect LEDs with 100Ω resistors to GPIO 17, 27, and 22.
 Power the Raspberry Pi and ensure it's running Raspbian OS.

2. Software Setup:

o Update and upgrade the Raspberry Pi OS using:


 bash
 CopyEdit
 sudo apt-get update
 sudo apt-get upgrade

o Install required Python libraries:

 bash
 CopyEdit
 sudo apt-get install python-dev
 sudo apt-get install python-rpi.gpio

3. Bluetooth Configuration:

 Disable serial login and inbuilt Bluetooth.


 Modify /boot/config.txt and /boot/cmdline.txt as per instructions.

4. Run the Python Code:

 Use the provided Python script to control GPIO based on received Bluetooth
commands.

5. Mobile App Setup:

 Install AMR Voice and Google Voice apps from Play Store.
 Connect to HC-06 via AMR Voice and test voice commands.
Raspberry Pi Configuration and Python Program:
We are using Python language here for the Program. Before coding,
user needs to configure Raspberry Pi.

sudo apt-get update

sudo apt-get upgrade

After it we need to install Raspberry Pi GPIO development tool, it


can be installed by following commands:

sudo apt-get install python-dev

sudo apt-get install python-rpi.gpio

Then user needs to configure serial port of Raspberry Pi. Here we


have used Raspberry Pi 3 for this project. So user needs to configure
serial port according to their Raspberry Pi version. For Raspberry Pi 3,
first user needs to disable console login via serial port, through RPi
Software Configuration Tool. Open it by using below command:
sudo raspi-config

Then go to ‘Advance Options’, select ‘Serial’ and ‘Disable’ it.

After this we need to disable inbuilt Bluetooth of Raspberry Pi


3 by adding dtoverlay=pi3-miniuart-bt at the end of
/boot/config.txt file:
sudo nano /boot/config.txt

After adding the line reboot Raspberry Pi by issuing sudo


reboot command.Finally login in Raspberry Pi again and configure
/boot/comline.txt file:

sudo nano /boot/comline.txt

And edit the file as below:dwc_otg.lpm_enable=0 console=tty1


console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4
elevator=deadline fsck.repair=yes rootwait
So here we have completed building our Voice Controlled Devices
using Raspberry Pi.

Python program:

import serial

import RPi.GPIO as GPIO

import os, time

led1=17

led2=27

led3=22

GPIO.setwarnings(False)

GPIO.setmode(GPIO.BCM)

GPIO.setup(led1, GPIO.OUT)

GPIO.setup(led2, GPIO.OUT)

GPIO.setup(led3, GPIO.OUT)

GPIO.output(led1 , 0)
GPIO.output(led2 , 0)

GPIO.output(led3 , 0)

Serial = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=2)

data1=""

data=''

while 1:

while data != '#':

data = Serial.read(1)

data1+=data

print data1

if data1.find("blue light on")>0:

GPIO.output(led1 , 1)

print "Blue Light on"

if data1.find("blue light off")>0:

GPIO.output(led1 , 0)

print "Blue Light Off"

if data1.find("red light on")>0:

GPIO.output(led2 , 1)

print "Red Light on"

if data1.find("red light off")>0:

GPIO.output(led2 , 0)

print "red Light Off"


if data1.find("green light on")>0:

GPIO.output(led3 , 1)

print "Green Light on"

if data1.find("green light off")>0:

GPIO.output(led3 , 0)

print "Green Light Off"

if data1.find("all lights on")>0:

GPIO.output(led1 , 1)

GPIO.output(led2 , 1)

GPIO.output(led3 , 1)

print "All Lights on"

if data1.find("all lights off")>0:

GPIO.output(led1 , 0)

GPIO.output(led2 , 0)

GPIO.output(led3 , 0)

print "All Light Off"

if data1.find("blink")>0:

for k in range (100):

GPIO.output(led1 , 1)

GPIO.output(led2 , 1)

GPIO.output(led3 , 1)

time.sleep(0.1)
GPIO.output(led1 , 0)

GPIO.output(led2 , 0)

GPIO.output(led3 , 0)

time.sleep(0.1)

Serial.flush();

data="";

data1="";

Observations:(Output photos)

Voice Command Expected Output Observed


Output
"blue light on" Blue LED turns ON ✅
"red light off" Red LED turns OFF ✅
"all lights on" All LEDs turn ON ✅
All LEDs blink at 100ms
"blink" ✅
delay

Analysis:

 The project reliably converts voice input to control signals via Bluetooth.
 The use of AMR Voice and Google Voice Services provides a simple yet effective way
to integrate voice recognition.
 There’s a minimal delay (~1-2 seconds) between voice command and execution, mostly
due to processing and Bluetooth transmission.
 Can be scaled for home appliances by replacing LEDs with relay modules.

Precautions:

1. Ensure the correct voltage level for the Bluetooth module (HC-06 operates on 5V).
2. Cross-check GPIO pin connections before powering the Raspberry Pi.
3. Use appropriate resistors with LEDs to prevent damage.
4. Test voice commands in a quiet environment to improve recognition accuracy.
5. Avoid physical interference or obstructions between the phone and the Bluetooth module.

You might also like