ESP λͺ¨λ“ˆμ€ λΈ”λ£¨νˆ¬μŠ€, μ™€μ΄νŒŒμ΄λ₯Ό 기본적으둜 μ‚¬μš©ν•  수 있으며 36개의 GPIOκ°€ μ‚¬μš© κ°€λŠ₯ν•˜λ‹€. λ˜ν•œ λ³„λ„λ‘œ λ³΄λ“œ 라이브러리λ₯Ό μ„€μΉ˜ν•˜κΈ°λ§Œ ν•˜λ©΄ 아두이노 IDE둜 μ—…λ‘œλ“œκ°€ κ°€λŠ₯ν•˜λ‹€. NodeMCU λ³΄λ“œλŠ” 이 ESP32 μΉ©/λͺ¨λ“ˆμ„ κ°„λ‹¨ν•˜κ²Œ μ‚¬μš©ν•  수 μžˆλŠ” 개발 λ³΄λ“œμ΄λ‹€.

ESP32 Peripheral

  • 18 ADC(Analog-to-Digital Converter) channel
  • 3 SPI
  • 3 UART
  • 2 I2C
  • 16 PWM
  • 2 DAC (Digital-to-Analog Converter)
  • 2 I2S
  • 10 Capacitive sensing GPIO

ADC와 DACλŠ” νŠΉμ • ν•€μ—μ„œλ§Œ μ‚¬μš©ν•  수 μžˆμ§€λ§Œ λ‚˜λ¨Έμ§€λ“€μ€ μ½”λ“œμ—μ„œ μ„€μ •ν•œλŒ€λ‘œ μ‚¬μš©μ΄ κ°€λŠ₯ν•˜λ‹€. 이와 같이 핀을 λ”°λ‘œ μ½”λ“œμ—μ„œ μ„€μ •ν•΄μ„œ μ‚¬μš©ν•  수 μžˆμ§€λ§Œ, 기본적으둜 κ³ μ •λ˜μ–΄ μžˆλŠ” κΈ°λŠ₯도 μžˆλ‹€. μ•„λž˜ ν•€ 맡에 λ‚˜νƒ€λ‚˜μžˆλ‹€.

ESP32 PIN MAP

9079562_15791585746695

ESP32 핀별 κΈ°λŠ₯

INPUT Only Pins

μž…λ ₯ μ „μš© ν•€, λ‚΄λΆ€ ν’€μ—…/ν’€λ‹€μš΄ μ—†μŒ, 좜λ ₯으둜 μ‚¬μš©λΆˆκ°€

  • GPIO 34
  • GPIO 35
  • GPIO 36
  • GPIO 37
  • GPIO 38
  • GPIO 39

SPI flash intergrated on the ESP-WROOM-32

일뢀 λ³΄λ“œλ“€μ€ GPIO 6-11 핀도 μ‚¬μš© κ°€λŠ₯ν•˜μ§€λ§Œ ESP-WROOM-32 칩에 λ‚΄μž₯된 SPI Flash와 μ—°κ²°λ˜μ–΄μžˆκΈ° λ•Œλ¬Έμ— ν•΄λ‹Ή 칩을 μ‚¬μš©ν•˜λŠ” 경우 λ‹€λ₯Έ μš©λ„ μ‚¬μš©μ„ ꢌμž₯ν•˜μ§€ μ•ŠμŒ

  • GPIO 6 (SCK/CLK)
  • GPIO 7 (SDO/SD0)
  • GPIO 8 (SDI/SD1)
  • GPIO 9 (SHD/SD2)
  • GPIO 10 (SWP/SD3)
  • GPIO 11 (CSC/CMD)

Capacitive Touch GPIO

ESP32λŠ” 정전식 ν„°μΉ˜ μž…λ ₯이 κ°€λŠ₯, 10개의 ν„°μΉ˜ μž…λ ₯ μ„Όμ„œ 이용 κ°€λŠ₯

  • T0 (GPIO 4)
  • T1 (GPIO 0)
  • T2 (GPIO 2)
  • T3 (GPIO 15)
  • T4 (GPIO 13)
  • T5 (GPIO 12)
  • T6 (GPIO 14)
  • T7 (GPIO 27)
  • T8 (GPIO 33)
  • T9 (GPIO 32)

ADC (Analog-to-DIgital Converter)

18개의 12-bit(0-4095(3.3V)) ADC 채널

  • ADC1_CH0 (GPIO 36)
  • ADC1_CH1 (GPIO 37)
  • ADC1_CH2 (GPIO 38)
  • ADC1_CH3 (GPIO 39)
  • ADC1_CH4 (GPIO 32)
  • ADC1_CH5 (GPIO 33)
  • ADC1_CH6 (GPIO 34)
  • ADC1_CH7 (GPIO 35)
  • ADC2_CH0 (GPIO 4)
  • ADC2_CH1 (GPIO 0)
  • ADC2_CH2 (GPIO 2)
  • ADC2_CH3 (GPIO 15)
  • ADC2_CH4 (GPIO 13)
  • ADC2_CH5 (GPIO 12)
  • ADC2_CH6 (GPIO 14)
  • ADC2_CH7 (GPIO 27)
  • ADC2_CH8 (GPIO 25)
  • ADC2_CH9 (GPIO 26)

DAC (Digital-toAnalog Converter)

2개의 8-bit DAC 채널

  • DAC1 (GPIO 25)
  • DAC2 (GPIO 26)

RTC GPIO

There is RTC GPIO support on the ESP32. The GPIOs routed to the RTC low-power subsystem can be used when the ESP32 is in deep sleep. These RTC GPIOs can be used to wake up the ESP32 from deep sleep when the Ultra Low Power (ULP) co-processor is running. The following GPIOs can be used as an external wake up source.

  • RTC_GPIO0 (GPIO 36)
  • RTC_GPIO3 (GPIO 39)
  • RTC_GPIO4 (GPIO 34)
  • RTC_GPIO5 (GPIO 35)
  • RTC_GPIO6 (GPIO 25)
  • RTC_GPIO7 (GPIO 26)
  • RTC_GPIO8 (GPIO 33)
  • RTC_GPIO9 (GPIO 32)
  • RTC_GPIO10 (GPIO 4)
  • RTC_GPIO11 (GPIO 0)
  • RTC_GPIO12 (GPIO 2)
  • RTC_GPIO13 (GPIO 15)
  • RTC_GPIO14 (GPIO 13)
  • RTC_GPIO15 (GPIO 12)
  • RTC_GPIO16 (GPIO 14)
  • RTC_GPIO17 (GPIO 27)

PWM

좜λ ₯ κ°€λŠ₯ν•œ λͺ¨λ“  핀은 PWM으둜 μ‚¬μš© κ°€λŠ₯, λ”°λΌμ„œ μž…λ ₯ μ „μš© 핀인 34-39λŠ” PWM으둜 μ‚¬μš© λΆˆκ°€λŠ₯

ν•„μš”ν•œ νŒŒλΌλ―Έν„°

  • Signal Frequency
  • Duty Cycle
  • PWM Channel
  • μ‹ ν˜Έλ₯Ό 좜λ ₯ν•  GPIOν•€

I2C

ESP32μ—λŠ” 두 개의 I2C 채널이 있으며 λͺ¨λ“  핀을 SDA λ˜λŠ” SCL둜 μ„€μ •ν•  수 있음. Arduino IDE와 ν•¨κ»˜ ESP32λ₯Ό μ‚¬μš©ν•  경우 κΈ°λ³Έ I2C 핀은 λ‹€μŒκ³Ό κ°™μŒ

  • GPIO 21 (SDA)
  • GPIO 22 (SCL)

SPI

By default, the pin mapping for SPI is:

SPI MOSI MISO CLK CS
VSPI GPIO 23 GPIO 19 GPIO 18 GPIO 5
HSPI GPIO 13 GPIO 12 GPIO 14 GPIO 15

Interupt

All GPIOs can be configured as interrupts.

Strapping Pin

μ΄λŠ” ESP32λ₯Ό λΆ€νŒ… λ‘œλ” λ˜λŠ” ν”Œλž˜μ‹œ λͺ¨λ“œλ‘œ μ „ν™˜ν•˜λŠ” 데 μ‚¬μš©λ©λ‹ˆλ‹€. USB/Serial이 λ‚΄μž₯된 λŒ€λΆ€λΆ„μ˜ 개발 λ³΄λ“œμ—μ„œ μ΄λŸ¬ν•œ ν•€μ˜ μƒνƒœμ— λŒ€ν•΄ κ±±μ •ν•  ν•„μš”κ°€ μ—†μŠ΅λ‹ˆλ‹€. λ³΄λ“œλŠ” 핀을 점멸 λ˜λŠ” λΆ€νŒ… λͺ¨λ“œμ— μ ν•©ν•œ μƒνƒœλ‘œ λ‘‘λ‹ˆλ‹€. ESP32 λΆ€νŒ… λͺ¨λ“œ 선택에 λŒ€ν•œ μžμ„Έν•œ λ‚΄μš©μ€ μ—¬κΈ°μ—μ„œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

