LAB 1 : Getting Started with ESP 32
NAME: NUR FARIENA SYAFRINIE BINTI SAMSUL
NO.MATRIC: 192020269
COURSE: DIPLOMA COMPUTER
ENGINEERING (R2404)
In this Module 1 you will be learning:
- UNIT 1
- Introducing ESP32
- ESP Pinout
- Programming Environments
- UNIT 2
- Installing ESP32 in Arduino IDE
- Testing the Installation
- Deleting the Espressif folder
- Troubleshooting Tip
- Failed to connect to ESP32: Time out... Connecting...
- COM Port not found or not available
UNIT 1
Introducing ESP32
The ESP32 which is the
ESP8266 successor is loaded with a lot of new features such as combines Wi-Fi and
Bluetooth wireless capabilities. In this project, we will be using the ESP32 DEVKIT
V1 DOIT board.
ESP32 comes with the
ESP-WROOM-32 chip. It has a 3.3V voltage regulator that drops the input voltage
to power the ESP32 chip. CP2102 chip on the board allows ESP32 to program it
without the need for an FTDI programmer.
ESP32 comes with two
buttons which is Enable button and the Boot button. It had the following functionality:
1) If you press the EN
button, it reboots ESP32.
2) If you hold down the BOOT
button and then press the EN button, the ESP32 reboots in programming mode.
The table below shows the
Specifications of the ESP32 DEVKIT V1 DOIT
Specifications – ESP32 DEVKIT V1 DOIT |
|
Number
of cores |
Dual-core |
Wi-Fi |
2.4GHz
up to 150 Mbits/s |
Bluetooth |
BLE
(Bluetooth Low Energy) and legacy Bluetooth |
Architecture |
32bits |
Clock
frequency |
Up
to 240MHz |
RAM |
512KB |
Pins |
30 |
Peripherals |
Capacitive
touch, ADCs (analog-to-digital converter), DACs (digital-to-analog
converter), Inter-Integrated Circuit, UART (Universal asynchronous
receiver/transmitter), CAN 2.0 (Controller Area Network), SPI, Integrated
Inter-IC sound, RMII, PWM, and more |
ESP Pinout
Programming Environments
ESP32 can be programmed
in different programming environments such as Arduino IDE, Espressif IDF,
Micropython, JavaScript, LUA, and more. However, in this project, we will mainly
focus on Arduino IDE to program the ESP32 to work.
UNIT 2
Installing ESP32 in
Arduino IDE
Before starting the
installation procedure, ensure that you already download the latest version of
Arduino IDE on your computer.
To install the ESP32
board in Arduino IDE, follow these steps:
1) Open Arduino>
File> Preferences
2) Enter https://dl.espressif.com/dl/package_esp32_index.json
into
“Additional Board Manager URLs”. Then click the OK button.
*if you already have the ESP8266 board URL, you can separate the URLs with a comma.
3) Now, go to Tools>
Board> Boards Manager
4) Search for ESP32 and
press the install button. In this case, I have installed the ESP32.
Testing the Installation
1) Now, plug the ESP32 board
into your computer.
2) In Arduino IDE, go to
Tools> Board menu and find “DOIT ESP32 DEVKIT V1”
3) In the Tools> Port:
“COM4”, select your port. If you can’t see the COM port, you need to install the
ESP32 CP210x USB to UART Bridge VCP Drivers.
4) Now we will test
the connection using the WiFiScan sketch available in the Arduino IDE. Go to
File> Examples> WiFi> WiFiScan
5) A new sketch will
open. Now press the upload button. Wait a few seconds while the code compiles
and uploads to the board. If you find out that the terminal keeps showing
connecting, you can try to press the BOOT button on the board several times to
ensure the connection is successful.
6) If everything is done
completely, you should see the following message.
7) Open the Arduino IDE
Serial monitor in the upper right corner.
8) Remember to make sure
that the baud rate is 115200. Press the ESP32 on-board EN button, and you
should see the available networks.
Deleting
the Espressif folder
*if
this is your first time installing the ESP32 on Arduino IDE, then ignore this
part.
1)
Find the espressif folder and Arduino IDE location (installation path). Open
Arduino IDE and go to File> Preferences
2)
Copy the path location from the “Sketchbook location” field.
3)
Now paste the path location into the File Explorer and click the “hardware”
folder.
4)
Delete the espressif folder
Troubleshooting
Tip
1)
Failed to connect to ESP32: Time out… Connecting…
If
you try a few time to upload a new sketch to ESP32 and it keep fails to
connect to your board, you can follow the following step:
i)
Holding down the BOOT button on the ESP32 board
ii)
Upload the sketch
iii)
After you see the “Connecting…” message in the terminal, release the finger
from the BOOT button.
2)
COM Port not found or not available
After
you plug the ESP32 board, if the Arduino IDE showing a gray out “Port”, it
might be one of these problems:
1.
USB drivers missing
2.
USB cable without data wires.
a)
To solve the first problem, you can download the driver according to the
particular chip for the ESP32, in this case, our ESP32 board is using CP2102
chip. To download the driver, go to Google and search “CP2102 driver
download”.
After
installed, restart the Arduino IDE and you should see the COM port in the Tools
menu.
b)
If you have the proper driver installed, but you still can’t find the Port, check
the USB cables that you are using as data wires. There are often have two types
of wires, one is wires that could transfer data which is known as data wires
while the other one is charge wire which can’t transfer any data. If you are
using charge wire, your computer will never establish serial communication
with ESP32. Using data cables should solve your problem.
Comments
Post a Comment