1. Power Pins
| Pin Name | Purpose |
|---|---|
| VIN | Input power (5V or 3.3V) from an external source. |
| 3.3V | Output 3.3V to power external components (like sensors or modules). |
| GND | Ground pins, connect to the ground of other components. |
2. GPIO Pins
- These are General Purpose Input/Output (GPIO) pins, meaning they can be used for reading inputs or controlling outputs.
- ESP32S has up to 36 GPIO pins, but not all are available on every board.
| Pin Name | Purpose |
|---|---|
| GPIO0 | Boot mode pin. Used to flash programs when held low during boot. Can also be used as a general GPIO. |
| GPIO1 | UART TX pin (default). Can also be used as a general GPIO. |
| GPIO2 | General GPIO pin. Often connected to the onboard LED on some boards. |
| GPIO3 | UART RX pin (default). Can also be used as a general GPIO. |
| GPIO4-19 | General-purpose GPIO pins. Can be configured for input, output, PWM, I2C, SPI, ADC, etc. |
| GPIO20+ | Some higher GPIO numbers may have restricted use depending on the board design. |
3. Analog Pins
ADC (Analog-to-Digital Converter):
- Up to 18 ADC pins (like GPIO32 to GPIO39) that read analog signals and convert them to digital (12-bit resolution).
- Example: Reading the output from a potentiometer or temperature sensor.
DAC (Digital-to-Analog Converter):
- GPIO25 and GPIO26 can output analog signals (like generating an audio signal).
4. Communication Pins
UART (Serial Communication):
| Pin Name | Purpose |
|---|---|
| TX (GPIO1) | Transmits data (UART TX). |
| RX (GPIO3) | Receives data (UART RX). |
I2C (Inter-Integrated Circuit):
| Pin Name | Purpose |
|---|---|
| SDA (GPIO21) | Data line for I2C communication. |
| SCL (GPIO22) | Clock line for I2C communication. |
SPI (Serial Peripheral Interface):
| Pin Name | Purpose |
|---|---|
| MOSI (GPIO23) | Master Out Slave In. |
| MISO (GPIO19) | Master In Slave Out. |
| SCLK (GPIO18) | Clock signal. |
| SS (GPIO5) | Chip select (Slave Select). |
I2S (Inter-IC Sound):
- Used for audio communication (e.g., microphones and speakers).
- Pins vary based on configuration.
5. PWM Pins
- Any GPIO pin can generate Pulse Width Modulation (PWM) signals for controlling:
- LED brightness.
- Servo motors.
- DC motor speed.
6. Touch Sensor Pins
- ESP32S has 10 capacitive touch pins. These can sense touch or proximity (like touch buttons). | Touch Pin | GPIO Equivalent | |---------------|----------------------| | T0 | GPIO4 | | T1 | GPIO0 | | T2 | GPIO2 | | T3 | GPIO15 | | T4 | GPIO13 | | T5 | GPIO12 | | T6 | GPIO14 | | T7 | GPIO27 | | T8 | GPIO33 | | T9 | GPIO32 |
7. Special Purpose Pins
| Pin Name | Purpose |
|---|---|
| EN | Enable pin. Pulling this pin low resets the ESP32. |
| BOOT | Used to put ESP32 into bootloader mode for uploading code. |
No comments:
Post a Comment