ESP32 LED Board Design

Created 4 project docs

Block Diagram

View Document

Block Diagram System Architecture Assemblies
  1. Main controller/power PCB — USB-C PD input, 2S charger/protection/balancing, 5 V LED buck, 3.3 V MCU buck, ESP32-C3, level shifting, LED output, pack connector, debug/programming, and button-cable connector.
  2. Separate six-button PCB — six momentary switches and matching polarized locking ribbon connector. Allocation: six signals, two grounds, and two reserved/ground positions for return-path robustness.
Functional-Block Sourcing Plan
  • USB-C PD sink: reference search required; import exact/close standalone reference if available.
  • Balanced 2S charger: reference search required; import exact/close standalone reference if available.
  • 2S protection/balancing: reference search required; import exact/close standalone...

Project Specification

View Document

Project Specification Project Overview
Status: Draft — schematic phase. A two-PCB BLE LED controller for installation in a non-conductive tube.
Intended Use
Portable battery-powered controller for 100 Adafruit ADA2328 5 V addressable LEDs, operated by six wired buttons and BLE.
What the Device Should Do
  • Drive 100 addressable LEDs while enforcing a 20 W electrical LED-output cap.
  • Provide BLE control with Wi-Fi disabled in firmware.
  • Charge a protected/balanced 2S 18650 pack from a USB-C PD supply.
  • Positively disable LED power and normal operation whenever USB-C is inserted/charging.
  • Read six independent momentary buttons on a separate PCB.
Main Features
ESP32-C3 module; 2S pack protection/balancing; 9 V PD sink; balanced 2S charger; 5 V/4 A LED rail; efficient ...

Firmware Getting Started

View Document

Firmware Getting Started Toolchain
PlatformIO + Arduino-ESP32. platformio.ini:
Final MCU Pin Mapping Compilable Starter (src/main.cpp)
Depending on Arduino-ESP32 release, include `` and omit btStop() if it conflicts with NimBLE startup. The hardware shutdown/charge inhibit must not depend on this firmware.
Startup Sequence
  1. Confirm hardware charge inhibit is inactive.
  2. Initialize serial diagnostics.
  3. Keep Wi-Fi disabled.
  4. Configure buttons and ADC.
  5. Initialize FastLED power limiter before enabling patterns.
  6. Start BLE GATT service and advertising.

Board Bring-Up Plan

View Document

Board Bring-Up Plan Preconditions
Do not install cells until charger, protection, and regulator support circuits have been checked against final datasheets and ERC is clean. Use a current-limited bench supply and thermal camera.
Main Board
  1. Visual inspection: polarity, exposed pads, solder bridges, antenna keepout, connector pin-1 orientation.
  2. Resistance checks: GND-to-pack, GND-to-5 V, and GND-to-3.3 V must not be shorted.
  3. Power protected pack input from 6.0 V at 100 mA limit with LED load disconnected. Pass: no unexpected heating/current-limit entry.
  4. Verify 3.3 V rail within ±3%; verify EN reset behavior and programming access.
  5. Verify ESP32 boot log; flash starter firmware; confirm BLE advertising with Wi-Fi disabled.
The specification and six-button subsystem are complete. I found the first pass left the high-power charging and protection circuitry unfinished, so I’m completing that block now rather than treating an unsafe partial schematic as done.
The requirements, power budget, firmware starter, bring-up plan, six-button board, and most main-controller circuitry are complete. The design now includes full 2S protection, USB-C PD charging, charge-time shutdown, 5 V/4 A LED power, and ESP32-C3 BLE control.
Blocked: a manufacturable 3-wire battery connector must be selected for PACK− / cell midpoint / PACK+, followed by a final capacitor/package audit and ERC cleanup. Please specify a preferred connector family—JST-XH, JST-PH, or direct solder pads—before I finalize the schematic.
Use JST-XH connector
Use JST-PH connector
Use solder pads
U1
U4
U5
J1
J4
U7
J5
J2
U2
R7
Resistance
100Ω
R18
Resistance
5.24kΩ
R5
Resistance
10kΩ
R11
Resistance
100Ω
R20
Resistance
127kΩ
R2
Resistance
10kΩ
R28
Resistance
200kΩ
R13
Resistance
33Ω
R25
Resistance
100kΩ
R6
Resistance
10kΩ
R27
Resistance
10kΩ
R15
Resistance
470Ω
R22
Resistance
40.2kΩ
R3
Resistance
10kΩ
R29
Resistance
100kΩ
R9
Resistance
100Ω
R14
Resistance
470Ω
R24
Resistance
3kΩ
R19
Resistance
30.31kΩ
R30
Resistance
10kΩ
R12
Resistance
100Ω
R23
Resistance
7.68kΩ
R16
Resistance
2kΩ
R32
Resistance
4.7kΩ
R26
Resistance
43.2kΩ
R8
Resistance
100Ω
R31
Resistance
4.7kΩ
R4
Resistance
10kΩ
R33
Resistance
100kΩ
R17
Resistance
6.04kΩ
R21
Resistance
100kΩ
R1
Resistance
10kΩ
R10
Resistance
100Ω
F2
S4
L3
Inductance
2.2µH
C1
Capacitance
100nF
C24
Capacitance
Capacitance
C11
Capacitance
Capacitance
C35
Capacitance
Capacitance
F1
C15
Capacitance
Capacitance
C29
Capacitance
Capacitance
C16
Capacitance
Capacitance
C6
Capacitance
Capacitance
C25
Capacitance
Capacitance
C26
Capacitance
Capacitance
C18
Capacitance
Capacitance
S2
L2
Inductance
4.7µH
C8
Capacitance
Capacitance
S3
C21
Capacitance
Capacitance
C17
Capacitance
Capacitance
C30
Capacitance
Capacitance
C32
Capacitance
Capacitance
C2
Capacitance
100nF
SW1
C12
Capacitance
Capacitance
C19
Capacitance
Capacitance
C31
Capacitance
Capacitance
C10
Capacitance
Capacitance
C13
Capacitance
Capacitance
C27
Capacitance
Capacitance
C33
Capacitance
Capacitance
C20
Capacitance
Capacitance
S1
C9
Capacitance
Capacitance
C3
Capacitance
100nF
C28
Capacitance
Capacitance
C7
Capacitance
Capacitance
C5
Capacitance
Capacitance
S5
C14
Capacitance
Capacitance
C22
Capacitance
Capacitance
L1
Inductance
1µH
C4
Capacitance
Capacitance
C23
Capacitance
Capacitance
C34
Capacitance
Capacitance
U8
Q1
RT1
U3
U6
Q2
J3

