Final Year Project Report
Final Year Project Report
i
ACKNOWLEDGEMENT
We express our special thanks of gratitude to Dr. Arpita Adhikari of the Department of
Electronics & Communication Engineering (ECE) for her able guidance and valuable
support in completing our project.
Heartfelt thanks are also conveyed to all the members of the teaching and non- teaching
staff of the Department of ECE for their cordial support and help, whenever needed.
Date: 24/05/2024
………………
(Sayan Sarkar)
………………
(Kashyap Ghosh)
………………
(Anshuman Das)
………………
(Md Injamamul
Haque Ansari)
ii
CERTIFICATE (8th Semester)
This is to certify that Sayan Sarkar, Kashyap Ghosh, Anshuman Das & Md
Injamamul Haque Ansari have carried out their project work entitled “Voice Assistant
System with Home Automation facility” as a part of the curriculum for the B.Tech
Degree in Electronics & Communication Engineering (ECE) under Maulana Abul
Kalam Azad University of Technology for the year 2020-2024.
This project report is approved by the undersigned only for the purpose for which it is
submitted. The candidate is entirely responsible for the statements, opinions and
conclusions contained herein.
iii
CONTENTS:
iv
1. LIST OF FIGURES
2. LIST OF TABLES
v
3. ABSTRACT:
The project investigates the dynamic landscape of voice assistant technology, exploring its
evolution, capabilities, and potential impact on user interactions. The project focuses on the
development and implementation of a Voice Assistant System (VAS) designed to enhance
user experiences across various domains. The project explores the integration of voice
assistant technology into the realm of home automation, aiming to enhance user
convenience and efficiency in managing various household tasks.
The primary objectives of this project encompass the design and implementation of a robust
and context-aware voice assistant capable of understanding natural language commands,
providing relevant information, and executing tasks with precision. Also, the project
understands diverse user instructions related to home automation, and to seamlessly
integrate this interface with a robust home automation system.
Furthermore, the project discusses the potential applications of voice assistant technology in
diverse fields, including personal assistance, information retrieval, and hands-free device
control. It evaluates the impact of voice assistants on user efficiency, accessibility, and the
overall user experience in both consumer and enterprise environments. Ultimately, this
project seeks to foster a deeper understanding of voice assistant technology and its
transformative role in shaping the way users interact with digital systems, paving the way
for more intuitive and seamless human-machine communication.
1
4. INTRODUCTION:
In today’s era almost all tasks are digitalized. We have Smartphone in hands, and it is nothing
less than having world at your fingertips. These days we aren’t even using fingers. We just
speak of the task, and it is done. There exist systems that can perform specialized task such as
booking a flight, or finding cheapest book online from various ecommerce sites and then
providing an interface to book an order are helping automate search, discovery, and online
order operations. In an era dominated by technological advancements, the fusion of artificial
intelligence and smart home automation has given birth to a cutting-edge project – the Voice
Assistant System with Home Automation. This innovative solution seamlessly integrates voice
recognition technology with the capability to control and manage various aspects of a home's
automation [1].
Voice Assistants are programs that help you ease your day-to-day tasks, such as showing
weather report, creating reminders, making shopping lists etc. They can take commands via
text (online chat bots) or by voice. Voice based intelligent assistants need an invoking word or
wake word to activate the listener, followed by the command. We have so many virtual
assistants, such as Apple’s Siri, Amazon’s Alexa and Microsoft’s Cortana.[2] Virtual assistants
are turning out to be smarter than ever. Allow your intelligent assistant to make email work for
you. Detect intent, pick out important information, automate processes, and deliver
personalized responses.
Voice searches have dominated over text search. Web searches conducted via mobile devices
have only just overtaken those carried out using a computer and the analysts are already
predicting that 50% of searches will be via voice by 2020[3]. This project was started on the
premise that there is enough openly available data and information on the web that can be
utilized to build a virtual assistant that has access to making intelligent decisions for routine
user activities like home automation system.
The system is designed to understand and respond to natural language commands, providing an
intuitive and hands-free way for users to interact with their smart home devices. Users can
control lighting, thermostats, security systems, and more, simply by speaking commands.
This project extends beyond basic voice recognition, incorporates a system of voice reminder
with SMS notification on user’s smartphone. It facilitates setting of reminder messages through
voice commands thus eliminating the need for typing and manually setting reminder time. The
SMS notification helps the user in case he/she is not near the voice assistant during reminder.
2
5. LITERATURE REVIEW
3
Technology Companies work on Voice Assistant and Home Automation
In the past 60 years, the technology of voice assistants has developed rapidly. From the
combination of three robust acoustic models at the beginning, the accuracy rate of voice
assistants has reached the level of human stenographers, reaching 95% accuracy. Users
often use the speech-to-text feature, which allows people on the go to send messages and take
shorthand [7].
Amazon launched smart speakers, which connect apps on smart phones with furniture in daily
life, opening up a broader space for voice interaction and occupying a larger market. The
reason for the success of Amazon speaker is the fact that it can truly interact with dialogue,
which is the most requested feature of today's social users. Amazon holds the largest share of
the facetious voice market. In 2014, it developed Alexa, a voice recognition system, which
leads all smart voice assistant companies to become the market leader. Amazon has combined
the company's appliances with a voice assistant to make a feature-rich product[8].
Siri is mainly applied in Apple's built-in, which is conducive to Apple's promotion to users
with the help of Apple's series of products. This kind of intelligent voice assistant is more
suitable for users who buy Apple’s companion device. Microsoft's Cortana is more associated
with the PC [9].
Cortana lets users experience when their phone and computer work together. For people who
use the voice assistant for office work, Cortana will help them have a better experience at work
than Siri, which is more used in daily life [10].
Google, as the world’s largest search engine, has a strong technical hand in Google
assistant. Google Assistant is a virtual assistant software application designed by Google,
primarily for mobile and home automation devices. Based on artificial intelligence, Google
assistant can hold two-way conversations, unlike Google Now, the company’s previous virtual
assistant. Google assistant has the most powerful technical advantage over the previous two
voice assistants, making it easier to search for information. Google assistant will analyze the
user's preferences built on the user's search frequency and provide users with more
valuable information[11].
Home Automation Devices: The key focus of the project is on how voice assistants
seamlessly integrate with a wide array of smart home devices. This integration is pivotal as it
allows users to control and automate various aspects of their homes. The Internet can be
described as the communication network that connects individuals to information while The
Internet of Things (IOT) is an interconnected system of distinctively address able physical
items with various degrees of processing, sensing, and actuation capabilities that share the
capability to interoperate and communicate through the Internet as their joint platform [12].
Thus, the main objective of the Internet of Things is to make it possible for objects to be
connected with other objects, individuals, at any time or anywhere using any network, path or
service.
4
The concept of development of a smart home system is not an isolated case it has existed since
the term "smart house" was first coined by the American Association of House builders in
1984. Implementation of these systems will not just increase the comfort level of modern
generation but also help elderly and physically disabled people [13]. All researchers are trying
to put some handheld device (e.g. mobile or some battery operated device) in hand on people to
increase level. In the real world (outside of research labs and the homes of the rich and
famous), home automation most commonly connects simple binary devices. This includes "on
and off" devices such as lights, power outlets and electronic locks, but also devices such as
security sensors which have only two states, open and close.
II. Data Analytics: Modern virtual assistant systems can perform complex tasks and
communicate with people using natural language processing, machine learning, speech
recognition, and data analytics thanks to recent technological advancements. Virtual
assistants can now comprehend user queries, analyze them, and provide pertinent
information in real-time thanks to these cutting-edge technologies.[15]
III. Deep learning: Deep learning has enabled voice assistants to recognize speech with an
accuracy of over 95%. This makes voice assistants much more reliable than they were
in the past.
IV. Cloud computing: Cloud computing has made it possible to deploy voice assistants that
can handle millions of requests per second. This has made voice assistants more
scalable and accessible to users around the world.
V. Big data: Voice assistants are trained on massive datasets of speech and text data. This
data allows voice assistants to learn the patterns and nuances of human language, which
makes them more accurate and reliable.[16]
VI. Android Ecosystem: Android developers have provided with large number of IOT
supporting apps which makes implementation of home automation easier [17].
5
6. METHODOLOGY
6.1 PROBLEM DEFINITION
6
6.2 FUNCTIONAL BLOCK DIAGRAM
In this section we will dive into the details of the functional blocks of the project. The Project
requires an efficient integration of hardware and software; we have carefully analyzed their
compatibility and have made sure they come under the budget.
Python has become the go-to language for many machine learning and artificial intelligence
projects. Many popular machine learning libraries, such as TensorFlow and PyTorch, have
Python interfaces, making it convenient for developers to implement machine learning models
for tasks like speech recognition and natural language understanding [18].
1. Natural Language Processing (NLP) libraries: There are several NLP libraries available
for Python such as Speech Recognition, Natural Language Toolkit (NLTK), spaCy, and
Stanford CoreNLP. These libraries help with tasks such as sentiment analysis, named
entity recognition, and part-of-speech tagging.
2. Text to Speech (TTS) engines: Popular TTS engines include Google Text-to-Speech,
Amazon Polly, and Microsoft Speech Services. These engines can be used to generate
human-like speech output from text input [19].
Functional Requirements:
i. Wake word detection: The system detects a wake word such as "Hey, candy" to activate
the assistant.
ii. Voice recognition: The system accurately recognizes and interprets voice commands
from the user.
iii. Natural language processing: The system understands the user’s intent and responds
accordingly.
8
6.3.2 EMBEDDED C PROGRAM
6.3.3 MICROPHONE
USB Plug Microphone offers compatibility with any plug-and-play enabled Raspberry Pi
Model B+, 2 model B, Raspberry Pi 3 as wells as it is also compatible with PC and Mac, Ideal
for the recording of sound. Advanced digital USB provides superior clarity with the simplicity
of a single USB plug [22].
6.3.4 SPEAKER
Standard and compact speaker with 3.5mm aux cable that can connect to audio output of
Raspberry Pi.
9
REASONS TO CHOOSE RASPBERRY PI
3. It can run multiple operating systems, including Raspbian, Ubuntu, and others, and
supports various programming languages like Python, C++ etc.
5. Raspberry Pi is compact and portable, with a credit-card size form design. It makes
carrying around and integrating into various projects and applications accessible.
10
6.3.6 UBIDOTS CLOUD PLATFORM
Ubidots is an IoT Platform empowering innovators and industries to prototype and scale IoT
projects to production. We can use the Ubidots platform to send data to the cloud from any
Internet-enabled device. Ubidots offers a REST API that allows you to read and write data to
the resources available: data sources, variables, values, events and insights. The API supports
both HTTP and HTTPS and an API Key is required.
Our data will be protected with two more replication, encrypted storage and optional TLS/SSL
data support. We can also customize permission groups to each module of the platform,
making sure the right information is shown to the right user.
11
REASONS TO CHOOSE ESP32
2. Wireless Connectivity: It has built-in Wi-Fi and Bluetooth capabilities, including BLE
(Bluetooth Low Energy), which makes it ideal for wireless communication and control
in IoT devices [24].
3. Low Power Consumption: The ESP32 is designed with energy efficiency in mind,
featuring various power-saving modes that make it suitable for battery-operated
devices.
4. Development Support: There is robust support for the ESP32 from the developer
community, including extensive documentation, libraries, and development tools.
Platforms like Arduino provide comprehensive support, making development easier and
faster.
6. High Performance: With clock speeds up to 240 MHz and up to 520 KB of SRAM, the
ESP32 can handle demanding tasks, including real-time operations and multimedia
processing.
12
6.4 DESIGN ISSUES
Designing a voice assistant project with home automation involves addressing various
technical and user experience challenges. Here are some key design issues to consider:
Challenge: Certain times the workflow of the system requires parallel processing for faster
output.
Solution: Use of threading and OS level computing with more powerful microprocessors like
ARM etc.
Context Awareness:
Challenge: Maintaining context over multiple interactions and understanding user intents
within a conversation.
Solution: Implement context-aware algorithms that remember previous user inputs and
maintain the context of the conversation. This can involve the use of context management
systems.
Challenge: Ensuring compatibility with a wide range of home automation devices in a limited
space.
Solution: Use of PCB to minimize wiring and component space and use of IOT clouds that are
compatible with maximum IOT components.
Response Time:
Challenge: Providing quick and responsive interactions to enhance user experience and
performance.
Solution: Use of more powerful microprocessors for processing purpose and implement
caching and parallel processing where possible to speed up response times.
13
7. IMPLEMENTATION
We used Raspberry pi 4 (4 GB ram) as the computer to write and process our code and produce
the desired results. Raspberry pi is powered with a 5v power adapter. The speaker is connected
to its output audio jack and a USB microphone is connected to one of its USB ports. Users give
voice input using the microphone and the desired voice results are given out through speaker.
Raspberry Pi is a microcontroller that's compact, powerful, and affordable. It's also easy to
replace and only needs a keyboard and display to run. It occupies a very space. These qualities
make it a good tool and a suitable device for project tasks that needs smaller spaces and greater
processing.
14
Fig. 6: Voice Assistant Device Fig. 7: Voice Assistant Inner Connections
15
We used Python Programming Language was used to write the entire code for voice assistant.
VSCODE- a code IDE from Microsoft was used as a platform to write the python code. Driver
program is the main program of our assistant which runs as soon as the device is switched on.
It contains the main functionalities - detecting and recognizing voice, translating voice into
text, searching, and bringing information from the internet, translating text to audio, and
controlling led signals. The driver code also controls the other programs of the assistant and
invokes them as and when required. Speech recognition module of python along with
“recognize_google” library is used to recognize and convert speech into text. Python “Beautiful
Soup” library is used to filter out data from websites and “Wikipedia” library is used to bring
data specifically from Wikipedia. Finally, “Pico text-to-speech" library is used to convert text
to audio.
Training intent and response program is written to make our voice assistant more interactive.
Machine Learning model - “Support vector Classifier” is used to train a model that would
understand the context of the questions asked and generate response accordingly. During
operation, user’s interaction is feed into the trained model which then generates responses by
understanding the context of the questions.
Reminder Program is written to add voice reminder system to the assistant. User’s message and
time of reminder is converted into text and time format respectively and stored in database.
SQLLITE database is used to store message description and time of reminder.
16
The program compares the local system time with the times stored in database. In case of a
match, the message corresponding to the matched time is fetched. Standard SQL queries are
used to store and fetch data to and from the database. A SMS is also sent to the user during
the time of reminder.
SMS Program is added to notify the user using a message, during the time of reminder. An
API key is used to connect the program to the “SMS CHEF” platform and send all the devices
and message details. Message is then sent to user’s mobile from the SMS CHEF.
UBIDOTS: - We created an account on the Ubidots platform and set up necessary data sources
and variables. Obtain the API keys or credentials required for communication between ESP32
and Ubidots.
Power Module: - The power module is connected to the ESP-32 for powering it with 3.5 volts
supply.
Relay Module: - We connected the Relay Module to ESP-32 through port INT-1 and INT-2.
Based on the received data or commands, control the relay module to turn on/off devices or
appliances connected to it. We have used relay module with power rating – 2500W.
By using all of this we have made a smart socket, which facilitates home appliances through
voice commands for enhanced convenience and comfort.
17
Fig. 10: Home Automation Circuit Diagram
Fig. 11: Home Automation Device Fig. 12: Home Automation Inner Circuit
18
8. RESULT ANALYSIS
Test Case 1
Test Type Response generation
Test Name Response Evaluation
Test Description This test evaluates how well the voice assistant system provides
different responses to similar user queries
Expected Output Voice assistant will provide diverse, contextually relevant responses
tailored to user queries, enhancing engagement and overall user
satisfaction.
Example 1 “What do you mean by physics ?”
Actual Output Physics is the branch of science that deals with the structure of
matter and how the fundamental constituents of the universe
interact. It studies objects ranging from the very small using
quantum mechanics to the entire universe using general relativity.
19
Table 2: Test Case 2
Test Case 2
Test Type Response generation
Test Name Verifying time
Test Description This test evaluates the voice assistant's ability to correctly respond
to queries related to time, such as asking for the current time of
particular country or city
Test Case 3
Test Type Response generation
Test Name Verifying Weather
Test Description This test assesses the voice assistant's capability to accurately
respond to weather-related queries, including providing current
weather conditions, forecasts for specific locations, and responses to
weather-related inquiries.
20
Table 4: Test Case 4
Test Case 4
Test Type Response generation
Test Name Search in Wikipedia
Test Description This test evaluates the voice assistant's ability to effectively search
and retrieve information from Wikipedia in response to user
queries.
Expected Output The voice assistant should accurately retrieve relevant information
from Wikipedia based on user queries, providing concise and
informative responses that address the user's information needs.
Result PASS
Comment Working properly.
21
Table 5: Test Case 5
Test Case 5
Test Type Home Automation
Test Name Turn on the Sockets of smart plug
Test Description This functional test assesses the voice assistant's proficiency
in home automation by verifying its capability to activate
socket 1 or socket 2 upon receiving the command.
Expected Output Upon the command "Turn on socket 1," or “Turn on socket 2”
or “Turn on both socket” the voice assistant should execute
the home automation task by sending a signal to activate
socket 1 or socket 2 or both sockets, thereby powering the
connected device.
Example "Turn on socket 1," or “Turn on socket 2” or “Turn on both
socket”
Actual Output “Turning on the socket 1” or “Turning on the socket 2” or
“Turning on both socket”.
[voice assistant system will send the signal to Ubidots cloud
to activate the corresponding socket or device. ]
Result PASS
Comment Working properly.
Test Case 6
Test Type Home Automation
Test Name Turn off the Sockets of smart plug
Test Description This functional test assesses the voice assistant's proficiency
in home automation by verifying its capability to deactivate
socket 1 or socket 2 upon receiving the command.
Expected Output Upon the command "Turn off socket 1," or “Turn off socket
2” or “Turn off both socket” the voice assistant should
execute the home automation task by sending a signal to
deactivate socket 1 or socket 2 or both sockets.
Example "Turn off socket 1," or “Turn off socket 2” or “Turn off both
socket”
Actual Output “Turning off the socket 1” or “Turning off the socket 2” or
“Turning off both socket”.
[voice assistant system will send the signal to Ubidots cloud
to deactivate the corresponding socket or device. ]
Result PASS
Comment Working properly.
22
Table 7: Test Case 7
Test Case 7
Test Type Functionality Test
Test Name Reminder Functionality Validation [Setting a reminder]
Test Description This test evaluates the reminder functionality of the voice assistant
system by assessing its ability to successfully set a reminder as per
user instructions.
Expected Output Upon receiving the command to set a reminder, the voice assistant
should confirm the reminder details with the user and acknowledge
successful scheduling of the reminder, ensuring accurate recording
and timely notification at the specified time.
Actual Output Upon the user's request to add a reminder, the voice assistant
prompts for a description. Once the user provides the description
"To drink water" , the system prompts for the time. After the user
specifies "10:30 PM" , the voice assistant confirms the successful
storage of the reminder.
Result PASS
Comment Working properly.
23
Table 8: Test Case 8
Test Case 8
Test Type Functionality Test
Test Name Reminder Functionality Validation [Getting a reminder]
Test Description This test validates the reminder functionality of the voice assistant
system by ensuring that reminders are delivered audibly through
voice output without relying on visual displays ensuring timely and
accurate delivery of SMS.
Expected Output At the scheduled time, the voice assistant should audibly announce
the reminder description to the user without requiring any visual
interaction. Simultaneously, an SMS notification containing the
reminder details should be sent to the user's registered mobile phone
number.
Example User sets a reminder named “to drink water” at 10:30 PM.
Actual Output At 10:30 PM, the voice assistant audibly announces: "Reminder: To
drink water."
Additionally, an SMS notification containing the reminder details
"Reminder: To drink water" is sent to the user's registered mobile
phone number.
Result PASS
Comment Working properly.
24
Table 9: Test Case 9
Test Case 9
Test Type Functionality Test
Test Name Reminder Functionality Validation [Delete a reminder]
Test Description This test validates the voice assistant's ability to delete a reminder
based on the specified time provided by the user.
Expected Output Upon receiving the command to delete a reminder, the voice
assistant should confirm the deletion and remove the reminder
from the system.
Actual Output The user requests to delete a reminder. The voice assistant prompts
for the time of the reminder to be deleted. Upon receiving the
specified time "10:30 PM" from the user, the voice assistant
confirms the successful deletion of the reminder named “to drink
water” set a 10:30 PM.
Result PASS
Comment Working properly.
25
Table 10: Test Case 10
Test Case 10
Test Type Functionality Test
Test Name System Reboot Functionality Test
Test Description This test evaluates the voice assistant's ability to execute a system
reboot command upon user request.
Expected Output Upon receiving the command to reboot the system, the voice
assistant should confirm the action and initiate the reboot process.
Test Case 11
Test Type Functionality Test
Test Name System Shutdown Functionality Test
Test Description This test evaluates the voice assistant's ability to execute a
complete system shutdown command upon user request.
Expected Output Upon receiving the command to Shut down the system, the voice
assistant should confirm the action and initiate the process.
Result PASS
Comment Working properly.
26
9. DISCUSSION
Voice assistants have become an integral part of modern technology, seamlessly integrating
into various aspects of daily life. Our project focuses on developing a versatile voice assistant
that not only answers questions but also sets reminders, sends SMS, and interfaces with a home
automation system. This multi-functional approach aims to enhance user convenience and
control, offering a holistic solution for managing daily tasks and home environments through
simple voice commands.
Key Features
1. Answering Questions
One of the primary functions of our voice assistant is to provide accurate and timely responses
to user queries. By leveraging advanced natural language processing (NLP) and access to vast
information databases, the assistant can answer a wide range of questions. This feature is
designed to be as comprehensive as possible, covering topics from general knowledge and
weather updates to specific user inquiries.
2. Setting Reminders
The reminder functionality of the voice assistant is crucial for managing personal schedules.
Users can set reminders for various tasks, appointments, and events using voice commands.
The assistant then ensures that these reminders are delivered at the appropriate times, helping
users stay organized and on top of their responsibilities.
3. Sending SMS
Incorporating the ability to send SMS messages enhances the assistant's communication
capabilities. Users get their reminders through SMS messages incase they are not near the
voice assistant.
27
Challenges and Solutions
3. Integration Complexity
Integrating with various home automation systems and communication networks can be
complex. Standardizing protocols and developing adaptable interfaces can streamline this
process, allowing for easier expansion and compatibility with a wider range of devices and
services.
Future Enhancements
Looking ahead, there are several potential enhancements for our voice assistant. These include
expanding language support, incorporating advanced AI features like predictive analytics, and
enhancing the personalization of responses based on user behavior and preferences.
Additionally, exploring integration with more third-party applications and services can further
broaden the assistant's utility and appeal.
28
10. RESOURCE UTILIZATION
29
11. CONCLUSION AND FUTURE SCOPE
Our project represents a fundamental yet valuable contribution to the realm of voice
assistant technology. While it may not boast advanced features found in high-end systems,
its simplicity and accessibility make it an ideal solution for individuals seeking basic
voice-controlled functionalities. By utilizing affordable hardware such as the Raspberry Pi
and implementing straightforward Python programming, we've created a user-friendly
voice assistant capable of performing essential tasks like setting reminders and providing
information sourced from the web. Moving forward, there is ample opportunity to enhance
our project's capabilities through gradual improvements and additions. By maintaining a
focus on usability and simplicity, we can ensure that our voice assistant remains accessible
to a wide range of users while gradually incorporating more advanced features as needed.
The future scope of the voice assistant project encompasses several avenues for
advancement. Firstly, voice recognition can be integrated for heightened security,
leveraging voice biometrics for user authentication, and ensuring secure access to sensitive
information. Natural Language Understanding (NLU) capabilities can be enhanced
through machine learning techniques which allows for more accurate interpretation of user
queries and personalized responses. Multi-language support and real-time translation
capabilities can be used to facilitate seamless communication across diverse language
barriers. Facial recognition and emotion recognition technologies can be introduced, which
enhances user identification and interaction, adapting responses based on facial
expressions.
30
12. REFERENCES
[1] Jain, S. R., & Jason, P. F. (2023). Personal Desktop Voice Assistant - Research.
International Journal of Advanced Research in Computer and Communication
Engineering , 1-10.
[2] Reddy, K. V., Lahari, S., Naveen, A., & Chandra, G. S. (2020). PERSONAL VOICE
ASSISTANT. journal of Emerging Technologies and Innovative Research , 1-6.
[4] Subhash, S., Srivatsa, P. N., Siddesh, S., Ullas, A., & Santhosh, B. (2020, July).
Artificial intelligence-based voice assistant. In 2020 Fourth world conference on
smart trends in systems, security and sustainability (WorldS4) (pp. 593-596). IEEE.
[5] Nasirian, F., Ahmadian, M., & Lee, O. K. D. (2017). AI-based voice assistant
systems: Evaluating from the interaction and trust perspectives.
[6] Sahu, A., Jha, A., Bhargava, R., Priya, P., & Kumari, R. (2022). Voice Assistant
Using Artificial Intelligence. SSRN , 1-4.
[7] Huang, Y. (2023). Research on the Development of Voice Assistants in the Era of
Artificial Intelligence. ResearchGate , 1-3.
[12] Rahman, A & Hussein, H. (2019). Internet of Things (IOT) : Research Challenges
andFuture Applications.(IJACSA) International Journal of Advanced Computer
Science and Applications. , 2-6.
31
[13] Bhardwaj, P., Manchanda, P., Chahal, P., Chaudhary, P., & Singh, R. (2020). A
REVIEW PAPER ON SMART HOME AUTOMATION. International Journal of
Scientific Research and Management Studies (IJSRMS) , 279-283.
[14] Carolus, A., Augustin, Y., Markus, A., & Wienrich, C. (2022). Digital
interactionliteracy model – Conceptualizing competencies for literate interactions with
voice- based AI systems. ELSEVIER , 1-3.
[15] Fahad, M., Akbar, A., Fathima, S., & Bari, D. M. (2023). Windows Based AI-Voice
Assistant System using GTTS. Mathematical Statistician and Engineering
Applications , 1572 - 1580.
[16] Kumar, S., Tiwari, P., & Zymbler, M. (2019). Internet of Things is a revolutionary
approach for future technology enhancement: a review. Journal of Big Data , 2-10.
[17] Kumari, J., & Neelam, P. (2021). IoT Based Smart Home Automation System.
JETIR,1-5.
[18] Manojkumar, M. P., Patil, A., Shinde, S., Patra, S., & Patil, S. (2023). AI-Based
Virtual Assistant Using Python: A Systematic Review. International Journal for
Research in Applied Science & Engineering Technology (IJRASET) , 2-6.
[20] Pavitra, D. R., Ganesha, M., Pavithran, P., & Rajamurugan, G. (2023). A Review on
Intelligent Voice Assistant with Multilingual Support using Artificial Intelligence.
Journal of Emerging Technologies and Innovative Research , 1-6.
[21] Yadlapally, D. K., Vasireddy, B., Marimganti, M., Karthikeyan, C.,chowdary, T., &
T.Vignesh. (2023). A Review on the Potential of AI Voice Assistants for Personalized
and Adaptive Learning in Education. ICCMC , 1-6.
32
13. CODE SNIPPETS
We have provided the driver program of voice assistant and embedded c program of home
automation. Please visit our GitHub repository for the entire programs of our project.
Link: https://github.com/KashyapGhosh02/voice-assistant-system-candy.git
GPIO.output(green_led_pin, GPIO.LOW)
GPIO.output(yellow_led_pin, GPIO.LOW)
33
GPIO.output(red_led_pin, GPIO.HIGH)
#------------------------------
#import custom-made modules
import voice_greetings
import reminder_property
from wolframalpha_rename import wolframalpha_result
import ubidots_separatecode
#import prediction_func
#------------------------------
34
print(f"Could not request results from Google Speech Recognition
service; {e}")
except Exception as e:
print(f"An error occurred: {e}")
return "none" # End of takeCommand() function
def wishMe(query):
#list_int_resp=prediction_func.predict_intent_with_nltk(text=query)
list_int_resp=voice_greetings.predict_intent(text=query)
return list_int_resp
def google_search(search_text):
result = ''
search_data = search_text
if "who is" in search_data or "who are" in search_data:
search_data = search_data.split(" ")[2:]
search_data = " ".join(search_data)
try:
result = wikipedia.summary(search_data, sentences=2)
return result
except Exception as e:
pass
else:
url = "https://www.google.co.in/search?q=" + search_data
try:
search_result = requests.get(url).text
soup = BeautifulSoup(search_result, 'html.parser')
result_div = soup.find_all('div', class_='BNeawe s3v9rd AP7Wnd')
result = result_div[0].text
return result
except Exception as e:
pass
return("sorry could not find any information")
ask_response = [
"Is there anything else on your mind?",
"Do you need assistance with anything else?",
35
"Would you like to discuss anything further?",
"Are there any other topics you'd like to explore?",
"Feel free to ask me anything else.",
"Is there something specific you'd like to know more about?",
]
random_response = random.choice(ask_response)
def start():
try:
while True:
curr_time = datetime.datetime.now().strftime("%H:%M:00")
print(curr_time)
reminder_property.GetReminder(curr_time)
query = takeCommand()
#if query is None:
# continue # Continue listening if no query is obtained
if "candy" in query.lower():
list_intent_response = wishMe(query)
say(list_intent_response[1])
while True:
query = takeCommand()
list_intent_response = wishMe(query)
if list_intent_response[0] == "goodbye" or
list_intent_response[0]=="gratitude" :
say(list_intent_response[1])
break
elif "no" in query or query.lower() =="none" and
list_intent_response[0]=="nothing" :
say(list_intent_response[1])
break
else:
get_result(query, list_intent_response)
say(random_response)
except Exception as e:
GPIO.cleanup()
print(e)
def get_result(query,list_intent_response):
elif "time now" in query or "time in " in query or "time at " in query
or "date in "in query or "today's date " in query or "weather in " in
query or "weather at " in query or "temperature in " in query or
"temperature at " in query: # for time date and weather related info
x = datetime.datetime.now()
if "date" in query: #Only local Date
say("Date is "+x.strftime("%A ")+x.strftime("%d
")+x.strftime("%B ")+x.strftime("%Y ")) # Date
if "time" in query: #time can be searched for local and
international zones
url = "https://google.com/search?q=" + query
request_result = requests.get( url )
soup = bs4.BeautifulSoup( request_result.text , "html.parser" )
time = soup.find( "div" , class_='BNeawe' ).text
say("time is "+time )
37
data = str1.split('\n')
sky = data[1]
say("Temperature is "+ temp)
say("Sky Description: "+ sky)
if __name__ == "__main__":
try:
print("starting the code ")
GPIO.output(green_led_pin, GPIO.LOW)
GPIO.output(red_led_pin, GPIO.LOW)
start()
except Exception as e:
GPIO.cleanup()
print(e)
39
Home Automation Program
#include <WiFi.h>
#include <PubSubClient.h>
/**************
* Define Constants
**************/
#define TOKEN "BBUS-hLmxzEtc7efjDFE0AxufTAJVXyISXb" // Your Ubidots TOKEN
#define WIFINAME "DEMON" // Your SSID
#define WIFIPASS "a1b2c34d5e" // Your Wifi Pass
#define MQTT_CLIENT_NAME "RandomName"
WiFiClient ubidots;
PubSubClient client(ubidots);
//code to extrct r1 or r2
String str = String(topic);
int startIndex = str.indexOf("/r");
int endIndex = str.indexOf("/", startIndex + 1);
String value = str.substring(startIndex + 1, endIndex);// r1 or r2
//------------------------------------
Serial.print("Message arrived [");
Serial.print(topic);
40
Serial.print("] ");
for (int i = 0; i < length; i++) {
Serial.print((char)payload[i]);
}
Serial.println();
//---------------------------------------
if(value=="r1")
{
if (message == "1.0")
{
digitalWrite(RELAY_PIN1, LOW);
Serial.println("turned on");
}
else
{
digitalWrite(RELAY_PIN1, HIGH);
Serial.println("turned off");
}
}
if(value=="r2")
{
if (message == "1.0")
{
digitalWrite(RELAY_PIN2, LOW);
Serial.println("turned on");
}
else
{
digitalWrite(RELAY_PIN2, HIGH);
Serial.println("turned off");
}
}
}
void reconnect()
{
// Loop until we are connected
while (!client.connected())
{
Serial.println("Attempting MQTT connection ...");
if (client.connect(MQTT_CLIENT_NAME, TOKEN, ""))
41
{
Serial.println("Connected");
client.subscribe(topicSubscribe1);
client.subscribe(topicSubscribe2);
}
else
{
Serial.print("Failed, rc=");
Serial.print(client.state());
Serial.println(" try again in 2 seconds");
delay(2000);
}
}
}
void setup()
{
Serial.begin(115200);
WiFi.begin(WIFINAME, WIFIPASS);
pinMode(RELAY_PIN1, OUTPUT);
pinMode(RELAY_PIN2,OUTPUT);
Serial.print("Wait for WiFi ...");
while (WiFi.status() != WL_CONNECTED)
{
Serial.print(".");
delay(500);
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address:");
Serial.println(WiFi.localIP());
client.setServer(mqttBroker, 1883);
client.setCallback(callback);
sprintf(topicSubscribe1, "/v1.6/devices/%s/%s/lv", DEVICE_LABEL,
VARIABLE_LABEL1);
client.subscribe(topicSubscribe1);
sprintf(topicSubscribe2, "/v1.6/devices/%s/%s/lv", DEVICE_LABEL,
VARIABLE_LABEL2);
client.subscribe(topicSubscribe2);
}
void loop()
42
{
if (!client.connected())
{
client.subscribe(topicSubscribe1);
client.subscribe(topicSubscribe2);
reconnect();
}
client.loop();
delay(1000);
}
43