Full width home advertisement

Post Page Advertisement [Top]

 


NDJ 30003 - ELECTRONIC INSTRUMENTATION

LAB 2 - EXPLORING THE ESP32 GPIOs


Name: ONG JUN JIE

Matrix No.: 192020315

Program: Computer Engineering

Date: 9/9/2021


OBJECTIVES

- read digital inputs like a button switch

- control a digital output, like an LED


EQUIMENTS/COMPONENTS

- ESP32 DOIT DEVKIT V1 BOARD

- Traffic Light LED Module

- 220Ω resistor

- 10kΩ resistor

- Push Button

- Breadboard

- Jumper Wires

-Aluminum foil

-Potentiometer


INTRODUCTION

    ESP32 is a feature-rich MCU with integrated Wi-Fi and Bluetooth connectivity for a wide-range of applications. ESP32 can perform as a complete standalone system or as a slave device to a host MCU, reducing communication stack overhead on the main application processor. ESP32 can interface with other systems to provide Wi-Fi and Bluetooth functionality through its SPI/SDIO or I2C/UART interfaces. The Wi-Fi speeds of ESP32 can be as high as 150 Mbps, which makes it a perfect accessory for IoT projects in wearable electronics, smartphone devices, and along with other boards such as Arduino.

    In this lab, I am going to explore the features of ESP32 and try to do some project such as digital inputs and outputs, touch sensor, touch sensitive LED, pulse-width modulation, reading analog inputs, study hall effect sensor. 


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Unit 1 - ESP32 Digital Inputs and Outputs

Exercise:

1) Read the state of a pushbutton, and light up an LED accordingly.

Coding in Arduino:


Output in circuit:

Output of Serial Monitor at Baud rate 115200:
When switch is not pressed

When switch is pressed







Unit 2 - ESP32 Touch Sensor

Exercise:
1) Reading the touch sensor
2) Touch sensitive LED


Coding in Arduino:



Output of Serial Monitor at Baud rate 115200:




Output of Serial Plotter:



Touch sensitive LED

Coding at Arduino:


Output of Serial Monitor at Baud rate 115200:


Output in circuit:




Unit 3 - ESP32 Pulse-Width Modulation (PWM)


Exercise:
1) Dimming an LED
2) Getting the Same Signal on Different GPIOs

Coding in Arduino:

Output in circuit:



Getting the Same Signal on Different GPIOs

Coding in Arduino:


Output in circuit:




Unit 4 - ESP32 Reading Analog Inputs

Exercise:
1) Reads the values from the potentiometer and prints those values in Serial Monitor

Coding in Arduino:



Output of Serial Monitor at Baud rate 115200:






Conclusion
    In the conclusion, I had learnt the features and usage of ESP32. ESP32 is a series of low-cost, low-power system on a chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. It can used to control the output of LED to turn on and off by using the pushbutton. Furthermore, it is very useful for decoration too by changing the LED brightness to make it dimmer and brighter using a value from 0 to 255. Next, ESP32 has 10 capacitive touch GPIOs. These GPIOs can sense variations in anything that holds an electrical charge, like the human skins. So they can detect variations induced when touching the GPIOs with a finger. By using the touch sensor, when I touch the jumper, it makes the LED bright while leaving the jumper alone, the LED light become dark again. In addition, ESP32 can used to reading analog inputs too, it can read values from variable resistors like potentiometers, or analog sensors. We can make observation via the Serial Plotter in the Arduino Tools.



LAB 2 END


LET'S MAKE A LITTLE BIT PROGRESS EVERY DAY AND YOU SEE 
THE POWER OF SMALL CHANGES



No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib