Skip to main content
Quick reference for GPIO assignments on the ED1 Citilab Board.

GPIO assignment table

GPIOFunctionIDDirNotes
0Boot/Flash-IBoot mode select
2Touch Leftbtn_leftICapacitive touch
4Touch Upbtn_upICapacitive touch
5TFT CSinternal_displayOSPI chip select
9TFT DCinternal_displayOData/Command
10TFT Resetinternal_displayODisplay reset
12LED Matrixled_matrix_lightOWS2812 data
13Touch Downbtn_downICapacitive touch
14Touch Xbtn_xICapacitive touch
15Touch OKbtn_okICapacitive touch
18SPI CLKspiOSPI clock
19SPI MISOspiISPI data in
21I2C SDAbus_i2cI/OI2C data
22I2C SCLbus_i2cOI2C clock
23SPI MOSIspiOSPI data out
26Buzzerbuzzer_outputOPAM8301 amp
27Touch Rightbtn_rightICapacitive touch
34Light Sensorlight_sensorIADC input
32IR TXremote_transmitterORev 1.0 only
33/35IR RXremote_receiverIGPIO33 Rev 1.0, GPIO35 Rev 2.3
ID = ESPHome component ID. Dir = I (input), O (output), I/O (bidirectional).

Bus assignments

SPI bus

GPIO18 (CLK), GPIO23 (MOSI), GPIO19 (MISO). Used by TFT Display (ST7735).

I2C bus

GPIO21 (SDA), GPIO22 (SCL). Rev 2.3:
DeviceAddressFunction
MXC6655XA0x15Accelerometer
MCP230090x20I/O Expander (stepper motors)
Rev 1.0:
DeviceAddressFunction
LIS3DH0x19Accelerometer
MCP230170x20I/O Expander (16 GPIO pins)

MCP23009 GPIO mapping (stepper motors)

GPIOCoilDriverMotor
GP0DULN2004A U8M2
GP1CULN2004A U8M2
GP2BULN2004A U8M2
GP3AULN2004A U8M2
GP4DULN2004A U7M1
GP5CULN2004A U7M1
GP6BULN2004A U7M1
GP7AULN2004A U7M1

Touch button mapping

UP
GPIO4
LEFT
GPIO2
TFT Display
RIGHT
GPIO27
OK
GPIO15
X
GPIO14
DOWN
GPIO13

Analog inputs

GPIOFunctionADCAttenuation
34Light SensorADC1_CH612dB (0–3.3V)

LED matrix

  • Data Pin: GPIO12
  • Type: WS2812X (GRB color order)
  • Count: 256 LEDs (32 columns x 8 rows)
  • Layout: Serpentine (zigzag) pattern

Pixel mapping

Column:  0   1   2   3  ...
Row 0:   0   15  16  31 ...
Row 1:   1   14  17  30 ...
Row 2:   2   13  18  29 ...
...
Row 7:   7   8   23  24 ...
Formula:
if (x % 2 == 0)
    pixel = (x * 8) + y;
else
    pixel = (x * 8) + (7 - y);

Expansion connectors

Analog ports - J5 (left side)

Input-only ADC pins, directly connected to ESP32. Active-low.
PortGPIOADCNotes
A1GPIO36ADC1_CH0SVP
A2GPIO37ADC1_CH1-
A3GPIO38ADC1_CH2-
A4GPIO39ADC1_CH3SVN
All analog ports share a 3-pin connector: S (signal), + (3.3V), - (GND).

Digital ports - J2 (right side)

PortGPIOADCNotes
D1GPIO12ADC2_CH5LED matrix data
D2GPIO25ADC2_CH8DAC1
D3GPIO32ADC1_CH4-
D4GPIO26ADC2_CH9Buzzer output
All digital ports share a 3-pin connector: S (signal), + (5V), - (GND). Note: D1 (GPIO12) and D4 (GPIO26) are used internally. D2 (GPIO25) and D3 (GPIO32) are available for external use.

I2C/serial - J6 (bottom left)

PinLabelGPIOFunction
1DAGPIO21I2C SDA
2CLGPIO22I2C SCL
3TXGPIO1UART TX
4RXGPIO3UART RX

Grove connector (J11)

PinSignalConnection
1VDD333.3V
2GNDGround
3SDAGPIO21
4SCLGPIO22

Stepper motor connectors

M1 & M2 (28BYJ-48)

PinSignal
1Coil A
2Coil B
3Coil C
4Coil D
5VDD5 (common)
Controlled via MCP23009 I/O expander and ULN2004A drivers.

Reserved/internal GPIOs

These GPIOs are used internally by the ESP32 or board hardware:
GPIOInternal Use
6-11Flash (do not use)
16, 17Flash CS/SDO
36, 39Sensor VP/VN