Voice Controlled Home Automation Using Arduino & Bluetooth Module | Android App on MIT APP Inventor


Hello everyone and welcome to engineering
online. If you want to control your home appliances
with voice signals, then this video is going to be quite helpful for you. In this video, I would be controlling an AC
lamp and a DC fan with android application through voice commands. This video is divided into the following sections: first of all, I will design the circuit in Proteus Schematic Capture and then I will
write the code on Arduino IDE. Then I will develop the android application
on MIT App Inventor website and then the application would be installed in Android phone for the final testing. If you want to see the interfacing of Arduino
with different electronics modules, its simulation on different simulators and some amazing electronics projects then you should subscribe to the Engineering Online and get benefit from various other tutorials. To do the task, you need a PC in which Arduino IDE is installed and Proteus 8 Professional is installed already. Next you need an internet connection because you would be developing the mobile application online. Last but not the least, you need a mobile
phone to test the application. If you want to know how to install Arduino
IDE and Proteus Simulator, I have explained it in detail in separate videos. Links of those videos are mentioned in the
description box, so you can check out from there. Since these appliances are Bluetooth controlled
so you need a Bluetooth module in the circuit. In proteus simulator, its library is not present
by default, so we have to download it from ‘The engineering projects’ website. download the Bluetooth module library from this website. I will add the link of this website in the
description too. Once the library is downloaded, extract the folder from the zip file. You will find these 2 files in the folder
with .IDX and .LIB extension. Copy both of them and go to the main windows
folder of your PC and open Program files(x86). Find the Labcenter electronics folder and
then Proteus 8 Professional. Open the library folder and paste these two
files here. Now moving on, first of all, lets design the
circuit on Proteus 8 Professional. Open Proteus software and click on the P tag
to add components. First of all, add Arduino Uno then write Bluetooth
in the search bar and add the HC-05 module. Now search for the relay. Then add an NPN transistor, then diode, and
then resistor. In
the end, add an AC voltage source, an AC lamp and DC motor as a model for fan. So, the required components have been added,
it’s time for wiring. Connect the transmitter pin of Arduino with
the receiver pin of HC-05 and connect the receiver pin of Arduino with the transmitter pin of HC-05. After that connect a resistor of 1K with the pin 6 of Arduino then attach a transistor with the resistor and ground its emitter pin and connect a relay at its collector pin then add a diode in parallel with the coil. Now I am adding an AC lamp whose one end would
be connected to the normally open pin of relay and other end would be connected with the
AC voltage source. now other end of AC voltage source is connected with the common pin of relay. Now do the same connections for the DC fan. I have added two appliances in the circuit. You can control as many appliances you want and for every appliance, you need a relay module. In the end, power up the relay module with
12V supply. So connections have been completed. It’s time to write the code on Arduino IDE. Before moving ahead, do one thing.Turn on the Bluetooth connection of your PC and open its setting. And check the COM port of the Bluetooth connection. Now go back to the circuit and make sure that the same port is selected in the Bluetooth module. In the coding, initialize the variable string
with the name voice. In the setup, initialize the serial communication
with the baud rate 9600. Mode of the pin number 5 and pin number 6
are set as output. In the loop function, read the data from the
serial transmission. If there is data available, the print that
text on the serial monitor. Now check the following conditions, if the
voice command is turn on light then state of pin 6 is set as HIGH. And if the voice command is ‘turn off light’
then state of pin 6 is set as low. In the same way, all other conditions are
checked. In the end, the voice variable is emptied. Compile your code and remove syntax errors
if there are any. Expand the output tab and copy the hex file location. Go back to the Proteus and paste the location on Arduino board. Now it’s time to develop the android application
online on MIT App Inventor 2 website. I will add the link of this website in the
description box, you can check out from there. If you are new on this website then first you have to sign up with your email and then start a new project. This is the screen of the mobile app. First of all, lets do some modifications with the screen like change its alignment and title etc then I am adding an image from user interface
and change its height and width accordingly. Make sure that you have already uploaded the image you want to add in the screen. Next, I am adding a list picker and doing some
necessary changes like its colour, font, alignment etc then I am adding a horizontal arrangement
block from the layout tab and then adding a button in it. now edit both of them as per your choice and
requirements. This button has an image of microphone and
it would be pressed to input the voice commands. Next, I am adding a label with it. This label would display whatever command
has been given. Then add another label down the horizontal
arrangement block and also modifying its look. This label would only be visible when the
Bluetooth connection has been established. Next, I am adding another image of the channel
logo and setting its dimensions. I am adding another button here for the disconnect option. After setting the display of the application,
I am adding Bluetooth client from connectivity tab and speech recognizer from media tab. Let’s move towards the blocks section now. So, first of all, I am adding the block for
list picker before picking. It will show Bluetooth address of all available
connections. Next block is after picking. Add an if-then condition here. So, if the Bluetooth is connected then label
2 would become visible and button 2 that is disconnect would also become visible. Next, I am adding a condition, what would
happen if the button2 is pressed, the Bluetooth would be disconnected and both label 2 and
button would become invisible. If the button 1 is pressed, the speech recognizer would ask for the voice commands and convert it into text. So before getting text, label 1 text would
be empty and after getting text, the label 1 would display the voice command in the form of text and the same text is transmitted via Bluetooth connection. So the app design and coding is completed. Now click on the build and generate QR code
for .apk. Now open your phone and install this app ‘MIT
AI2 COMPANION’ from play store Scan this code. After scanning, it will prompt you to download the application and then install it. Its time to test the application. Open this application and play the simulation button in Proteus software and enjoy the results. turn on light turn on fan turn off all turn on all Now you can implement the same circuit on your hardware also and you would be able to control your home appliances with your mobile application. Isn’t it quite amazing? I hope so the video must have been beneficial for you. Must give it a try and give me your feedback
in the comments section. If the video has been useful for you, give
it a thumbs up and share it with your fellows too You can also give your suggestions about what
kind of tutorials you want us to upload. You can also connect with us on Facebook and
Instagram, links are provided in the description box Thank you so much for watching, I will see
you next time with the new tutorial.

2 Replies to “Voice Controlled Home Automation Using Arduino & Bluetooth Module | Android App on MIT APP Inventor

Leave a Reply

Your email address will not be published. Required fields are marked *