Beaver Board ESP32 Pinout and Wiring
The PyBot Beaver Board is built around an ESP32-WROOM-32 module. Everything below is already wired on the board, so no breadboard or jumper wires are needed. Students normally use the pybot library or Blockly blocks and never touch GPIO numbers; this table is for makers, teachers and anyone writing raw MicroPython.
Pin map
| Function | ESP32 GPIO | Notes |
|---|---|---|
| Switch A | 33 | Pull-up, active-low. Hold at power-up for maintenance mode. |
| Switch B | 25 | Pull-up, active-low. Hold at power-up for BLE-only mode. |
| Switch C | 18 | Pull-up, active-low. No header. |
| Line sensor left | 36 | Input-only pin, external 10 kΩ pull-up, reads low over a dark line. |
| Line sensor right | 39 | Input-only pin, external 10 kΩ pull-up, reads low over a dark line. |
| Internal I2C (bus 0) SDA / SCL | 21 / 22 | SHT40 temperature and humidity sensor (0x44), SSD1306 128x64 OLED (0x3C). |
| External I2C (bus 1) SDA / SCL | 16 / 17 | Header for add-on sensors. Carries the VL53L4CD distance sensor (0x29) when fitted. |
| Left motor IN1 / IN2 | 13 / 12 | DRV8833 driver, 1 kHz PWM. The left motor is mounted mirrored, so forward drives IN1. |
| Right motor IN1 / IN2 | 14 / 27 | DRV8833 driver, 1 kHz PWM. |
| Motor driver nSLEEP | 15 | Active-high, externally pulled down. The pybot library wakes it automatically. |
| Red / yellow / green LED | 2 / 4 / 5 | PWM-dimmable at 1 kHz. |
| Buzzer | 26 | PWM tones. |
| Light sensor (PT19) | 34 | ADC1 channel 6. Use 11 dB attenuation for the full range. |
| Battery voltage sense | 35 | ADC1 channel 7 through a 27 kΩ / 10 kΩ divider (multiply the reading by 3.7). |
| Servo header | 23 | 50 Hz PWM. Header pins: signal, V+, GND. |
| Spare analog / digital | 32 | On the spare-pin header. ADC1 capable. |
| Spare digital | 19 | Test pad only. |
| UART0 TX / RX | 1 / 3 | Connected to the USB-UART chip, not to a header. |
| BOOT button | 0 | Holding it at power-up enters the ESP32 serial bootloader. |
Connectors and headers
- PWR — keyed 2-pin JST for the battery pack (4 AA batteries).
- MOT-A (left) and MOT-B (right) — 2-pin JST motor connectors.
- Line sensor header —
L/36,R/39, 3V3, GND. - External I2C header —
SDA/16,SCL/17, 3V3, GND. - Spare-pin header — GPIO 32, 3V3, GND.
- Servo header — signal (GPIO 23), V+, GND.
Pins to avoid in your own code
- GPIO 6–11 are wired to the module's SPI flash. Using them crashes the board.
- GPIO 0, 1, 3 and 15 are used internally (boot mode, USB-UART, motor-driver sleep).
- GPIO 12 is a strapping pin. Never add an external pull-up to it.
- GPIO 34, 35, 36 and 39 are input-only and have no internal pull-up.
- ADC2 pins cannot be read while Wi-Fi is on. All analog inputs on the Beaver Board use ADC1.
Using the pins from MicroPython
import pybot
pybot.led.on("GRN") # GPIO 5
pybot.motor.forward(60) # GPIO 13/12 and 14/27, speed 0-100
print(pybot.light()) # GPIO 34, 0-100
print(pybot.temperature()) # SHT40 on internal I2CRaw access works too:
from machine import Pin, PWM
red = Pin(2, Pin.OUT)
red.value(1)
buzzer = PWM(Pin(26), freq=2700, duty=512)See the pybot library reference for every function.