ESP32 C3 Robotics Controller

Worked for 43 mins 15 sec
Thought for a moment — Adjusting task dimensions
1/3 Resize the hexagonal outline to the smallest practical compact size

Resize the hexagonal outline to the smallest practical compact size

Place all components for single-layer CNC routing

Verify board fit, antenna keepout, and placement DRC

Thought for 18 sec
Thought for 6 sec — Inspecting layout and skills
Referenced guidance.
Thought for 4 sec
Getting a layout overview.
Reading schematic details.
Thought for 11 sec
Editing board size.
Thought for 16 sec — Planning placement constraints
Placed footprints of C1, C2, C4 and 1 more
Baking PCB layout data.
Placing 18 footprints.
Thought for 1 sec
Placing footprints of C2, C3, C1 and 1 more.
Thought for 3 mins 19 sec — Continuing tasks
Placing footprints of J1, J2, F1 and 10 more.
Thought for 1 min 36 sec — Evaluating clamping issue
Placing footprints of J1, J2, F1 and 7 more.
Thought for 44 sec — Evaluating F1 and J1 overlaps
Placing footprints of J1, J2, F1 and 9 more.
Thought for 29 sec — Clarifying positioning constraints
Placing footprints of J1, J2, U3.
Thought for 39 sec — Evaluating packing constraints
Placing footprints of J1, J2, F1 and 9 more.
Thought for 18 sec — Adjusting spacing and positions
Placing footprints of SW1, J3, C5 and 1 more.
Thought for 1 min 52 sec — Adjusting placement of J3
Placing footprints of J1, J2, F1 and 10 more.
Thought for 56 sec — Evaluating overlap and clamping
Placing footprints of J1, F1, C5 and 10 more.
Thought for 22 sec — Considering J2 movement
Placing footprints of J1, F1, C5 and 4 more.
Thought for 30 sec
Placing footprints of J1, J2, F1 and 9 more.
Thought for 30 sec — Fixing overlaps in layout
Placing footprints of BT1, J3, SW2 and 2 more.
Thought for 26 sec
Placing footprints of J3, SW1, SW2 and 1 more.
Thought for 15 sec
Placing footprints of J3, C5, SW1 and 1 more.
Thought for 9 sec
Placing footprints of SW2, C6, J3.
Thought for 6 sec
Placing footprint of SW1.
Thought for 10 sec
Placing footprint of SW1.
Thought for 6 sec
Placing footprint of SW1.
Thought for 7 sec
Placing footprint of SW1.
Thought for 8 sec — Setting initial values
Placing footprint of SW1.
Footprint placement stopped early.
Applying placement changes.
Thought for 5 sec — Calculating increments
Editing board size.
Thought for 15 sec
Placed footprints of J2, U2, BT1 and 15 more
Baking PCB layout data.
Placing 18 footprints.
Thought for 1 sec
Placing footprints of C2, C3, C1 and 1 more.
Thought for 1 min 16 sec — Continuing with skills retrieval
Placing footprints of J1, J2, U3 and 9 more.
Thought for 24 sec
Placing footprints of J1, F1, C5 and 4 more.
Thought for 14 sec — Analyzing clamp overlaps
Placing footprints of J1, F1, C5 and 6 more.
Thought for 1 min 2 sec
Placing footprints of U1, U2, C1 and 15 more.
Thought for 24 sec
Placing footprints of J2, BT1, U3 and 10 more.
Thought for 1 min 14 sec — Checking overlaps and parameters
Placing footprints of J3, C1, C2 and 6 more.
Thought for 28 sec
Placing footprints of C3, F1, C4 and 2 more.
Thought for 22 sec
Placing footprints of C1, C2, C3 and 3 more.
Thought for 1 min 3 sec — Evaluating boundaries
Placing footprints of J1, J2, F1 and 13 more.
Thought for 17 sec — Troubleshooting movement issues
Placing footprints of J1, F1, C5 and 3 more.
Thought for 58 sec — Analyzing board constraints
Placing footprints of U2, J1, F1 and 13 more.
Thought for 41 sec
Placing footprints of U1, C4, U2 and 14 more.
Thought for 52 sec — Checking positions and overlaps
Placing footprints of U1, C4, U2 and 13 more.
Thought for 29 sec
Placing footprints of F2, C1, C2 and 3 more.
Thought for 12 sec — Adjusting positions
Placing footprints of C6, SW2, R1.
Thought for 15 sec
Placing footprints of C6, SW2, R1 and 2 more.
Thought for 13 sec — Evaluating coordinate placements
Placing footprints of F2, C6.
Footprint placement stopped early.
Applying placement changes.
Thought for 5 sec
Editing board size.
Thought for 22 sec
Placed footprints of J2, BT1, J1 and 11 more
Baking PCB layout data.
Placing 18 footprints.
Thought for 2 sec
Placing footprints of C2, C3, C1 and 1 more.
Thought for 1 min 36 sec — Planning skill retrieval
Placing footprints of BT1, U3, J3 and 13 more.
Thought for 1 min 32 sec — Evaluating placement and gaps
Placing footprints of J1, J2, F1 and 4 more.
Thought for 8 sec — Testing adjustments
Placing footprints of J1, J2, F1 and 4 more.
Thought for 7 sec
Placing footprints of J2, F2, C6 and 2 more.
Thought for 23 sec — Adjusting positioning
Placing footprints of J1, F1, C5 and 4 more.
Thought for 17 sec
Placing footprints of J1, F1, C5 and 2 more.
Thought for 19 sec — Calculating adjustments for batches
Placing footprints of J2, BT1, F2 and 2 more.
Thought for 23 sec
Placing footprints of C5, F2, C6.
Thought for 25 sec — Fixing overlaps in positioning
Placing footprints of C6, F2, C5 and 1 more.
Thought for 11 sec
Placing footprints of F2, F1.
Thought for 37 sec — Examining routing criteria
Footprint placement complete.
Applying placement changes.
Thought for 7 sec
Checking routing progress.
Completed 6 design checks — found 31 issues.
Getting a layout overview.
Thought for 7 sec — Addressing design issues
Placed footprints of J2, J1, C5 and 5 more
Baking PCB layout data.
Placing 18 footprints.
Thought for 3 sec
Placing footprints of J2, U3.
Thought for 1 min 35 sec — Inspecting physical placements
Placing footprints of SW1, J3, F2 and 1 more.
Thought for 22 sec — Adjusting parameters
Placing footprints of J1, F2.
Thought for 22 sec — Checking fuse positions
Placing footprints of F2, J1.
Thought for 40 sec
Placing footprints of F2, F1, C5.
Thought for 9 sec
Placing footprints of F2, F1.
Thought for 5 sec
Placing footprint of F2.
Thought for 22 sec
Placing footprint of F2.
Thought for 11 sec
Placing footprint of F2.
Thought for 37 sec — Evaluating positioning and gaps
Placing footprints of J1, F2.
Footprint placement stopped early.
Applying placement changes.
Thought for 5 sec
Placed footprints of J1, F2
Baking PCB layout data.
Placing 18 footprints.
Thought for 3 sec
Placing footprint of F2.
Thought for 29 sec — Clarifying positioning constraints
Placing footprint of F2.
Thought for 35 sec
Placing footprint of F2.
Thought for 6 sec
Placing footprint of F2.
Thought for 4 sec
Placing footprint of F2.
Thought for 8 sec
Placing footprint of F2.
Thought for 3 sec
Placing footprint of F2.
Thought for 8 sec — Checking dimensions and movement
Placing footprint of F2.
Thought for 36 sec — Planning the move
Placing footprint of J1.
Thought for 11 sec — Clarifying completion criteria
Footprint placement complete.
Applying placement changes.
Thought for 3 sec
Checking routing progress.
Completed 6 design checks — found 31 issues.
Getting a layout overview.
Thought for a moment
DONT WORRY ABOUT THE SIZE
Got it—I’ll prioritize a clean, CNC-routeable single-layer placement over compactness, enlarging the hexagon and spreading the ESP32/driver signal corridor before routing.
The PCB currently has a 110 × 105 mm hexagonal outline with all 18 footprints placed on top, no overlaps, and the single bottom-copper CNC stackup preserved.
Remaining
  • Enlarge and re-place to eliminate the congested ESP32-to-TB6612FNG corridor.
  • Recheck single-layer routability and antenna keepout.
  • Routing has not started; 23 airwires remain.
