Skip to main content
This page lists every GPIO pin assignment used by the BrailleBridge firmware. Knowing the exact pin numbers matters both during initial assembly — so you connect each switch and LED to the correct pad on the ESP32 Dev Module — and during troubleshooting, when you need to probe individual signals to isolate a fault. If a key feels unresponsive, you can verify continuity between the switch terminal and the GPIO listed here; if an LED is dark, you can confirm the output pin and resistor are intact before touching the firmware.

GPIO pin assignments

Wiring conventions

All eight switches share a common ground bus on the perfboard. One leg of every switch connects to that ground rail; the other leg connects to its assigned GPIO pin. Because the firmware calls pinMode(..., INPUT_PULLUP) for every input, the ESP32’s internal pull-up resistors hold each line at HIGH when the switch is open. Pressing a switch pulls that GPIO directly to ground, reading LOW. This means:
  • Unpressed = HIGH
  • Pressed = LOW
You only need 9 wires total from the perfboard to the ESP32: one shared ground wire and one signal wire per input (8 inputs × 1 signal wire = 8 wires). The two LED anodes connect to GPIO 18 and GPIO 19 through individual 220 Ω resistors, with the LED cathodes returning to the same ground bus.

The 6-bit chord encoding

Each Braille dot maps to a single bit position in an unsigned 8-bit integer. Dot 1 occupies bit 0 (the least-significant bit), and dot 6 occupies bit 5. When you press a key, the firmware sets the corresponding bit; dots you do not press leave their bits at zero. After the 180 ms chording window closes, the resulting value is a compact 6-bit number that uniquely identifies the chord and can be compared against the dictionary in constant time. The function that builds this value from the six GPIO readings is reproduced below exactly as it appears in the firmware:
readChord() — reading all 6 dot pins
Each if statement checks whether its GPIO is LOW (pressed) and, if so, ORs the corresponding power-of-two bitmask into the accumulator chord. The function returns 0 if no dots are held, and a value between 1 and 63 (0b000001 – 0b111111) for any combination of pressed dots.
Pressing dots 1 and 4 together produces a chord value of 0b001001 — bit 0 set for dot 1, and bit 3 set for dot 4. In English mode this resolves to the letter ‘C’; in Bangla mode it resolves to the consonant চ (cha) under the Bharati Braille standard.