0% found this document useful (0 votes)
31 views22 pages

Iotdoc 1

Uploaded by

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

Iotdoc 1

Uploaded by

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

IOT PROJECT REPORT

On
VOICE ASSISTANT

Submitted in partial fulfillment of requirements to


ITSL4 IOT Project

III/IV B. Tech Information Technology (VI Semester)

By
M. SAI CHARAN Y21IT069
PRANEETH SAI. S Y21IT103
P. MANIDEEP Y21IT094

APRIL 2024
Department of Information Technology
R.V.R&J.C. COLLEGEOFENGINEERING
(AUTONOMOUS )
(Approved by A.I.C.T.E ) NAAC ‘A+’ Grade
(Affiliated to Acharya Nagarjuna University)
Chandramoulipuram: Chowdavaram
GUNTUR– 522019

1
R.V.R&J.C.COLLEGEOFENGINEERING
DEPARTMENTOF

INFORMATION TECHNOLOGY

BONAFIDECERTIFICATE

This is to Certify that this Mini Project work entitled “VOICE ASSISTANT” is the bonafide work
of M. SAI CHARAN (Y21IT069), PRANEETH SAI SUDA (Y21IT103), PARIMI
MANIDEEP (Y21IT094),of III/IV B.Tech who carried the work under my supervision, and
submitted in the partial fulfillment of the requirements toITSL4–IOT PROJECT LAB
REPORT during the year 2024.

Dr. G. Swetha Dr. A. SriKrishna


(Project InCharge) Prof. &Head, IT

2
ACKNOWLEDGEMENTS

From the idea to the act, from the conception to reality, from the emotion to the response,
from the desire to the spasm, we are led by those about whom to write for all words see
m meek.

We are very much thankful to Dr. Kolla. Srinivas, Principal of R.V.R. & J.C College
of Engineering, Guntur, for allowing us to work on this project.

We express our sincere thanks to Dr. A. Srikrishna, Professor and Head,


Department of Information Technology for encouraging and supporting us to carry
out this project successfully.

We are very glad to express our special thanks to Dr. G. Swetha has inspired us to
select this project according to our choice and for her valuable advice to work on this
project.

This IOT Project wouldn’t be completed without the help of my friends, family
members and other people who are directly or indirectly connected with this work. I
also express my sincere thanks to the Technical and Non-Technical staff and all the
faculty of the department for their valuable help.

M.SAI CHARAN (Y21IT069)


PRANEETH SAI SUDA (Y21IT103)
PARIMI MANIDEEP (Y21IT094)

3
CONTENTS
Chapter No. &Name PageNo.
1. Abstract 5
2. List of Figures 6
3. Introduction 7
3.1. Purpose
3.2. Scope
3.3 Definitions, Acronyms and Abbreviations
4. Block Diagram & Explanation 8
5. Flow Chart & Explanation
6. Code Snippet
6.1. Raspberry Sketch
6.2. Circuit Diagram 9
7. Results 11
7.1 Hardware setup 11
7.2 Voice assistant configuration 12
7.3 Audio processing 12
7.4 Voice assistant features 13
8.Social Impact 15
9. Applications 16

10.FutureScope& Conclusion 18

Asdasfafsdafsdfasdfsdfasfsdfasdf
Asfasdfasdfuahsdjghafsdfdskjhfglkafdjs

4
adskjsdfkdsfasdf
asdkfshdjfhasdhf

1. Abstract

This project explores the development of a voice assistant using Raspberry


Pi, OpenAI's ChatGPT, and a speaker. The goal is to create a voice-
controlled system for various tasks, including answering questions, setting
timers, and controlling smart home devices The project involves hardware
setup, software configuration, and the integration of voice recognition
with text-to-speech technology. Challenges include ensuring accurate
speech recognition and minimizing response latency. Results show the
successful implementation of a versatile voice assistant. This system has
potential applications in home automation, virtual assistance, and
accessibility, with opportunities for future enhancements and broader use
cases..

Asdfghj
Sdfghj
Sdfghj
5
asdfghjk

2. List of Figures

Figure No. &Name PageNo.

4.1 Block Diagram 8

5.1 Flow chart 9

6.1. Raspberry Sketch 11

6.2. Circuit Diagram