Execution stopped because no ACUs are currently available.
Enlarge and re-place
Protect antenna keepout
CNC-friendly placement

Refine this doc
Ask about this doc
Firmware Starter
Target hardware: ESP32-C3 SuperMini, common 16-pin / 4 MB / 22.52 x 18 mm variant, with native USB-C Serial/JTAG. The carrier powers its labeled 5V input from 5V_LOGIC; do not connect external 5 V and USB power simultaneously unless the exact purchased board revision is independently verified to include safe power-path isolation.
Toolchain
Arduino framework for ESP32-C3. PlatformIO platformio.ini:

Ini


[env:esp32-c3-supermini]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino
monitor_speed = 115200
board_build.flash_size = 4MB
build_flags =
  -D ARDUINO_USB_MODE=1
  -D ARDUINO_USB_CDC_ON_BOOT=1
GPIO Mapping

Table


SignalGPIO
AIN10
AIN21
PWMA3
BIN14
BIN25
PWMB6
STBY command7
This is the actual carrier mapping: GPIO0→AIN1, GPIO1→AIN2, GPIO3→PWMA, GPIO4→BIN1, GPIO5→BIN2, GPIO6→PWMB, GPIO7→STBY command. GPIO2, GPIO8, GPIO9, GPIO10, GPIO20, and GPIO21 are unused/no-connect. GPIO8/GPIO9 (boot strapping) and GPIO18/GPIO19 (native USB, not exposed on the 16-pin edge set) are deliberately avoided.
Compilable Arduino Starter

