Getting Started With ESP32
Getting Started With ESP32
Embedded System
ESP32 Microcontroller
ESP32
Microcontroller
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
• 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