Refine this doc
Ask about this doc
Firmware Getting Started
Toolchain
PlatformIO + Arduino-ESP32. platformio.ini:

Ini


[env:esp32-c3-devkitm-1]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino
monitor_speed = 115200
lib_deps = fastled/FastLED@^3.7.0
build_flags = -DARDUINO_USB_CDC_ON_BOOT=1
Final MCU Pin Mapping

Table


GPIOFunctionNotes
0Button 1Active low, external 10 kΩ pull-up + 100 Ω series
1Button 2Active low
3Button 3Active low
4Button 4Active low
5Button 5Active low
6Button 6Active low
7Battery ADCReserved for divided protected-pack voltage
10LED dataThrough AHCT buffer and 33 Ω output damping
18/19USB Serial/JTAGReserved; not used for buttons/LED
2/8/9StrappingReserved; not used for buttons/LED
ENReset/enableExternal pull-up/RC and reset switch required
Compilable Starter (src/main.cpp)

Cpp


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

constexpr uint8_t LED_PIN=10, NUM_LEDS=100;
constexpr uint8_t BTN[6]={0,1,3,4,5,6};
constexpr uint8_t BRIGHTNESS_CAP=85; // 85/255 * 100 * 60mA ≈ 2.0A worst-case RGB white; conservative below 4A electrical limit
constexpr uint32_t DEBOUNCE_MS=25;
CRGB leds[NUM_LEDS];
bool stable[6]={1,1,1,1,1,1}, lastRaw[6]={1,1,1,1,1,1};
uint32_t changedAt[6]={0};

void setup(){
  Serial.begin(115200);
  WiFi.mode(WIFI_OFF); // include WiFi.h if Wi-Fi API is enabled in selected Arduino core
  btStop();            // reset radio state before NimBLE init if supported by core
  for(uint8_t p:BTN) pinMode(p,INPUT); // external pull-ups fitted
  FastLED.addLeds<WS2812B,LED_PIN,GRB>(leds,NUM_LEDS);
  FastLED.setBrightness(BRIGHTNESS_CAP);
  FastLED.setMaxPowerInVoltsAndMilliamps(5,4000); // aggregate 20 W cap
  NimBLEDevice::init("LED-Tube-C3");
  auto *server=NimBLEDevice::createServer();
  auto *svc=server->createService("12345678-1234-1234-1234-1234567890ab");
  svc->createCharacteristic("12345678-1234-1234-1234-1234567890ac",NIMBLE_PROPERTY::READ|NIMBLE_PROPERTY::WRITE)->setValue("ready");
  svc->start(); NimBLEDevice::getAdvertising()->addServiceUUID(svc->getUUID()); NimBLEDevice::startAdvertising();
  fill_solid(leds,NUM_LEDS,CRGB::Black); FastLED.show();
}
void loop(){
  uint32_t now=millis();
  for(int i=0;i<6;i++){
    bool r=digitalRead(BTN[i]);
    if(r!=lastRaw[i]){lastRaw[i]=r;changedAt[i]=now;}
    if((now-changedAt[i])>=DEBOUNCE_MS && stable[i]!=r){stable[i]=r;if(!r){leds[i]=CRGB::White;FastLED.show();}}
  }
  delay(1);
}
Depending on Arduino-ESP32 release, include `` and omit btStop() if it conflicts with NimBLE startup. The hardware shutdown/charge inhibit must not depend on this firmware.
Startup Sequence
  1. Confirm hardware charge inhibit is inactive.
  2. Initialize serial diagnostics.
  3. Keep Wi-Fi disabled.
  4. Configure buttons and ADC.
  5. Initialize FastLED power limiter before enabling patterns.
  6. Start BLE GATT service and advertising.
  • Toolchain

  • Final MCU Pin Mapping

  • Compilable Starter (`src/main.cpp`)

  • Startup Sequence

ESP32-C3 LED Tube Controller

ESP32-C3 LED Tube Controller thumbnail
Two-board ESP32-C3 BLE controller for a 2S-powered, USB-C PD-charged 100-pixel 5 V LED tube with a six-button remote board.

Properties

Properties describe core aspects of the project.

Pricing & Availability

Distributor

Qty 1

Arrow

$12.90–$16.43

Digi-Key

$0.98

HQonline

$5.05

LCSC

$14.11

Mouser

$36.42

TME

$4.77

Verical

$13.94–$20.41

Controls