7.1 Template Creation 12

7.2 Hardware setup 12

7.3 Voice assistant configuration 13

7.4 Audio processing 13

7.5. Voice assistant features 14

6
Introduction

Internet of Things (IOT) stands as a transformative force, seamlessly


interweaving the physical and digital realms to redefine how we interact with
the world. At its core, IOT is a network of interconnected devices, sensors,
and systems, each equipped with the ability to collect, exchange, and act upon
data. This vast ecosystem encompasses everything from everyday objects like
household appliances and wearables to complex industrial machinery and
smart cities. With the power to gather real-time information and communicate
autonomously, IOT not only enhances efficiency in various sectors but also
opens the door to unprecedented innovations. As we navigate the era of
connectivity, IOT emerges as a catalyst for innovation, offering boundless
possibilities to create smarter, more responsive, and interconnected
environments that have the potential to revolutionize the way we live, work,
and interact with our surroundings.

This project focuses on developing a voice assistant using Raspberry Pi and


ChatGPT, offering interactive and context-aware responses. The aim is to
create a system that can understand and process voice commands, utilizing
the Raspberry Pi's computing power and ChatGPT's language processing
capabilities. The project integrates multiple technologies to facilitate a
responsive voice assistant that can perform various tasks based on voice input .

asdfghjhgfdsa
7
3.1. Purpose:
The purpose of this project is to develop a voice assistant that utilizes a
Raspberry Pi and OpenAI's ChatGPT to create a versatile and interactive
system capable of processing voice commands. This project aims to build a
cost-effective and efficient solution for tasks like answering questions, setting
reminders, and controlling smart home devices, thereby providing users with
a more convenient and accessible way to interact with technology..

3.2. Scope:

This project develops a voice assistant system using a Raspberry Pi,


OpenAI's ChatGPT, and a speaker. The goal is to create a cost-effective
assistant capable of understanding and responding to voice commands for
tasks like setting reminders and controlling smart home devices. It's
designed for home use, focusing on user-friendliness and basic
accessibility. The scope does not include advanced AI applications,
comprehensive security analysis, or complex IoT integrations.

3.3. Definitions, Acronyms and Abbreviations:

IoT: Internet of Things


Voice and Speech
Voice and speech are key elements of human communication, enabling us
to express thoughts and emotions. Voice is generated by the vocal cords,
while speech involves the articulation of sounds through coordinated
movements of the mouth. In technology, voice and speech are harnessed to
create voice assistants and speech-to-text systems, facilitating natural
human-machine interactions. Advances in AI have improved the accuracy
of these technologies, leading to broader applications and enhanced user
experiences.

8
Raspberry

Raspberry Pi is a compact, low-cost single-board computer developed


by the Raspberry Pi Foundation to promote computer science education.
Despite its small size, it is highly versatile, with various models offering
different hardware capabilities, including USB, HDMI, Ethernet, and
GPIO (General Purpose Input/Output). It supports a range of operating
systems, with Raspberry Pi OS (formerly Raspbian) being the most
popular, providing a Linux-based environment for coding and project
development. The extensive Raspberry Pi community offers a wealth of
resources, tutorials, and project ideas, making it a popular choice for
hobbyists, educators, and professionals alike.

Bluetooth Communication
Bluetooth is one of the popular devices to communicate in short range it
is used on computers, cell phones, headphones and many other devices.
Bluetooth devices use 2.4 to 2.5 GHz frequency to communicate with
each other. Bluetooth standardized as IEEE 802.15.1 but then it
changed that Bluetooth’s range is 2400–2483.5 MHz approximately.
Bluetooth devices generally use frequency-hopping spread spectrum
communication technique to communicate with each other.

Asdfghgfd
Asdfa
asdfdsa

9
4. Block diagram and explanation

Raspberry Pi is a series of affordable single-board computers designed


for education, prototyping, and various applications. Each Raspberry Pi
model contains key components that provide its versatility: a central
processing unit (CPU) for running programs, a graphics processing unit
(GPU) for handling graphics and video, and memory (RAM) for
multitasking.

Storage is managed through a microSD card slot, allowing for flexible


storage options. Input/output ports include USB for peripherals, an
Ethernet port for wired networking, HDMI for video output, and a 3.5
mm audio jack for analog audio. Modern Raspberry Pi models also offer
built-in Wi-Fi and Bluetooth for wireless connectivity.

