← Home
Docs/Hardware/Pinout & Headers

Pinout & Headers

All traces, driver sockets, and headers are routed directly on the EVDrive PCB.

Here are the exact schematic pin definitions, dual I2C buses, and connector layouts to use in your code.


ESP32-S3 Pin Mapping

FunctionESP32-S3 PinNet NameDetails
Motor A (Left) STEPGPIO5STEP_AStep pulse for Driver A (U3)
Motor A (Left) DIRGPIO4DIR_ADirection control for Driver A
Motor A (Left) ENGPIO6EN_AEnable / Disable Driver A (Active LOW)
Motor B (Right) STEPGPIO9STEP_BStep pulse for Driver B (U4)
Motor B (Right) DIRGPIO46DIR_BDirection control for Driver B
Motor B (Right) ENGPIO14EN_BEnable / Disable Driver B (Active LOW)
I2C Bus 1 SDAGPIO1SDAPrimary I2C bus (MPU-6050 & Encoder A)
I2C Bus 1 SCLGPIO2SCLPrimary I2C bus (MPU-6050 & Encoder A)
I2C Bus 2 SDAGPIO41SDA_BSecondary I2C bus (Encoder B)
I2C Bus 2 SCLGPIO42SCL_BSecondary I2C bus (Encoder B)
Battery Voltage SenseGPIO13VOLTAnalog input via 100k / 10k voltage divider (11:1)
Start ButtonGPIO7START_BTNTactile push button (Active LOW, pulled to GND)
Reset ButtonCHIP_PURESETHardware reset line for ESP32
Wireless / RF SwitchGPIO15WL_SWSPDT toggle switch (connected to GND)
Wireless LEDGPIO16WL_LEDLED D1 (indicates wireless state)
User Status LEDGPIO40LEDLED D5 (general-purpose programmable LED)

Dual Independent I2C Buses

Standard AS5600 magnetic encoders have a fixed, non-configurable I2C address (0x36).

Instead of requiring an external I2C multiplexer chip, the EVDrive PCB routes two separate physical I2C buses directly to the ESP32-S3:

  • Bus 1 (Wire on GPIO 1 / GPIO 2):
    • Connects to the MPU-6050 gyro module (0x68).
    • Connects to Encoder A header J1 (0x36).
    • Hardware 4.7kΩ pullups on board (R10, R11).
  • Bus 2 (Wire1 on GPIO 41 / GPIO 42):
    • Connects to Encoder B header J2 (0x36).
    • Hardware 4.7kΩ pullups on board (R12, R13).

Both encoders can be queried simultaneously in code without any address collisions.


Onboard Battery Voltage Monitoring

The board includes an onboard precision voltage divider wired to GPIO13:

  • Top Resistor (R4R_4): 100 kΩ connected to +12V
  • Bottom Resistor (R5R_5): 10 kΩ connected to GND
  • Divider Ratio:

Vbattery=VGPIO13×(100 kΩ+10 kΩ10 kΩ)=VGPIO13×11.0V_{\text{battery}} = V_{\text{GPIO13}} \times \left(\frac{100\,\text{k}\Omega + 10\,\text{k}\Omega}{10\,\text{k}\Omega}\right) = V_{\text{GPIO13}} \times 11.0

A 12.0V battery outputs approximately 1.09V on GPIO 13, which sits safely inside the ESP32 ADC range.


Headers & Connectors

Encoder Connectors (J1 & J2)

Vertical 4-pin keyed JST-XH connectors (B4B-XH-A, 2.50mm pitch) designed for custom RH Circuits AS5600 breakout boards. Keyed shrouds prevent reverse insertion and provide positive retention under vibration:

  • Pin 1: +3V3 (Regulated 3.3V logic supply)
  • Pin 2: GND (Ground)
  • Pin 3: SCL (I2C Clock: J1 routes to GPIO 2, J2 routes to GPIO 42)
  • Pin 4: SDA (I2C Data: J1 routes to GPIO 1, J2 routes to GPIO 41)

Motor Screw Terminals (J11 & J12)

Dedicated 4-pin 2.54mm pitch screw terminal blocks (J11 for Motor A / Left, J12 for Motor B / Right) wired directly to TMC2209 driver outputs (U3 and U4). Stripped motor lead wires clamp directly under screws to prevent disconnection during runs or handling:

  • Pin 1: M1B (Coil 1, Phase B)
  • Pin 2: M1A (Coil 1, Phase A)
  • Pin 3: M2A (Coil 2, Phase A)
  • Pin 4: M2B (Coil 2, Phase B)

Power Input Terminals (KF301 5.0mm Pitch Screw Terminals)

  • J4 & J9 (12V Motor Power IN): Dual parallel 2-pin screw terminals for motor power input (12V–24V).
    • Pin 1: GND (-)
    • Pin 2: +12V IN (+)
    • Protected by 5A fuse F1 and reverse-polarity P-channel MOSFET Q1 (AO4407A).
  • J5 (5V Logic Power IN): 2-pin screw terminal for 5.0V regulated logic input.
    • Pin 1: GND (-)
    • Pin 2: +5V IN (+)
    • Protected by 2A fuse F2 and reverse-polarity P-channel MOSFET Q2 (AO4407A).

Auxiliary Ground Header (J10)

A dedicated 3-pin 2.54mm vertical header where all pins are tied directly to board GND. Provides convenient ground tie points for auxiliary sensors, scopes, or test probes without crowding terminal blocks.

Expansion GPIO Header (J6)

A 10-pin 2.54mm header for extra sensors, bumper switches, or custom add-ons:

PinFunctionSchematic NetNotes
1GNDGNDCommon ground reference
2+3V3+3V33.3V regulated logic supply
3GPIO21GPIO_7General Purpose I/O
4GPIO47GPIO_6General Purpose I/O
5GPIO48GPIO_5General Purpose I/O
6GPIO45GPIO_4General Purpose I/O
7GPIO35GPIO_3General Purpose I/O
8GPIO36GPIO_2General Purpose I/O
9GPIO37GPIO_1General Purpose I/O
10GPIO38GPIO_0General Purpose I/O

Status LEDs

LEDNameDriven ByPurpose
D1WirelessGPIO16 (via 330Ω)Software-controlled RF indicator
D212V Power+12V rail (via 1kΩ)Lights when motor power rail is active
D33.3V Power+3V3 rail (via 330Ω)Lights when 3.3V LDO regulator is active
D45V Power+5V rail (via 330Ω)Lights when 5V logic power is active
D5User LEDGPIO40 (via 330Ω)User-programmable indicator LED