Refine this doc
Ask about this doc

Last modified 4mo ago

Project Specification — ESP32 Smart City Controller
Project Overview
  • Status: Review
  • ESP32 DevKitC 38-pin carrier PCB for a smart-city demonstration with distance sensing, servo actuation, sound/sensitivity analog inputs, and six building-light outputs.
Intended Use
  • Low-voltage indoor prototype or educational demonstrator.
  • Powered by a regulated external 5 V DC adapter.
  • Not intended for safety-critical motion control or outdoor exposure without further protection.
What the Device Should Do
  • Read an HC-SR04 ultrasonic sensor.
  • Drive one hobby servo from GPIO13.
  • Sample an analog microphone on GPIO34.
  • Sample an external sensitivity potentiometer on GPIO35.
  • Independently drive six external LEDs.
  • Use ESP32 Wi-Fi/Bluetooth capabilities for future connectivity.
Main Features
  • ESP32-DEVKITC-VE 38-pin module.
  • 5 V screw-terminal input.
  • HC-SR04 header with protected ECHO input.
  • Servo header with local bulk capacitance and startup pulldown.
  • 3.3 V microphone and potentiometer headers.
  • Six active-high, resistor-limited LED headers.
System Architecture

Diagram


Regulated 5 V input J1 ESP32 DevKitC U1 HC-SR04 J2 Servo J3 Six LED outputs J6-J11 Analog microphone J4 Sensitivity potentiometer J5 Wi-Fi / Bluetooth
Hardware Subsystems
Power
  • J1 PIN1 = 5V_EXT; J1 PIN2 = GND.
  • 5V_EXT feeds U1 5V, HC-SR04 VCC, and servo VCC.
  • C1 470 uF + C2 100 nF support servo transients.
  • C3 47 uF + C4 100 nF support the DevKit 5 V input.
  • U1 3V3 supplies the microphone and external potentiometer.
Ultrasonic Sensor
  • J2 pin 1 VCC, pin 2 TRIG, pin 3 ECHO, pin 4 GND.
  • TRIG uses GPIO4.
  • ECHO passes through R7 10 kΩ / R8 18 kΩ divider to GPIO5; 5 V becomes approximately 3.21 V.
Servo
  • J3 Gnd/5v/Data pin names are used directly.
  • GPIO13 drives Data through R9 470 Ω.
  • R10 10 kΩ pulls the connector-side servo signal low during reset.
Analog Inputs
  • Microphone J4: pin 1 3V3, pin 2 GPIO34, pin 3 GND; C5 100 nF bypass.
  • Potentiometer J5: VCC 3V3, Output GPIO35, GND common.
  • GPIO34 and GPIO35 are ESP32 ADC1 input-only pins and remain usable while Wi-Fi is active.
LED Outputs

Table


ChannelGPIOResistorHeader
112R1 220 ΩJ6
214R2 220 ΩJ7
327R3 220 ΩJ8
426R4 220 ΩJ9
525R5 220 ΩJ10
633R6 220 ΩJ11
  • Header P1 is the resistor-limited active-high signal; P2 is GND.
  • R11 10 kΩ holds GPIO12 low at reset to protect the flash-voltage boot strap.
Interfaces and Connections
  • J1: regulated 5 V DC input.
  • J2: HC-SR04.
  • J3: hobby servo.
  • J4: 3.3 V analog microphone module; output must remain within 0–3.3 V.
  • J5: recommended 10 kΩ linear potentiometer.
  • J6–J11: external LEDs only; external voltage must not be driven into these outputs.
Power and Runtime Expectations
  • Continuous operation from a wall adapter; no battery subsystem.
  • Use a 5 V, 2 A minimum adapter for a known micro-servo; 5 V, 3 A preferred when stall current is unknown.
  • Do not power the DevKit simultaneously from USB and J1 unless the exact board revision is confirmed to prevent backfeed.
Power Tree and Power Budget
  • See the Power Budget project file.
  • 5V_EXT and GND are tagged for 2 A nominal and 3 A peak design current.
Manufacturing and Assembly Expectations
  • Through-hole external connectors and radial bulk capacitors; 0603 resistors and bypass capacitors.
  • C1 and C3 are polarized electrolytics: P1 to 5V_EXT, P2 to GND.
  • During PCB layout, use at least 0.5 mm / 20 mil for 5 V and GND, preferably wider for the servo branch and return.
  • Route servo current directly between J1 and J3; avoid sharing the microphone/potentiometer ground path.
Firmware-Relevant Hardware Requirements
  • Arduino-compatible ESP32 firmware.
  • GPIO12 must initialize low before enabling LED channel 1.
  • Servo GPIO13 should remain low/detached until commanded.
  • ADC attenuation should be configured for GPIO34/GPIO35.
Physical Design Expectations
  • Place the DevKit antenna at the board edge with no copper or components under/around its antenna region.
  • Keep J1 and J3 close together to minimize the high-current loop.
  • Keep analog connectors and traces away from the servo power path.
Important Design Decisions
  • Added HC-SR04 ECHO divider because ESP32 GPIO is not 5 V tolerant.
  • Added servo bulk/bypass capacitance and startup pulldown.
  • Retained all user-requested GPIO assignments.
  • Did not add reverse-polarity protection or a fuse to preserve the requested direct 5 V architecture; these remain recommended options.
Assumptions
  • External supply is regulated 5 V.
  • HC-SR04 module has conventional 5 V ECHO behavior.
  • External LEDs are connected anode to header signal and cathode to header GND.
  • Servo accepts a 3.3 V PWM high level.
Change Notes
  • Initial schematic created with safety corrections and documentation.
  • Project Overview

  • Intended Use

  • What the Device Should Do

  • Main Features

  • System Architecture

  • Hardware Subsystems

  • Power

  • Ultrasonic Sensor

  • Servo

  • Analog Inputs

  • LED Outputs

  • Interfaces and Connections

  • Power and Runtime Expectations

  • Power Tree and Power Budget

  • Manufacturing and Assembly Expectations

  • Firmware-Relevant Hardware Requirements

  • Physical Design Expectations

  • Important Design Decisions

  • Assumptions

  • Change Notes