Proteus Simulation of Bluetooth Module and Arduino | App Development on MIT App Inventor

Proteus Simulation of Bluetooth Module and Arduino | App Development on MIT App Inventor


Hello everyone and welcome back to engineering online We are back with another amazing tutorial of Proteus Series In this tutorial, I would be controlling LED with an android app To do the task, you would be needing a PC in which Proteus software is installed Arduino IDE is installed and you would be needing an internet connection to develop the application online and an android phone to test the application If you want to know how to install the Arduino IDE and Proteus software, I have uploaded a tutorial regarding the installation of both software, you can find the video links in the description box Moving on, the whole tutorial is divided into the following sections first of all, I will draw the circuit on Proteus simulator then I will write the code on Arduino ID and then I will develop the app online on MIT App inventor and last but not least I will install the app on phone and control the LED connected to the Arduino. Since this LED is 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 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 open Proteus software and click on the P tag to add components First of all, I am adding Arduino Uno here and then write Bluetooth in the search bar It shows two different Bluetooth modules HC-05 and HC-06. I am selecting the first one Now type resistor in the search bar and add a resistor And now type LED and select LED So all required components have been added. Let’s wire them now There are only two usable pins of Bluetooth module i.e. transmit and receive Connect it’s receive pin with the transmit pin of Arduino and connect its transmit pin with the receive pin of Arduino Now connect the 330-ohm resistor with the pin 13 of Arduino and then connect LED in series with it and connect its other pin with the ground terminal. 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 also So the wiring is completed now. Its time to write the code on Arduino IDE. In the compiler settings, make sure that the
correct Arduino board is selected and same Bluetooth port is also selected here so in the coding, a string has been initialized here with the name ‘text’ and this string will save the information received from the Bluetooth connection In the setup function, the mode of the pin 13 is defined as output and then initialize the serial connection Now in the loop function, if the serial data
is available read the data in the variable text and display the text on the serial monitor also If the text is on, then turn on the LED and
if the text is off then turn off the LED The program is quite simple. Now compile it and if there are any syntax errors then remove it Once the compilation is completed. Expand the output tab and search for the location of hex file Copy this location and go back to proteus
and paste it on the Arduino board Now its time to develop the android application. We would be developing this application online. Write MIT 2 APP Inventor in the google search bar and open the website Make your account on the website and start a new project If you have not worked on it before, let me
just give you a quick introduction of the website This website allows you to develop android applications without even writing a single It has two main tabs i.e. Designer and Blocks In the designer tab, you would be designing the frontend of the app In the blocks tab, you would be connecting the blocks rather than writing the code So let’s first design it and then I would
switch to the block section This is the screen of the application I am defining the basic features of this app like its alignment and its title Now I am adding an image from the user interface and setting its features like height and width Let’s add a list picker now. Change its color of your choice, its size,
its height, width and text on it Next, I am adding a horizontal arrangement block from the layout tab and change its properties Now add a button in it, change its color of
your own choice and write the text on it I am adding another button here too. Do the same changes with it also Next, I am adding a label here and designing it accordingly When Bluetooth connection is established only then this label would be visible So, I have unchecked its visibility, but it
would be displayed in the viewer Next, I am adding another image i.e. logo
of the channel Next, I am adding another button here to disconnect If needed Change its text, height, width, color etc I am hiding its visibility too It would only appear when the Bluetooth connection is established So now lets switch to the blocks tab Click on the list picker and select the before picking tab Wait I forgot to add the Bluetooth connection here that is highly needed. From the connectivity add the Bluetooth client here Now the elements of the list picker have been set to all the available Bluetooth connections and their addresses Next block is about after selecting the connection. Let’s add a ‘if-then’ condition here And if the Bluetooth connection is established and picked from the list then label 1 would become visible showing that Bluetooth is connected and the disconnect button would also become visible Next when the user clicks on the button, we have to add the condition that what would happen Add the if-then condition here too If the Bluetooth connection is established,
then a text saying on would be sent via Bluetooth and it would be displayed on serial monitor Now do the same programming for the OFF button too and when the off button is pressed the text saying Off would be sent via Bluetooth In the end, when the disconnect button is
pressed, the Bluetooth connection is disconnected and both label 1 and disconnect button would have been disappeared so the programming has been completed Its time to build the application click on the build and then app It would provide a barcode for the mobile
to scan Now go to the play store on your phone and type ‘MIT AI2 Companion’ and download this app and either type the 6 -character
code or scan QR code After scanning, it will prompt you to download the application and then install it Its time to test the application. play the simulation button on the Proteus
and select the Bluetooth of your PC And here it is We are finally able to control the LED in
the simulation software Now you can implement it with the real hardware
also and you can expand this project and control some other appliances too Must give it a try and give me your feedback in the comments section Do press the like button if the tutorial has
been beneficial for you Share it with your fellows too and don’t
forget to subscribe the channel so you don’t miss out any new upload of
the series You can also connect with us on Facebook and Instagram, links are provided in the description Thank you so much for watching I will see you next time with the new tutorial

Be the first to comment

Leave a Reply

Your email address will not be published.


*