LED Blinking Circuit Design

Thanks — I’ll rerun routing now that the paused job is cleared. I’ll keep the existing 3.0 mm high-power width rules in force and preserve the R14 single-point AGND/PGND bridge at the ESP32 ground header.
Routing could not complete because the auto-route job paused due to insufficient credits.
Completed so far:
  • Schematic was created and ERC-cleaned.
  • PCB size set to exactly 100 mm × 140 mm.
  • Stackup set to 4 layers.
  • Missing resistor footprints resolved.
  • High-power nets were assigned 3.0 mm width rules.
  • Signal nets were assigned 0.254 mm width rules.
  • Components were placed into the requested three-zone floorplan.
  • R14 was added and placed as a 0Ω AGND-to-PGND star-ground link at the ESP32 ground header area.
  • Pre-routing dangling-trace check was clean.
Remaining:
  • Add credits, then resume/rerun routing job.
  • After routing: review airwires, overlaps, dangling traces, invalid layers, and verify the AGND/PGND star-point implementation physically routes only through R14.
Check partial routing
Verify width rules
Inspect R14 placement
Run layout DRC

Refine this doc
Ask about this doc
Firmware Getting Started - ESP32 18650 SOH Analyzer
Board/Framework
Target board: ESP32 DevKit V1 30-pin module on two 15-pin female headers. Recommended firmware stack: PlatformIO + Arduino framework.

Ini


