Sunday, January 26, 2025

Different type of ESP32S pins

1. Power Pins

Pin NamePurpose
VINInput power (5V or 3.3V) from an external source.
3.3VOutput 3.3V to power external components (like sensors or modules).
GNDGround 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 NamePurpose
GPIO0Boot mode pin. Used to flash programs when held low during boot. Can also be used as a general GPIO.
GPIO1UART TX pin (default). Can also be used as a general GPIO.
GPIO2General GPIO pin. Often connected to the onboard LED on some boards.
GPIO3UART RX pin (default). Can also be used as a general GPIO.
GPIO4-19General-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 NamePurpose
TX (GPIO1)Transmits data (UART TX).
RX (GPIO3)Receives data (UART RX).

I2C (Inter-Integrated Circuit):

Pin NamePurpose
SDA (GPIO21)Data line for I2C communication.
SCL (GPIO22)Clock line for I2C communication.

SPI (Serial Peripheral Interface):

Pin NamePurpose
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 NamePurpose
ENEnable pin. Pulling this pin low resets the ESP32.
BOOTUsed to put ESP32 into bootloader mode for uploading code.

No comments:

Post a Comment

MUD Three Mode operation Manual Automatic GPS

 Code for three mode operation: /*   3-Mode Headlight Controller   - Manual mode (driver uses a toggle to pick high/low)   - Auto mode (LDR...