這是用戶在 2024-6-25 9:33 為 https://microdigisoft.com/getting-started-with-the-esp32-development-board/ 保存的雙語快照頁面,由 沉浸式翻譯 提供雙語支持。了解如何保存?

Getting Started with the ESP32 Development Board
ESP32 開發板入門

Introduction 介紹

Welcome to this comprehensive guide on Getting started with the ESP32 development board. In this tutorial, we will delve into the world of the ESP32, a compact and affordable module equipped with a dual-core 32-bit CPU controller. Developed by Espressif Systems, this versatile microcontroller boasts integrated Wi-Fi and dual-mode Bluetooth capabilities, making it a prime choice for designing and prototyping IoT solutions. This tutorial will provide you with not only the foundational knowledge of the ESP32 but also insights into its specifications, features, programming environments, and practical applications.
歡迎閱讀 ESP32 開發板入門綜合指南。在本教程中,我們將深入探討 ESP32 的世界,這是一款緊湊且經濟實惠的模組,配備雙核 32 位 CPU 控制器。這款多功能微控制器由樂鑫公司開發,集成了Wi-Fi和雙模藍牙功能,是設計和原型設計物聯網解決方案的首選。本教程不僅為您提供 ESP32 的基礎知識,還為您提供對其規格、特性、程式設計環境和實際應用的見解。

ESP32 Development Board: A Glimpse
ESP32 開發板:一瞥

The ESP32 stands as the successor to the ESP8266, offering a host of enhanced features. With the ability to function independently or as a slave device to a host MCU, the ESP32 minimizes communication stack overhead on the main application processor. It boasts an impressive array of peripherals, including capacitive touch, ADC, DAC, I2C, SPI, UART, I2S, and PWM, facilitating diverse application possibilities.
ESP32 是 ESP8266 的繼任者,提供了許多增強功能。ESP32 能夠獨立運行或作為主機 MCU 的從設備運行,從而最大限度地減少了主應用處理器上的通信堆疊開銷。它擁有一系列令人印象深刻的外設,包括電容式觸摸、ADC、DAC、I2C、SPI、UART、I2S 和 PWM,促進了各種應用可能性。

ESP32 is capable of functioning reliably in industrial environments, with an operating temperature ranging from –40°C to +125°C. Powered by advanced calibration circuitries, ESP32 can dynamically remove external circuit imperfections and adapt to changes in external conditions.
ESP32 能夠在工業環境中可靠運行,工作溫度範圍為 –40°C 至 +125°C。 ESP32 由先進的校准電路提供支援,可以動態去除外部電路缺陷並適應外部條件的變化。

ESP32 has Xtensa® Dual-Core 32-bit LX6 microprocessors, which runs up to 600 DMIPS. The ESP32 will run on breakout boards and modules from 160Mhz upto 240MHz . That is very good speed for anything that requires a microcontroller with connectivity options.
ESP32 具有 Xtensa® 雙核 32 位 LX6 微處理器,運行速度高達 600 DMIPS。ESP32 將在 160Mhz 至 240MHz 的分線板和模組上運行。對於任何需要帶有連接選項的微控制器的人來說,這都是非常好的速度。

It is one of the best solutions for DIY Internet of Things Projects and Smart Home Projects. Explore below the list of ESP32 based IoT projects.
它是DIY物聯網專案和智慧家居專案的最佳解決方案之一。在下面瀏覽基於ESP32的物聯網項目清單。

Specifications at a Glance
規格一覽

The ESP32 Development Board is armed with dual-core processing capabilities, effectively integrating two processors. This microcontroller comes embedded with Wi-Fi and Bluetooth functionalities, while its 32-bit processing capability enables the execution of complex programs. Operating at clock frequencies of up to 240MHz and equipped with a 512 kB RAM, this board promises robust performance. Sporting either 30 or 36 pins (15 in each row), it offers a wide range of peripherals, such as capacitive touch, ADCs, DACs, UART, SPI, I2C, and more. Additionally, it incorporates a built-in hall effect sensor and a temperature sensor, enhancing its versatility.
ESP32 開發板具備雙核處理能力,有效集成兩個處理器。該微控制器嵌入了Wi-Fi和藍牙功能,而其32位處理能力可執行複雜的程式。該板以高達 240MHz 的時鐘頻率運行,配備 512 kB RAM,可保證強大的性能。它採用 30 或 36 個引腳(每排 15 個引腳),提供廣泛的外設,例如電容式觸摸、ADC、DAC、UART、SPI、I2C 等。此外,它還集成了內置霍爾效應感測器和溫度感測器,增強了其多功能性。

Features in Detail 詳細功能

