LAB 3 : Simple Application for Sensors, Input, Output, and Blynk App

LAB 3 Wireless control and Light sensor

Objective :
- To learn how to connect a ESP32 microcontroller to the local network
Able to use Blynk app to view and control ESP32 status on phone
-Troubleshoot connection of ESP32 to the network by using a correct token key


Equipment and components :

• ESP32 DOIT DEVKIT V1 Board

• 3x 5mm LED

• 10k Ohm resistor

• Light Dependent Resistor (LDR)

• Breadboard

• Jumper wires

• Potentiometer

• Android Device with Blynk app installed



Introduction : 
    ESP32 is a series of low-cost, low-power system on a chip microcontroller with integrated Wi-Fi and dual-mode Bluetooth. In this lab, I am going to learn how to connect the microcontroller Arduino ESP32 to the local 2.4Ghz wireless network and configurate the authenticate token to build a link from android device to the chip. Other than that, in this lab I am going to create a light intensity and temperature graph on the Blynk app that allow user to observe the changes on the breadboard without actual view of the circuit. Finally for the task today, I am going to create a smart LED light controller with the light dependent resistors (LDR) in real time environment.

Figure1: circuit connection



1) How to setup Blynk app (mobile phone)

First install Blynk app on the mobile device or virtual simulator:
















Then Login and create a new project using ESP32 and Wi-Fi

















Customize the interface you wanted using the “+” button on the top right


Then copy the authenticate token under the project setting to the Arduino Sketch

































Make sure the Blynk library is added into the Arduino coding software




















Then paste the auth token it into Arduino under auth[]. Next, set the ssid[] same as your Wi-Fi name(2.4Ghz) and pass[] as your Wi-Fi password.

























Task of the day:











Solution: declare three variable for red yellow and green LED state





Output:




The graph of Lux can be monitor through the mobile Blynk app



The virtual button that can control the LEDs states


The potentiometer can be adjusted and observed on the mobile Blynk app




Serial Monitor:

-Where PB state is for push button state




Conclusion :

    As a conclusion, ESP32 is a very smart and convenience microcontroller that can be easily programmed using software. ESP32 features wireless and Bluetooth control connection that make it even more advantage to use. To allow the ESP32 connect to the mobile device, we need a application called Blynk to make wireless control connection. The plugin Blynk file should be added into the Arduino coding software to let it recognize the Blynk code. After that, the authenticate code is important and must be insert correctly into the Arduino coding to make it work 

     In this laboratory, I learned how to use a light dependent resistor (LDR) to read the real-life light intensity and calculate into lux value. The normal lux value is around 30-50 and we can display the value of lux using serial print to view more clearly the value. By using If Else statements, it is possible to create an auto light detector to turn on or off when the surrounding become brighter or darker. 

      In the task today, I declare three variables for three different LEDs: Red, Yellow, and Green to allow virtual button to control these components. The project is originally display one color of LEDs at a time when meet different lux intensity. After using the variable, I managed to set the LED to light up manually using the Blynk app on mobile device. Besides, there is a graph that display the Lux intensity and temperature inside the control panel Blynk.



-End of Lab 3-


Comments

Popular posts from this blog

LAB 2 : Exploring the ESP32 GPIOs

LAB 3

LAB 1