Project Start Planning


The schematic executor reports completion, but I cannot inspect or independently verify its output because no ACUs are currently available. Remaining work is to review ERC, confirm all 18 servo connectors and both 5 V domains, validate the HC-SR04 divider/PCA9685 wiring, then proceed to PCB placement and routing.
Check ERC for unconnected pins, power conflicts, and other schematic errors.
I can’t run or inspect ERC because the account currently has no available ACUs. No ERC verification was completed in this session.
Remaining checks:
  • Unconnected and dangling pins
  • Power-output conflicts and incorrect power-net types
  • All 18 servo connector signal/power/ground connections
  • PCA9685 address, OE, I²C, VDD, V+ and decoupling
  • HC-SR04 ECHO divider and ESP32 GPIO connections
  • Separation of +5V_SERVO and +5V_ESP32, with common GND
Re-run ERC for unconnected pins, power conflicts, and any other schematic errors.
I still can’t re-run ERC because the account has no available ACUs. No new schematic checks or changes were made.
Once ACUs are available, the remaining task is to run ERC and inspect unconnected pins, power conflicts, all 18 servo ports, both PCA9685s, the HC-SR04 divider, and separation of +5V_SERVO from +5V_ESP32.
Check ERC later
Inspect power nets
Review unconnected pins
Check servo interfaces

Firmware Getting Started
Pin Mapping

Table


FunctionESP32 pinConnected hardware
I2C SDAGPIO21U2/U3 SDA, R3 pull-up
I2C SCLGPIO22U2/U3 SCL, R4 pull-up
Ultrasonic TRIGGPIO17J23 TRIG
Ultrasonic ECHOGPIO16R1/R2 divided ECHO
PWM driver AI2C 0x40J5-J20, channels 0-15
PWM driver BI2C 0x41J21-J22, channels 0-1
Arduino Dependencies
  • ESP32 Arduino board support package.
  • Wire library.
  • A PCA9685 driver such as Adafruit PWM Servo Driver Library.
Minimal Initialization

Cpp


#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

Adafruit_PWMServoDriver pwmA(0x40);
Adafruit_PWMServoDriver pwmB(0x41);

constexpr int PIN_TRIG = 17;
constexpr int PIN_ECHO = 16;

void setup() {
  pinMode(PIN_TRIG, OUTPUT);
  digitalWrite(PIN_TRIG, LOW);
  pinMode(PIN_ECHO, INPUT);

  Wire.begin(21, 22);
  pwmA.begin();
  pwmB.begin();
  pwmA.setPWMFreq(50);
  pwmB.setPWMFreq(50);
}
Servo Channel Mapping
  • Leg 1: U2 channels 0, 1, 2.
  • Leg 2: U2 channels 3, 4, 5.
  • Leg 3: U2 channels 6, 7, 8.
  • Leg 4: U2 channels 9, 10, 11.
  • Leg 5: U2 channels 12, 13, 14.
  • Leg 6: U2 channel 15; U3 channels 0, 1.
HC-SR04 Measurement Example

Cpp


long readEchoUs() {
  digitalWrite(PIN_TRIG, LOW);
  delayMicroseconds(2);
  digitalWrite(PIN_TRIG, HIGH);
  delayMicroseconds(10);
  digitalWrite(PIN_TRIG, LOW);
  return pulseIn(PIN_ECHO, HIGH, 30000);
}
Startup Sequence
  1. Start serial diagnostics.
  2. Configure TRIG/ECHO GPIO.
  3. Start I2C on GPIO21/22.
  4. Initialize PCA9685 devices at 0x40 and 0x41.
  5. Set all servo outputs to safe neutral/disabled values before enabling gait control.
  6. Verify ultrasonic timeout behavior before entering the motion loop.
  • Pin Mapping

  • Arduino Dependencies

  • Minimal Initialization

  • Servo Channel Mapping

  • HC-SR04 Measurement Example

  • Startup Sequence