Processors: The ESP32 houses Xtensa® Dual-Core 32-bit LX6 microprocessors, capable of running at speeds between 160MHz to 240MHz, delivering up to 600 DMIPS performance. The presence of an Ultra Low Power (ULP) co-processor further enhances its efficiency. With 320 KiB of RAM and 448 KiB of ROM, memory constraints are far from a concern.
處理器:ESP32 搭載 Xtensa® 雙核 32 位 LX6 微處理器,運行速度在 160MHz 至 240MHz 之間,提供高達 600 DMIPS 的性能。超低功耗 (ULP) 協處理器的存在進一步提高了其效率。憑藉 320 KiB 的 RAM 和 448 KiB 的 ROM,記憶體限制遠非問題。

Wireless Connectivity: 802.11 b/g/n Wi-Fi and v4.2 BR/EDR Bluetooth, along with BLE (Bluetooth Low Energy), collectively empower seamless wireless communication.
無線連接:802.11 b/g/nWi-Fi和 v4.2 BR/EDR 藍牙以及 BLE(低功耗藍牙)共同實現無縫無線通信。

Built-in Peripherals: An array of peripherals, including timers, watchdogs, real-time clocks, ADCs, DACs, touch sensors, and more, contributes to its versatility. Moreover, the presence of an Ultra Low Power (ULP) co-processor and an Ethernet MAC interface augments its capabilities. We will delve into key functionalities such as capacitive touch, ADC, DAC, I2C, SPI, UART, I2S, and PWM, uncovering how these features enrich the ESP32’s potential.
內置外設:一系列外設,包括定時器、看門狗、即時時鐘、ADC、DAC、觸摸感測器等,有助於實現其多功能性。此外,超低功耗 (ULP) 協處理器和乙太網 MAC 介面的存在增強了其功能。我們將深入探討電容式觸控、ADC、DAC、I2C、SPI、UART、I2S 和 PWM 等關鍵功能,揭示這些功能如何豐富 ESP32 的潛力。

Capacitive Touch Sensing: A Touch of Intuition
電容式觸摸感應:直覺的觸感

One standout feature of the ESP32 is its capacitive touch capability. This technology empowers the microcontroller to perceive touch interactions on various surfaces. By using capacitive touch sensors, you can create interactive projects that respond to human touch, enabling a more intuitive user experience. Whether it’s designing touch-sensitive buttons or proximity-based triggers, the ESP32’s capacitive touch feature brings a new dimension of interactivity to your projects.
ESP32 的一個突出特點是其電容式觸摸功能。該技術使微控制器能夠感知各種表面上的觸摸交互。通過使用電容式觸控感測器,您可以創建響應人類觸摸的互動式專案,從而實現更直觀的用戶體驗。無論是設計觸摸感應按鈕還是基於接近的觸發器,ESP32 的電容式觸摸功能都能為您的項目帶來全新的交互性維度。

Analog-to-Digital Conversion (ADC) and Digital-to-Analog Conversion (DAC):
樣本轉換 (ADC) 和數模轉換 (DAC):

ADC and DAC functionalities are paramount for projects that involve interfacing with analog sensors and actuators. The ESP32’s built-in ADC allows you to convert analog signals, such as sensor readings, into digital values that can be processed by the microcontroller. Conversely, the DAC enables the conversion of digital data into analog signals, useful for controlling analog devices like audio amplifiers or generating smooth voltage outputs. These capabilities broaden the spectrum of projects you can undertake with the ESP32.
ADC和DAC功能對於涉及與模擬感測器和執行器介面的項目至關重要。ESP32 的內建 ADC 允許您將模擬信號(例如感測器讀數)轉換為可由微控制器處理的數位值。相反,DAC能夠將數位數據轉換為模擬信號,可用於控制音訊放大器等模擬設備或產生平滑的電壓輸出。這些功能拓寬了 ESP32 可以執行的專案範圍。

I2C and SPI: Seamless Communication Interfaces
I2C 和 SPI:無縫通信介面

Inter-Integrated Circuit (I2C) and Serial Peripheral Interface (SPI) are crucial communication interfaces for connecting peripherals and devices to a microcontroller. The ESP32’s support for these interfaces enhances its versatility. I2C facilitates communication with multiple devices using a shared bus, while SPI offers high-speed serial communication for devices that demand rapid data transfer. Whether you’re integrating sensors, displays, or memory modules, the ESP32’s I2C and SPI capabilities simplify the process of establishing connections.
內部積體電路 (I2C) 和串行外設介面 (SPI) 是將外設和設備連接到微控制器的關鍵通信介面。ESP32 對這些介面的支持增強了其多功能性。I2C 使用共用總線促進與多個設備的通信,而 SPI 則為需要快速數據傳輸的設備提供高速串行通信。無論您是整合感測器、顯示器還是記憶體模組,ESP32 的 I2C 和 SPI 功能都簡化了建立連接的過程。