Cpp


#include <Arduino.h>
#include <WiFi.h>
#include <NimBLEDevice.h>

static constexpr uint8_t AIN1=0, AIN2=1, PWMA=3;
static constexpr uint8_t BIN1=4, BIN2=5, PWMB=6, STBY=7;
static constexpr uint32_t FAILSAFE_MS=500;
static uint32_t lastCommandMs = 0;
static bool armed = false;

void motorStop() {
  ledcWrite(PWMA, 0);
  ledcWrite(PWMB, 0);
  digitalWrite(AIN1, LOW); digitalWrite(AIN2, LOW);
  digitalWrite(BIN1, LOW); digitalWrite(BIN2, LOW);
  digitalWrite(STBY, LOW);
  armed = false;
}

void motorSet(uint8_t in1, uint8_t in2, uint8_t pwmPin, int speed) {
  speed = constrain(speed, -255, 255);
  digitalWrite(in1, speed > 0);
  digitalWrite(in2, speed < 0);
  ledcWrite(pwmPin, abs(speed));
}

void applyCommand(int left, int right) {
  if (!armed) {
    digitalWrite(STBY, HIGH); // reaches driver only while hardware RUN/ENABLE is closed
    armed = true;
  }
  motorSet(AIN1, AIN2, PWMA, left);
  motorSet(BIN1, BIN2, PWMB, right);
  lastCommandMs = millis();
}

void setup() {
  pinMode(STBY, OUTPUT);
  digitalWrite(STBY, LOW); // first safety action
  pinMode(AIN1, OUTPUT); pinMode(AIN2, OUTPUT);
  pinMode(BIN1, OUTPUT); pinMode(BIN2, OUTPUT);
  ledcAttach(PWMA, 20000, 8);
  ledcAttach(PWMB, 20000, 8);
  motorStop();

  Serial.begin(115200);
  WiFi.mode(WIFI_STA); // Wi-Fi may be connected/configured by application
  NimBLEDevice::init("ESP32-C3-Robot"); // controller supports Wi-Fi/BLE coexistence
  lastCommandMs = millis();
}

void loop() {
  // Network/BLE handlers must call applyCommand(left,right) for each valid packet.
  // Any disconnect handler should call motorStop() immediately.
  if (armed && (millis() - lastCommandMs > FAILSAFE_MS)) motorStop();
  delay(2);
}
Safety/Startup Sequence
  1. Configure STBY output low before all other actuator pins.
  2. Configure direction and PWM; command zero duty.
  3. Start Wi-Fi and BLE services.
  4. Require an authenticated/fresh motion command before raising STBY.
  5. Stop immediately on Wi-Fi/BLE disconnect, malformed command, watchdog/reset, or 500 ms command timeout.
  6. Hardware RUN/ENABLE must also be active; firmware cannot override an open hardware chain.
The external Daier KN3A-101 remains purely in the battery power path. The hardware RUN/ENABLE chain and 10 kΩ STBY pull-down are unchanged, so reset defaults remain motor-disabled.
ledcAttach()/ledcWrite(pin,duty) match current Arduino-ESP32 3.x. For older 2.x cores, replace with channel-based ledcSetup, ledcAttachPin, and ledcWrite(channel,duty).
  • Toolchain

  • GPIO Mapping

  • Compilable Arduino Starter

  • Safety/Startup Sequence

Plug-and-Play ESP32 Robot Controller 3b39

Plug-and-Play ESP32 Robot Controller 3b39 thumbnail
Single-layer CNC-millable ESP32-C3 robot controller for two bidirectional 5 V DC motors, using solderable modules, protected 18650 charging, Wi-Fi/BLE control, and protected 3.5 mm motor connections.

Properties

Properties describe core aspects of the project.

Pricing & Availability

Distributor

Qty 1

Arrow

$1.78–$2.01

Digi-Key

$0.16

LCSC

$4.57

Mouser

$5.23

TME

$0.20

Verical

$2.00–$3.47

Controls