Lab 4 SIMPLE APPLICATION BETWEEN SENSOR,INPUT,OUTPUT AND BLYNK APP

 




FACULTY OF ELECTRONIC
ENGINEERING TECHNOLOGY




LAB 4 - SIMPLE APPLICATION BETWEEN SENSOR, INPUT, OUTPUT AND BLYNK APP






MUHAMMAD DANIAL BIN ZAINAL AZLAN

192020173







UNIT 1-HOW TO SETUP BLYNK APP (MOBILE PHONE)


COMPONENT :

  1. ESP32 development board
  2. One 5mm LED
  3. One 220ohm resistor
  4. Breadboard
  5. Connecting Wire





  • First,we need go to  Google Play Store or App store for ios user and search Blynk and Install .




  • We will have to create an account to proceed further. We can also log in with your Facebook account if you possess that.

  • After that we successfully signed in the following window will appear ."click New Project".



  • Now specify the name of project ,device and connection type .After that press the 'Create ' button.


  • We will receive a notification regarding your Authorization token. This can be accessed from the email account that we signed in with and also through Project Settings.

  • Now the Blynk canvas will open as shown below:

  • Press on the screen. The widget box will appear. Now we will build our project. Firstly, we will press the ‘Button’ widget. We can view information regarding it by pressing the icon present in the far right as highlighted below.


  • Press the button widget again on the canvas to change its parameters. In the output section, choose the GPIO pin through which your LED will be connected to the ESP32 module. We have used GPIO25. We can use any other suitable output GPIO pin. Also, change the mode of the button to a ‘SWITCH’.




  • After we alter the settings of the button the canvas will look something like this:


  • At the top, we will find three icons. These are for Project settings, editing and play button.

    Inside the play button, we can also find the stop button.




  • The Project Settings show  the settings we applied for  particular project and a link to the authorization key. The edit button takes  to the widget box. Lastly, the play button lets we connect  project with microcontroller. Once we press this button we no longer will be able to add new widgets to your project unless we use the STOP button first.


SETTING UP ARDUINO IDE 



  • We will use Arduino IDE to program our ESP32 development board. Thus, we should have the latest version of Arduino IDE. Additionally, we also need to install the ESP32 plugin.

  • To use the Blynk app with our ESP32 board, we would have to install its library.Follow this link "https://github.com/blynkkk/blynk-library" and then click on the code download zip .



  • We have to go to Sketch > Include Library > Add .zip Library inside the IDE to add the library as well. After installation of the library, restart  IDE.



    • we will define the authorization key which was emailed to us through Blynk in our account through which we logged in it. Keep this key safe with you for security concerns.

    • Next, we will define the network credentials. One for the SSID and the other for the password. These will be our network credentials which will be used to connect to our wireless network. Replace both of them with your credentials to ensure a successful connection.
    • TESTING 

      • Choose the correct board and COM port before uploading your code to the board.
        Go to Tools > Board and select DOIT ESP32 DEVKIT V1 .




  • Next, go to Tools > Port and select the appropriate port through which  board is connected.Click on the upload button to upload the code to your ESP32 development board.

  • open up the serial monitor and we will be able to see the status of WIFI connection. We will receive different messages as shown below.



  • When we receive the ‘ready’ message on the serial monitor, open  Blynk application. Open the project press and  ‘play’ button.
  • Now, touch the Button widget to toggle the LED. By pressing ON/OFF, simultaneously the LED connected to GPIO25 will turn ON/OFF as well. To disrupt the connection, press the stop button.

  • Click the microcontroller icon at the top. We will receive a notification about the connection being established with your ESP32 board.


  • LED  on when we press ON on Blynk app.



LED  off when we not press button on Blynk app.












Post a Comment

0 Comments