Universal Asynchronous Receiver-Transmitter (UART): Serial Communication Simplified
通用異步接收器-發送器 (UART):簡化串行通信

UART, a fundamental communication protocol, enables asynchronous serial communication between devices. The ESP32’s UART capability is pivotal for interfacing with devices that communicate via the serial protocol. Whether it’s debugging, connecting to peripherals, or establishing communication with external modules, the UART feature provides a reliable channel for data exchange.
UART 是一種基本的通信協定,可實現設備之間的異步串行通信。ESP32 的 UART 功能對於與通過串行協定通信的設備連接至關重要。無論是調試、連接外設,還是與外部模組建立通信,UART 功能都為數據交換提供了可靠的通道。

I2S: Enriching Audio Capabilities
I2S:豐富音訊功能

The ESP32’s Integrated Inter-IC Sound (I2S) interface is a boon for projects involving audio data transmission. Whether you’re dealing with audio playback, voice recognition, or even acoustic sensor applications, the I2S interface ensures high-fidelity sound transmission. This capability opens doors to creative audio-based projects and applications.
ESP32 的整合 IC 間聲音 (I2S) 介面是涉及音訊數據傳輸的專案的福音。無論您是在處理音訊播放、語音辨識,還是聲學感測器應用,I2S 介面都能確保高保真聲音傳輸。此功能為基於音訊的創意專案和應用程式打開了大門。

Pulse Width Modulation (PWM): Precision in Pulse Control
脈寬調製 (PWM):脈衝控制的精度

PWM is a technique employed to achieve precise control over the intensity of analog signals by rapidly toggling between high and low states. The ESP32’s PWM capabilities are indispensable for projects that require accurate control of devices such as LED brightness, motor speed, or even generating analog-like signals. This feature grants you granular control over pulse widths, enabling dynamic adjustments in various applications.
PWM是一種通過在高低狀態之間快速切換來實現對模擬信號強度的精確控制的技術。ESP32 的 PWM 功能對於需要精確控制 LED 亮度、電機速度甚至生成類似模擬信號等設備的項目來說是必不可少的。此功能可讓您對脈衝寬度進行精細控制,從而在各種應用中實現動態調整。

Programming Environments:
程式設計環境:

The ESP32 supports a range of programming environments, granting developers the flexibility to choose their preferred method:
ESP32 支援多種程式設計環境,讓開發者可以靈活地選擇自己喜歡的方法:

  • Arduino IDE Arduino IDE積體電路
  • Espressif IDF (IoT Development Framework)
    樂鑫 IDF(物聯網開發框架)
  • Micropython 小蟒蛇
  • JavaScript JavaScript的
  • LUA

ESP32 Development Board ESP32 開發板

Here’s some examples of ESP32 boards:
以下是 ESP32 開發板的一些範例:

ESP32 Development Board

Specifications: 規格:

  • The ESP32 Development Board is dual core, this means it has 2 processors.
    ESP32 開發板是雙核的,這意味著它有 2 個處理器。
  • It has Wi-Fi and Bluetooth built-in.
    它內置了Wi-Fi和藍牙。
  • It runs 32 bit programs.
    它運行32位程式。
  • The clock frequency can go up to 240MHz and it has a 512 kB RAM.
    時鐘頻率可以達到 240MHz,它有一個 512 kB RAM。
  • This particular board has 30 or 36 pins, 15 in each row.
    這個特殊的板有 30 或 36 個引腳,每行 15 個。
  • It also has wide variety of peripherals available, like: capacitive touch, ADCs, DACs, UART, SPI, I2C and much more.
    它還提供各種外設,例如:電容式觸摸、ADC、DAC、UART、SPI、I2C 等等。
  • It comes with built-in hall effect sensor and built-in temperature sensor.
    它帶有內置霍爾效應感測器和內置溫度感測器。

ESP32 Development Board Features:
ESP32 開發板特性:

Processors: 處理器:

  • CPU: Xtensa dual-core (or single-core) 32-bit LX6 microprocessor, operating at 160 or 240 MHz and performing at up to 600 DMIPS
    CPU:Xtensa 雙核(或單核)32 位 LX6 微處理器,工作頻率為 160 或 240 MHz,運行速度高達 600 DMIPS
  • Ultra low power (ULP) co-processor
    超低功耗 (ULP) 協處理器
  • Memory: 320 KiB RAM, 448 KiB ROM
    記憶體:320 KiB RAM,448 KiB ROM
  • Wireless connectivity: 無線連線:
  • Wi-Fi: 802.11 b/g/n 無線網路連接:802.11 b/g/n
  • Bluetooth: v4.2 BR/EDR and BLE (shares the radio with Wi-Fi)
    藍牙:v4.2 BR/EDR 和 BLE(與 Wi-Fi 共用無線電)

Built-in Peripherals: 內置外設:

  • Timers and Watchdog
  • Real Time Clock
  • ADC and built-in Sensors
  • Digital to Analog Convertor (DAC)
  • Touch Sensor
  • Ultra Low Power(ULP) Co-processor
  • Ethernet MAC Interface
  • SD/SDIO/MMC Host Controller
  • Universal Asynchronous Receiver Transmitter (UART)
  • I2C Interface
  • I2S Interface
  • SPI Interface
  • Infrared Remote Controller
  • Pulse Counter
  • Pulse Width Modulation (PWM)
  • Hardware Accelerator

ESP32 Development Board Programming Environments:

The ESP32 can be programmed in different programming environments. You can use:

  • Arduino IDE
  • Espressif IDF (IoT Development Framework)
  • Micropython
  • JavaScript
  • LUA

ESP32 Pinout:

The ESP32 Development Board offers two GPIO configuration options: one with 30 pins and the other with 36 pins. A remarkable feature is the ESP32 chip’s multiplexing capability, enabling the assignment of multiple functions to a single pin. However, prudent care is needed when dealing with specific pins to avoid unexpected behavior, particularly during boot.

With the ESP32 you can decide which pins are UART, I2C, or SPI – you just need to set that on the code. This is possible due to the ESP32 chip’s multiplexing feature that allows to assign multiple functions to the same pin.

ESP32-Getting-Started
ESP32-Getting-Started
ESPpinout

The pins highlighted in green are OK to use. The ones highlighted in yellow are OK to use, but you need to pay attention because they may have unexpected behavior mainly at boot. The pins highlighted in red are not recommended to use as inputs or outputs.

GPIO Input Output Notes
0 pulled up OK outputs PWM signal at boot
1 TX Pin OK debug output at boot
2 OK OK connected to on-board LED
3 OK RX Pin HIGH at boot
4 OK OK
5 OK OK outputs PWM signal at boot
6 X X connected to the integrated SPI flash
7 X X connected to the integrated SPI flash
8 X X connected to the integrated SPI flash connected to the integrated SPI flash
9 X X connected to the integrated SPI flash
10 X X connected to the integrated SPI flash
11 X X connected to the integrated SPI flash
12 OK OK
13 OK OK outputs PWM signal at boot
14 OK OK outputs PWM signal at boot
15 OK OK
16 OK OK
17 OK OK
18 OK OK
19 OK OK
20 OK OK
21 OK OK
22 OK OK
23 OK OK
24 OK OK
25 OK OK
26 OK OK
27 OK OK
28 OK OK
29 OK OK
30 OK OK
31 OK OK
32 OK OK
33 OK OK
34 OK
35 OK
36 OK input only
37 OK input only
38 OK input only
39 OK input only

ESP32 Block Diagram: A Peek Inside

The functional block diagram of the ESP32 System-on-Chip (SoC) encapsulates its intricate architecture. For further insights, refer to its datasheet available on the Espressif Website.

The functional block diagram of this SoC taken from its datasheet, which is available on the Espressif Website.

ESP32-Getting-Started

Advantage: Arduino IDE Integration

A pivotal factor contributing to the rapid adoption of the ESP32 is its compatibility with the Arduino IDE, a favored development platform. This integration empowers developers with the familiar environment of the Arduino IDE, streamlining the programming process.

Installing ESP32 Board in Arduino IDE

As we conclude this introductory journey into the ESP32 Development Board, the next step involves integrating the ESP32 with the Arduino IDE. This installation opens doors to a world of development possibilities. Stay tuned for the upcoming tutorial on Installing ESP32 Board in Arduino IDE.

One very big advantage with ESP32, which has aided its quick adoption and massive popularity, is the provision for programming the ESP32 within the Arduino IDE.

Conclusion

In this exploration of the ESP32 development board’s hardware capabilities, we’ve delved into the realm of capacitive touch sensing, ADC, DAC, I2C, SPI, UART, I2S, and PWM. Each of these features adds a layer of versatility, making the ESP32 a microcontroller that caters to a wide array of applications.


Discover more from Electronics - Microcontrollers

Subscribe to get the latest posts to your email.

Leave a Comment