Fig 4.1. Block Diagram

The General-Purpose Input/Output (GPIO) pins enable


hardware-based projects, supporting protocols like I2C, SPI,
10
and UART. Raspberry Pi is typically powered via a micro-
USB or USB-C port, depending on the model. These
components together make Raspberry Pi a highly adaptable
platform for educational projects, IoT systems, robotics,
home automation, and more.

11
5. Flowchart and explanation

The flowchart represents a voice-activated program that listens for a specific


command and then responds accordingly. Here's how it works:

The program begins by initializing and then waits for a sound input from the user
through a microphone. Once the sound is captured, the program uses speech
recognition to convert it into text. The next step is to check if this text matches a
specific wake word, like "Hey Mirror." If it does, the program proceeds to capture
the user's command by reading the sound again and converting it into text using
speech recognition. If the wake word isn't detected, the program loops back to wait
for a valid input.

After obtaining the converted text, the program checks if it matches any predefined
command. If there's a match, it executes the corresponding action. If not, the
program generates a response indicating that it didn't understand the command and
converts this response into spoken audio using text-to-speech technology. This
audio output is then played through the computer's speakers, informing the user
that the command was unrecognized. Finally, the program ends, completing its
cycle of listening, processing, and responding to voice commands. If the process
is continuous, it would loop back to wait for the wake word again.

12
Fig 5.1.Flow Chart
13
6. Code Snippet

sudo apt-get install portaudio19-dev


sudo apt-get install python3-pyaudio
pip install speechrecognition
pip install pyttsx3
pip install openai
sudo apt-get install espeak
sudo apt-get install Flac

import speech_recognition as sr
import pyttsx3
import openai

#Initializing pyttsx3
listening = True
engine = pyttsx3.init()

#Set your openai api key and customizing the chatgpt role
openai.api_key = "xyz"
messages = [{"role": "system", "content": "Your name is Jarvis and give answers in 2 lines"}]

#Customizing The output voice


voices = engine.getProperty('voices')
rate = engine.getProperty('rate')
volume = engine.getProperty('volume')

def get_response(user_input):
messages.append({"role": "user", "content": user_input})
response = openai.ChatCompletion.create(
model = "gpt-3.5-turbo",
messages = messages
)
ChatGPT_reply = response["choices"][0]["message"]["content"]
messages.append({"role": "assistant", "content": ChatGPT_reply})
return ChatGPT_reply

while listening:
with sr.Microphone() as source:
recognizer = sr.Recognizer()
recognizer.adjust_for_ambient_noise(source)
recognizer.dynamic_energy_threshold = 3000

try:
print("Listening...")
audio = recognizer.listen(source, timeout=5.0)
response = recognizer.recognize_google(audio)
print(response)

if "jarvis" in response.lower():

response_from_openai = get_response(response)
14
engine.setProperty('rate', 120)
engine.setProperty('volume', volume)
engine.setProperty('voice', 'greek')
engine.say(response_from_openai)
engine.runAndWait()

else:
print("Didn't recognize 'jarvis'.")

except sr.UnknownValueError:
print("Didn't recognize anything.")

Fig 6.1. Raspberry pi Sketch

Circuit Diagram
15
Fig 6.2. Circuit Diagram

16
7.Results
Result Summary:

The implementation of a Voice Assistant using Raspberry Pi has yielded


promising results, showcasing the potential of integrating affordable hardware
with sophisticated software for creating intelligent systems. Throughout the
project, several key achievements were made, highlighting the capabilities and
versatility of the Raspberry Pi platform in the domain of voice recognition and
interaction.

Hardware Setup: The project utilized a Raspberry Pi microcontroller as the


central processing unit, along with a microphone for audio input and a speaker
for audio output. The compact and cost-effective nature of the Raspberry Pi
made it an ideal choice for building a voice assistant system.

Software Development: The software development phase involved the


integration of various technologies and libraries to enable voice recognition,
natural language processing, and task execution. The project leveraged open-
source tools such as Python, Speech Recognition, and Text-to-Speech (TTS)
engines to create a robust and responsive voice assistant.

Key Features Implemented:

1. Wake Word Detection: The voice assistant was programmed to activate


upon detection of a specific wake word, allowing users to interact with
the system hands-free.
2. Speech Recognition: The system demonstrated accurate speech
recognition capabilities, enabling users to issue voice commands in
natural language.
3. Natural Language Understanding (NLU): Through the integration of
NLU algorithms, the voice assistant could interpret user commands and
extract relevant information to perform the requested tasks.
4. Task Execution: The system was capable of executing a variety of tasks
based on user commands, including web searches, weather updates,
calendar scheduling, and more.

17
18
8. Social Impact

Voice assistants built on Raspberry Pi can have a profound social impact, reshaping
accessibility, education, health, automation, privacy, and human interaction. These
voice-driven systems offer improved accessibility for people with disabilities or
mobility challenges by enabling hands-free control of technology, and they can also
be used as educational tools, fostering personalized learning experiences for users
of all ages. In healthcare, voice assistants can assist the elderly or those with health
issues by managing medications and providing emergency assistance. They also
contribute to smart home automation, enhancing productivity and efficiency, but
raise significant privacy and security concerns due to the potential for unauthorized
data access. Additionally, voice assistants can influence social dynamics by altering
how people interact with technology and each other, potentially leading to reduced
face-to-face interactions and greater dependence on technology. However, the
affordability and open-source nature of Raspberry Pi make voice assistant
technology more accessible to a broader audience, promoting community-driven
innovation. Despite the potential benefits, careful consideration must be given to
privacy, security, and the societal implications of increased reliance on these
systems

19
9.Applications

Voice assistants built on Raspberry Pi can be used in a wide variety of applications


due to the platform's flexibility, affordability, and extensive community support.
Here are some common and innovative applications of voice assistants with
Raspberry Pi:

Smart Home Automation

Control Home Devices: Voice assistants on Raspberry Pi can control lights,


thermostats, smart plugs, and other smart home devices through voice commands,
providing a convenient and accessible method of automation.

Home Security: Voice assistants can be integrated with security systems to


arm/disarm alarms, monitor security cameras, and notify users of unusual activity.

Education and Learning


Interactive Learning: Voice assistants can provide educational content and
quizzes, helping students learn through interactive experiences. They can answer
questions, spell words, and assist with math problems.
Language Learning: Users can practice languages by interacting with voice
assistants, receiving pronunciation feedback, and completing language exercises.
Personal Assistants
Task Management: Voice assistants can help manage to-do lists, set
reminders, and schedule appointments, acting as a personal assistant to keep users
organized.
Information Retrieval: They can answer questions about weather, news,
general knowledge, and other topics, making them useful for quick information
retrieval.

20
11. FutureScope&Conclusion

Future Scope:

The future of Raspberry Pi-based voice assistants is promising, with emerging


technologies and expanding use cases offering new possibilities. As artificial
intelligence and machine learning continue to advance, these voice assistants can
become more intuitive, accurate, and capable of understanding complex
commands. Integration with the broader Internet of Things (IoT) ecosystem opens
opportunities for seamless automation in smart homes, workplaces, and industrial
settings. Furthermore, the rise of edge computing allows voice assistants to
process data locally on the Raspberry Pi, enhancing privacy and reducing latency.
This shift could lead to more responsive voice assistants that operate
independently from cloud-based services, ensuring continuous functionality even in
offline scenarios..

Conclusion:
Raspberry Pi voice assistants have made a significant impact across various
domains, from smart homes and education to healthcare and business applications.
Their flexibility and affordability, combined with the extensive Raspberry Pi
community, make them an attractive platform for voice-based projects. These voice
assistants enable hands-free interaction, improve accessibility, and facilitate
automation, contributing to increased convenience and efficiency in many areas.
However, as they become more integrated into our daily lives, challenges such as
privacy, security, and ethical considerations must be addressed to ensure responsible
use.

21
12.Bibliography.

12.1.Reference papers:

Building a Virtual Assistant for Raspberry Pi:


The practical guide for constructing a voice-controlled virtual assistant
https://link.springer.com/book/10.1007/978-1-4842-2167-9

12.2. YouTubelinks:

voice assistant with raspberry pi


https://youtu.be/vEMzN5RgXbw?feature=shared

22

You might also like