[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps =
  adafruit/Adafruit BusIO
  adafruit/Adafruit INA219
  adafruit/Adafruit ADS1X15
  adafruit/Adafruit SSD1306
  adafruit/Adafruit GFX Library
  milesburton/DallasTemperature
  paulstoffregen/OneWire
ESP32 Pin Map

Table


FunctionESP32 GPIOSchematic netConnected hardware
Discharge MOSFET gateGPIO13ESP_D13_DISCH_GATE_DRV -> Q1_GATER1 100 ohm -> Q1 gate, R3 10k pulldown
Fan MOSFET gateGPIO14ESP_D14_FAN_GATE_DRV -> Q2_GATER2 100 ohm -> Q2 gate, R4 10k pulldown
I2C SDAGPIO21I2C_SDAINA219, ADS1115, OLED, R5 4.7k pullup
I2C SCLGPIO22I2C_SCLINA219, ADS1115, OLED, R6 4.7k pullup
DS18B20 One-WireGPIO27ONEWIRE_DQDS18B20 data, R7 4.7k pullup
Button 1GPIO25BTN_D25SW1 active-low to PGND
Button 2GPIO26BTN_D26SW2 active-low to PGND
Button 3GPIO32BTN_D32SW3 active-low to PGND
Green LED 1GPIO33LED_GREEN1_D33R8 330 ohm -> D2
Green LED 2GPIO4LED_GREEN2_D4R9 330 ohm -> D3
Yellow LED 1GPIO2LED_YELLOW1_D2R10 330 ohm -> D4
Yellow LED 2GPIO15LED_YELLOW2_D15R11 330 ohm -> D5
Red LED 1GPIO18LED_RED1_D18R12 330 ohm -> D6
Red LED 2GPIO19LED_RED2_D19R13 330 ohm -> D7
Notes: GPIO2 and GPIO15 are ESP32 boot-strapping pins; keep LED loads light and avoid external circuits that force the wrong boot level. GPIO13 and GPIO14 drive MOSFET gates through 100 ohm resistors and have 10k pulldowns so discharge/fan remain off during boot.
Minimal Arduino Bring-Up Skeleton

Cpp


#include <Wire.h>
#include <Adafruit_INA219.h>
#include <Adafruit_ADS1X15.h>
#include <Adafruit_SSD1306.h>
#include <OneWire.h>
#include <DallasTemperature.h>

constexpr int PIN_DISCHARGE = 13;
constexpr int PIN_FAN = 14;
constexpr int PIN_ONEWIRE = 27;
constexpr int PIN_BTN1 = 25;
constexpr int PIN_BTN2 = 26;
constexpr int PIN_BTN3 = 32;
constexpr int PIN_LED_G1 = 33;
constexpr int PIN_LED_G2 = 4;
constexpr int PIN_LED_Y1 = 2;
constexpr int PIN_LED_Y2 = 15;
constexpr int PIN_LED_R1 = 18;
constexpr int PIN_LED_R2 = 19;
constexpr int I2C_SDA = 21;
constexpr int I2C_SCL = 22;

Adafruit_INA219 ina219;
Adafruit_ADS1115 ads;
Adafruit_SSD1306 display(128, 64, &Wire, -1);
OneWire oneWire(PIN_ONEWIRE);
DallasTemperature ds18b20(&oneWire);

void setOutputsSafe() {
  digitalWrite(PIN_DISCHARGE, LOW);
  digitalWrite(PIN_FAN, LOW);
  digitalWrite(PIN_LED_G1, LOW);
  digitalWrite(PIN_LED_G2, LOW);
  digitalWrite(PIN_LED_Y1, LOW);
  digitalWrite(PIN_LED_Y2, LOW);
  digitalWrite(PIN_LED_R1, LOW);
  digitalWrite(PIN_LED_R2, LOW);
}

void setup() {
  pinMode(PIN_DISCHARGE, OUTPUT);
  pinMode(PIN_FAN, OUTPUT);
  pinMode(PIN_LED_G1, OUTPUT);
  pinMode(PIN_LED_G2, OUTPUT);
  pinMode(PIN_LED_Y1, OUTPUT);
  pinMode(PIN_LED_Y2, OUTPUT);
  pinMode(PIN_LED_R1, OUTPUT);
  pinMode(PIN_LED_R2, OUTPUT);
  setOutputsSafe();

  pinMode(PIN_BTN1, INPUT_PULLUP);
  pinMode(PIN_BTN2, INPUT_PULLUP);
  pinMode(PIN_BTN3, INPUT_PULLUP);

  Serial.begin(115200);
  Wire.begin(I2C_SDA, I2C_SCL);
  ina219.begin();
  ads.begin();
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  ds18b20.begin();
}

void loop() {
  ds18b20.requestTemperatures();
  float tempC = ds18b20.getTempCByIndex(0);
  float busV = ina219.getBusVoltage_V();
  float currentmA = ina219.getCurrent_mA();
  int16_t a0 = ads.readADC_SingleEnded(0);

  bool startPressed = !digitalRead(PIN_BTN1);
  digitalWrite(PIN_DISCHARGE, startPressed ? HIGH : LOW);
  digitalWrite(PIN_FAN, tempC > 40.0 ? HIGH : LOW);

  Serial.printf("T=%.2f C, INA V=%.3f V, I=%.1f mA, ADS A0=%d\n", tempC, busV, currentmA, a0);
  delay(1000);
}
Bring-Up Order
  1. Power board from 9-12 V DC jack with no 18650 connected.
  2. Verify ESP32 boots and 3.3 V rail is stable.
  3. Scan I2C bus for INA219, ADS1115, and OLED addresses.
  4. Read DS18B20 temperature.
  5. Test fan MOSFET first with a current-limited fan supply.
  6. Test discharge MOSFET last with a current-limited bench setup before connecting a real 18650.
  • Board/Framework

  • ESP32 Pin Map

  • Minimal Arduino Bring-Up Skeleton

  • Bring-Up Order

Assets

Assets are files uploaded to this project which can be used in various ways.

Single-Slot 18650 SOH Analyzer Prototype thumbnail
100 mm x 140 mm ESP32-based 18650 battery state-of-health analyzer prototyping board with active MOSFET discharge switching, current/voltage measurement, OLED UI, DS18B20 temperature input, and fan control.

Properties

Properties describe core aspects of the project.

Pricing & Availability

Distributor

Qty 1

Arrow

$5.96–$16.04

Digi-Key

$9.93–$16.84

HQonline

$3.86–$3.91

LCSC

$7.03–$8.84

Mouser

$12.30–$19.51

TME

$5.07

Verical

$5.93–$12.03

Controls