κ·ΈλŸ¬λ‚˜ μ΄λŸ¬ν•œ 핀에 μ£Όλ³€ μž₯μΉ˜κ°€ μ—°κ²°λ˜μ–΄ μžˆλŠ” 경우 μƒˆ μ½”λ“œλ₯Ό μ—…λ‘œλ“œν•˜λ €κ³  ν•˜λ©΄ ESP32κ°€ μƒˆ νŽŒμ›¨μ–΄λ‘œ κΉœλ°•μ΄κ±°λ‚˜ λ³΄λ“œλ₯Ό μž¬μ„€μ •ν•˜λŠ” 데 λ¬Έμ œκ°€ μžˆμ„ 수 μžˆμŠ΅λ‹ˆλ‹€. 일뢀 μ£Όλ³€ μž₯μΉ˜κ°€ 슀트랩 핀에 μ—°κ²°λ˜μ–΄ μžˆλŠ”λ° μ½”λ“œλ₯Ό μ—…λ‘œλ“œν•˜κ±°λ‚˜ ESP32λ₯Ό κΉœλ°•μ΄λŠ” 데 λ¬Έμ œκ°€ μžˆλŠ” 경우, μ£Όλ³€ μž₯μΉ˜κ°€ ESP32λ₯Ό μ˜¬λ°”λ₯Έ λͺ¨λ“œλ‘œ μ „ν™˜ν•˜μ§€ λͺ»ν•˜κΈ° λ•Œλ¬ΈμΌ 수 μžˆμŠ΅λ‹ˆλ‹€. μ˜¬λ°”λ₯Έ λ°©ν–₯으둜 μ•ˆλ‚΄ν•˜λ €λ©΄ λΆ€νŒ… λͺ¨λ“œ 선택 μ„€λͺ…μ„œλ₯Ό 읽어 λ³΄μ‹­μ‹œμ˜€. μž¬μ„€μ •, κΉœλ°•μž„ λ˜λŠ” λΆ€νŒ… ν›„μ—λŠ” μ΄λŸ¬ν•œ 핀이 μ˜ˆμƒλŒ€λ‘œ μž‘λ™ν•©λ‹ˆλ‹€.

  • GPIO 0
  • GPIO 2
  • GPIO 4
  • GPIO 5 (must be HIGH during boot)
  • GPIO 12 (must be LOW during boot)
  • GPIO 15 (must be HIGH during boot)

Pins High at Boot

일뢀 GPIOλŠ” λΆ€νŒ… λ˜λŠ” μž¬μ„€μ • μ‹œ μƒνƒœλ₯Ό HIGH둜 λ³€κ²½ν•˜κ±°λ‚˜ PWM μ‹ ν˜Έλ₯Ό 좜λ ₯함

  • GPIO 1
  • GPIO 3
  • GPIO 5
  • GPIO 6 to GPIO 11 (connected to the ESP32 integrated SPI flash memory – not recommended to use).
  • GPIO 14
  • GPIO 15

Enable (EN)

EN은 3.3V λ ˆκ·€λ ˆμ΄ν„°μ˜ Enableν•€μœΌλ‘œ, 풀업이 λ˜μ–΄ μžˆμ–΄ GND에 μ—°κ²°ν•˜λ©΄ 3.3V λ ˆκ·€λ ˆμ΄ν„°κ°€ λΉ„ν™œμ„±ν™”λ¨. 이 핀을 ν‘Έμ‰¬λ²„νŠΌμ— μ—°κ²°ν•΄ λ†“μœΌλ©΄ ESP32λ₯Ό μž¬μ‹œλ™ν•˜λŠ”λ° μ‚¬μš© κ°€λŠ₯

GPIO current drawn

The absolute maximum current drawn per GPIO is 40mA according to the β€œRecommended Operating Conditions” section in the ESP32 datasheet.

ESP32 Built-In Hall Effect Sensor

The ESP32 also features a built-in hall effect sensor that detects changes in the magnetic field in its surroundings.

아두이노 IDEμ—μ„œ μ‚¬μš©ν•˜λŠ” 경우 ν•€ 번호 D23 (pin15/GPIO 23)핀은 β€˜23β€™μœΌλ‘œ μ‚¬μš©ν•˜λ©΄ 됨

Reference

  • https://github.com/espressif/arduino-esp32