Ready to deploy design #2

February 16, 2023 · View on GitHub

Read this document from start to end before building anything. Ensure you understand everything.

This setup has not been tested at the system level. If you try, please, let me know.

Hardware features

  • Bluetooth Low Energy

  • Powered through USB (or, optionally, external power source)

  • Button box (64 inputs):

    • Up to 52 general purpose push buttons.
    • Up to 4 relative rotary encoders (with push button).

Needed parts

ItemQuantityNotes
bare bone Rotary encoderup to 4
Standard perfboard sized 24x18 holes1
Push buttonsup to 52General purpose (up to you)
Pin header (male or female up to you)136For external wiring
Schottky diodes561N4148 recommended
Resistor (any impedance 4K to 100K-ohms)4
ESP32-WROOM-32UE/E (DevKit-C)1Male pins already soldered. Choose built-in/external antenna.
External Antenna with U.FL, MHF I or AMC connector1Only required if ESP32-WROOM-32UE is chosen
Micro-USB cable long enough1For power

Other parts (quantity unknown):

  • Thin cable.
  • Cable with Dupond terminals (for external wiring). Some cable kits for protoboards will do the job. ¿Male or female? the opposite to pin headers.
  • Welding tin.

Pin-out plan for the ESP32-DevKit-C board

GPIOInputOutputUsageNotes
36OKMatrix input 1input only (no internal pull resistor)
39OKMatrix input 2input only (no internal pull resistor)
34OKMatrix input 3input only (no internal pull resistor)
35OKMatrix input 4input only (no internal pull resistor)
32OKOKMatrix input 5
33OKOKMatrix input 6
25OKOKMatrix input 7
26OKOKMatrix input 8
27OKOKROTARY1_A
14OKOKROTARY1_Boutputs PWM signal at boot
12OKOKROTARY2_Aboot fail if pulled high
13OKOKROTARY2_B
9xxUNUSABLEconnected to the integrated SPI flash
10xxUNUSABLEconnected to the integrated SPI flash
11xxUNUSABLEconnected to the integrated SPI flash
6xxUNUSABLEconnected to the integrated SPI flash
7xxUNUSABLEconnected to the integrated SPI flash
8xxUNUSABLEconnected to the integrated SPI flash
15OKOKMatrix selector 1outputs PWM signal at boot
2OKOKMatrix selector 2connected to on-board LED
0pulled up?OKMatrix selector 3outputs PWM signal at boot
4OKOKMatrix selector 4
16OKOKMatrix selector 5
17OKOKMatrix selector 6
5OKOKMatrix selector 7outputs PWM signal at boot
18OKOKROTARY3_A
19OKOKROTARY3_B
21OKOKUNUSED
3pulled upRX pinUNUSEDHIGH at boot
1TX pinOKUNUSEDdebug output at boot
22OKOKROTARY4_A
23OKOKROTARY4_B

Circuit layout

Open the circuit layout using DIY Layout Creator.

Setup #2 circuit layout

This layout includes the following subsystems (read for an in-depth explanation):

Notes and build tips:

  • Some components may look very small, not matching their actual size. This is not a mistake. They must be placed in vertical position, so they lie in a minimal surface of the perfboard. All resistors and diodes should fit in 1x4 holes when they lay in horizontal position.
  • There is a lot of wiring, which is prone to human error. Check wiring and traces twice before soldering.
  • Choose one and only one power source (USB, EXTERNAL_5V0 or EXTERNAL_3V3). Your board could get damaged if using two power sources at the same time. EXTERNAL_GND must be used along with EXTERNAL_5V0 or EXTERNAL_3V3 (but not both).

External wiring

  • Rotary's built in push buttons are wired to the button matrix (terminals SW and SW GND) as any other push button.
  • Each input has an assigned number in the circuit layout. Certain inputs have a particular function, so attach them properly.

Firmware upload

At Arduino IDE, configure the board manager for "ESP32 Dev Module".

  1. Detach the DevKit board from the circuit before continuing.
  2. Plug the USB cable to the Devkit board and upload the sketch with Arduino IDE.
  3. Attach the DevKit board to the circuit. Keep the USB cable plugged in.
  4. Open the serial monitor (Arduino IDE).
  5. Reset.
  6. Check there are no error messages.