100% found this document useful (1 vote)
413 views

Getting Started With ESP32

The document provides information about getting started with the ESP32 microcontroller. It describes the ESP32 chip and development boards, how to install the Arduino IDE and configure it for ESP32, and a basic blinking LED example project to verify that the setup is working.

Uploaded by

Tarbiyatun Navi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
413 views

Getting Started With ESP32

The document provides information about getting started with the ESP32 microcontroller. It describes the ESP32 chip and development boards, how to install the Arduino IDE and configure it for ESP32, and a basic blinking LED example project to verify that the setup is working.

Uploaded by

Tarbiyatun Navi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

Getting Started with ESP32

Embedded System
ESP32 Microcontroller
ESP32
Microcontroller

• ESP32 adalah SoC (System on Chip) microcontroller, dibuat


oleh Espressif System (https://www.espressif.com/)
• Penerus dari ESP8266 yang selain memiliki fitur WiFi juga
dilengkapi dengan Bluetooth, dan juga telah dual-core.
ESP32 Development Board

• ESP32 Development board adalah low-footprint, breadboard-friendly, minimum


system development board
(https://www.espressif.com/en/products/hardware/esp32/overview)
• Board ini powered by the ESP32-WROOM-32 module
(https://circuits4you.com/2018/12/31/esp32-devkit-esp32-wroom-gpio-pinout/)
ESP32 Development Board
Fitur dan Spesifikasi ESP32
• Processor: mikroprosesor Tensilica Xtensa Dual-Core
32-bit LX6, Frekuensi clock hingga 240 MHz
• WiFi: 2.4GHz up to 150 Mbit/s
• Bluetooth: BLE (Bluetooth Low Energy) dan Bluetooth
legacy.
• ROM: 448 KB
• SRAM: 520 KB
• Low Power: bercatu daya rendah, bahkan dapat
menjalankan fungsi ADC dalam mode sleep
Fitur dan Spesifikasi ESP32
• Periperal Input/Output: ADC (Analog-to-Digital Converter), DAC
(Digital-to-Analog Converter), I²C (Inter-Integrated Circuit), UART
(Universal Asynchronous Receiver/Transmitter), CAN 2.0 (Controller
Area Network), SPI (Serial Peripheral Interface), I²S (Integrated
Interchip Sound), RMII (Reduced Media-Independent Interface), dan
PWM (Pulse-Width Modulation).
• Keamanan: akselerator hardware untuk AES dan SSL/TLS
ESP32 vs Arduino Uno
Feature Arduino Uno ESP32
Processor ATmega328P - 8-bit AVR family Xtensa® dual (or single)-core 32-bit LX6
microcontroller, 8-11 MIPS microprocessor(s), up to 600 MIPS
Operating Voltage 5V 3.3V
Analog Input Pins 6 (A0 – A5) 12-bit SAR ADC up to 18 channels, 2 ×
8-bit DAC
Digital I/O Pins 14 34 × programmable GPIOs
Flash Memory 32 KB (0.5 KB is used for Bootloader) QSPI supports multiple flash
SRAM 2 KB 520 KB
EEPROM 1 KB 448 KB
Frequency (Clock Speed) 16 MHz 160/240 MHz
Wired Communication UART, I2C, SPI UART, I2S, I2C, SPI, etc
Wireless Communication none WiFi, Bluetooth, BLE
ESP32
Block Diagram

Pin Layout
ESP32 Functional Block Diagram
esp32.net
ESP32 Compatible Development Board
How to Select
Development Board
• Pin configuration and number of pins. To properly use the ESP32 in your
projects you need to have access to the board pinout. Make sure you have
access to the board pinout you’re getting.
• USB-to-UART interface and voltage regulator circuit. Most full-feature
development boards have these two features.
• BOOT and RESET buttons.
• Battery connector. If you want to power your ESP32 using batteries, there
are development boards that come with connectors for liPo batteries.
• Extra features. There are ESP32 development boards with extra features
like an OLED display, a LoRa module or a camera.
Memulai dengan Board ESP32
ESP32 DEVKIT DOIT
• Terdiri dari 2 versi yakni board dengan 30 atau 36 GPIO
• Dilengkapi dengan tombol on-board REST (EN) dan BOOT
• Dilengkapi interface USB-to-UART sehingga dapat memprogramnya
dengan Arduino IDE atau lainnya
• Dilengkapi rangkaian regulator tegangan sehingga dapat dicatu
dengan konektor microUSB
ESP32 Board DevKit V1 (36 pins)
ESP32 Board DevKit V1 (30 pins)
ESP32 Board DevKit V1 (30 pins)
ESP-32S NodeMCU (38 pin)
Peripheral Board ESP32
• 18 Analog-to-Digital Converter (ADC) channels
• 3 SPI interfaces
• 3 UART interfaces
• 2 I2C interfaces
• 16 PWM output channels
• 2 Digital-to-Analog Converters (DAC)
• 2 I2S interfaces
• 10 Capacitive sensing GPIOs
Instalasi Board ESP32
Preparation
• Development Board: ESP32 with the ESP-
WROOM-32 chip (DEVKIT, NodeMCU)
• Programming environment: Arduino IDE,
download fromi https://www.arduino.cc/
• Kabel USB type A to microUSB sebagai jalur
komunikasi dari komputer ke board ESP32,
sekaligus sebagai sumber catu daya board
ESP32
Setting Programming Environment: Arduino IDE
1. Download Arduino IDE
2. Arduino IDE installation
3. Install hardware definition (package board ESP32)
4. Setting communication port (board to computer – USB to UART)
5. Install libraries (manually or via the library manager)
6. Upload sketches
7. Serial Monitor
1. Download Arduino IDE

https://www.arduino.cc/en/Main/Software
2. Instalasi Arduino Desktop IDE
Menjalankan Arduino IDE
3. Konfigurasi Arduino IDE

• Asumsi pertama kali


menggunakan Board ESP32
pada Arduino IDE
• Buka jendela Preferences
Konfigurasi Arduino IDE

• Masukkan link berikut pada


Additional Boards Manager
URLs:
https://dl.espressif.com/dl/pac
kage_esp32_index.json
Konfigurasi Arduino IDE
• Buka Tools | Boards Manager dan lakukan instalasi ESP32
Instalasi Package Board ESP32
Konfigurasi Arduino IDE
• Setelah menginstall package ESP32, buka jendela Tools, dan pilih
ESP32 DEVKIT V1 sesuai tipe board
4. Koneksi Serial ESP32 ke PC
• Board ESP32 dilengkapi dengan konverter USB ke UART untuk
komunikasi data secara serial antara ESP32 dengan PC.
• UART (Universal Asynchronous Receiver-Transmitter) adalah suatu
protokol komunikasi serial, digunakan untuk mengirimkan (transmit)
dan menerima (receive) data serial.
Menginstal Driver USB to UART
• Komunikasi antara PC dengan board ESP32 adalah menggunakan
divais USB to UART (komunikasi serial)
• Lakukan instalasi driver yang dapat diunduh pada link:
https://www.silabs.com/products/development-tools/software/usb-
to-uart-bridge-vcp-drivers
Menyalakan Board ESP32
• Sambungkan board ESP32 dengan menggunakan kabel USB ke
komputer atau laptop
• Cek hasil instalasi driver USB to UART untuk mengecek apakah divais
USB to UART sudah terdeteksi atau belum (pada komputer Mac OS
menggunakan Terminal)
Sebelum dan Setelah Install Driver
Konfigurasi Port USB to UART
Board ESP32 Siap Digunakan
First ESP32 Experiment: LED Blink
Peralatan yang Dibutuhkan

• Board ESP32
• PC/ Laptop
• Kabel USB Type A to MicroUSB
• Arduino IDE
Buka File Blink dari Examples
File Blink
Pelajari Kode File Blink
Pelajari Kode File Blink
Ubah lamanya LED menyala atau mati dengan memperbaharui nilai
delay

delay(1000);

artinya lamanya LED menyala atau mati adalah 1000 ms atau 1 detik
Lakukan Verify
Done Compiling
Upload Program
ke ESP32
Pesan Error pada Saat Upload
Arduino: 1.8.9 (Mac OS X), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 921600, None"

Sketch uses 194472 bytes (14%) of program storage space. Maximum is 1310720
bytes.
Global variables use 13332 bytes (4%) of dynamic memory, leaving 314348 bytes for
local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port /dev/cu.SLAB_USBtoUART
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet
header
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet
header

This report would have more information with


"Show verbose output during compilation"
option enabled in File -> Preferences.
Mengatasi Pesan Error

• Ketika proses Upload, tekan


tombol Boot sampai proses
transfer terjadi, lepaskan dan akan
muncul pesan “Done uploading”
• Tekan tombol EN untuk mereset
board dan LED biru akan berkedip
terus menerus
LED Blinking

You might also like