Skip to main content

KNIFE-016 – v15FULL: charge while the cell stays connected, plus the v14 review

danger

Problematic breadboard and PCB design - Not ready nor used, proper dedicated breadboard KNIFEs are KNIFE-018 and onwards.

📅 2026-10-15 · stav: hotové · priorita: vysoká · ✍️ Ondrej Špánik

v15FULL = v14 (battery) and v14L (USB) in one board.

  • The TP4056 charger's micro-USB cable can be plugged in or pulled out at any time, also while the bird sings.
  • The cell stays wired to the board. It charges whenever USB is present, and the charge ends properly (over-charge protected).
  • With USB the bird runs from USB; without it, from the cell.
  • Everything after the button (XC6220, ESP32-S3, MAX9814, DFPlayer Pro, Q1) is v14's.

Why v14 could not do it. In v14 the board hangs directly on the charger module's OUT+ / OUT-, so the board and the cell share one node:

  • Holding the button while charging adds the board's 0.1-0.25 A to what the TP4056 measures as charge current.
  • So it never reaches its end-of-charge current (C/10 = 36 mA) and keeps the cell at 4.2 V for as long as the cable is in.
  • Above 0.36 A the cell would even discharge while "charging".

v14L avoided the cell completely.

The fix: load sharing ("power path"), three parts for EUR 1.25 at techfun.sk:

RefPartPrice (2026-10-15)Job
D11N5819 Schottky diode (10 pcs)EUR 0.20USB present → the board runs from USB through D1 (≈ 0.3 V drop)
Q2NDP6020P P-channel MOSFET, logic levelEUR 0.80drain to the cell, source to the board, gate to USB 5 V: USB present → off, the cell only charges; USB absent → on, the cell feeds the board; its body diode blocks USB from the cell
R8470 Ω resistorEUR 0.25pulls Q2's gate low when the cable is out

Wiring changes:

  • J1 gets a third wire: the module's IN+ (the micro-USB's 5 V).
  • Leave the module's IN- unconnected. Tied to the board's ground it would bypass the module's DW01A / FS8205A protection switch.
  • F1 (84 °C) moves after the point where USB and the cell meet, so it protects the board on either supply.
  • Not needed: v14L's EN divider (R6 / R7). The ESP32-S3 is fed only from U3 after the button, so it is off whenever the button is up.

Over-charge protection: three independent layers.

  • The TP4056 regulates to 4.2 V ±1%. Because it now sees only its own current, it stops at C/10 and restarts only under about 4.05 V.
  • The module's DW01A opens at about 4.3 V.
  • The cell's own protection PCB.

Simulation (ngspice, every state):

StateVSYSVSW3V3from the cellfrom USB
cell only, held, playing3.68 V3.68 V3.30 V0.211 A–
cell only, held, listening3.69 V3.69 V3.30 V0.100 A–
cell only, released3.70 V0 V0 V0–
USB, held, playing4.64 V4.64 V3.30 V00.251 A
USB, held, listening4.70 V4.70 V3.30 V00.111 A
USB, released4.97 V0 V0 V00.011 A

Pulling the cable mid-song. The charger module's input capacitor (assumed 10 µF) keeps Q2's gate high until it has discharged through R8. Until then the board runs through Q2's body diode, about 0.8 V under the cell.

R810k1k680 Ω470 Ω330 Ω
lowest VSW after the cable is pulled2.92 V (the player resets)2.94 V3.09 V3.52 V3.66 V

So R8 is 470 Ω. It costs 10 mA from USB while the cable is in, and nothing from the cell.

Checks:

  • breadboard nets = schematic;
  • PCB 14 / 14 nets;
  • minimum copper gap 14.1 mil, 20 mil to the edge;
  • same 89.4 x 27.9 mm outline, so it drops into the Nightjar board bay;
  • no Gerbers yet.

Layout:

  • Q2 (TO-220) does not fit on the board. Like the XC6220 it becomes three wire pads (G, D, S) in the top-left corner and sits next to the charger module.
  • D1 and R8 lie along the bottom edge.
  • J1 has three pads: IN+, OUT+, OUT-.

Details: docs/v15FULL_parts.md in ST-017-MOTHERBOARD; LELEK_board_v15FULL.fzz; .fzzbuild/build_v15FULL.py, variant_v15FULL.py, simcheck_v15FULL.py.

v15FULL breadboard

v15FULL breadboard: the TP4056 module with three wires (OUT-, OUT+, IN+), Q2 NDP6020P standing in row A, D1 1N5819 and R8 470R in strips 1-9, F1 in row H

v15FULL schematic

v15FULL schematic: J1 (LiPo + TP4056: OUT-, OUT+, IN+), D1 and Q2 load sharing, R8 gate pull-down, F1 after both supplies, then v14's button, XC6220, ESP32-S3, MAX9814, DFPlayer Pro and Q1

v15FULL PCB (Fritzing's own view, then both copper layers from pcbcheck.py)

v15FULL PCB, 89.4 x 27.9 mm: J1 three pads on the left edge, Q2 wire pads top left, D1 and R8 along the bottom edge

v15FULL PCB, top and bottom copper

The v14 review, applied​

The review of v14 found nothing that blocks the architecture, and raised five points:

1. ADC with 12 dB attenuation on GPIO4 / ADC1_CH3. Agreed. The MAX9814's output idles at 1.25 V with up to 2 V p-p on top, so it would clip in the 0 / 2.5 / 6 dB ranges; 12 dB covers about 0-3.1 V. Nothing on the board changes: MIC still goes to GPIO4.

2. 16 kHz sampling for the neural detector. Agreed. The board doesn't limit the rate: the MAX9814's output reaches GPIO4 directly, with nothing in between to filter it. The whistle firmware, 16 kHz acquisition included, is written by hand by a colleague.

How the detection works, as far as the board needs to know: the trained CNN becomes a matrix. The spectrogram of the microphone signal is compared against that matrix to decide whether a whistle was heard.

3. Keep the GPIO6 microphone power control. Kept. The MAX9814's VDD still comes from MICPWR (GPIO6), so the firmware can switch it off while the churr plays. That also resets its AGC before it listens again.

4. No UART to the DFPlayer, known track durations. Agreed. Q1 switches the player's ground, so a UART line from the powered ESP32-S3 would feed the unpowered player through its RX pin (phantom powering), as noted in KNIFE-015. The board keeps no signal line between the ESP32-S3 and the player; the firmware uses known track durations (the churr is 6.0 s, plus the player's boot time, not measured yet).

5. Measure the 3.3 V rail during playback with a nearly empty cell. Agreed; it is in the "to measure" list. The simulation, cell only, held and playing:

Cell (open circuit)3.6 V3.5 V3.4 V3.3 V
VSW3.58 V3.48 V3.38 V3.28 V
3V33.30 V3.30 V3.30 V3.23 V
cell current0.208 A0.205 A0.202 A0.197 A

These are model figures, and the 0.21 A is close to the GeB 503035's 0.25 A rating. On the bench:

  • scope (or a meter's min / max) on U3's output during the churr, cell at 3.4-3.5 V, no USB;
  • the ESP32-S3 needs at least 3.0 V, and its brown-out resets it under about 2.7 V.

New in v15FULL: with USB plugged in, the cell carries no load at all, which takes the 0.25 A question off the table whenever the bird is used on the cable.

Things to know​

  • USB supply: about 0.36 A charging + 0.25 A playing = 0.6 A. Use a 1 A charger; a PC port (0.5 A) is marginal.
  • Speaker on USB: VSW is 4.6-4.7 V instead of 3.7-4.2 V. With R1 ∥ R2 (5 Ω) the worst case rises from about 0.38 W to about 0.48 W, still under the speaker's 0.5 W, and about 0.52 W only with a 5.25 V supply.
  • Deeply discharged cell: while its protection is open, the board has no ground return. Leave the cable in for a few minutes until the TP4056 has charged the cell back.
  • The ESP32-S3's own USB (flashing, serial monitor): its regulator then powers the ESP32-S3 regardless of the button. Fine on the bench; in the finished bird that USB stays unplugged.
  • Enclosure: Nightjar v2 now has pockets for both parts that live off the board on wires (enclosure/NIGHTJAR_V2_GUIDE.md, NIGHTJAR_VARIANT=v15):
    • Q2 lies flat under the charger, and a slot takes its wires up past the charger to the board's J1 end.
    • The XC6220 module stands on edge in the chest, ahead of the ESP32-S3 bay, and a slot takes its wires into the lead well under the board.
    • Thinnest walls are 5.9 mm (Q2) and 10.9 mm (U3), with no part clashes. Three dowels moved.
    • Nothing has been test-fitted yet.
  • To order on top of v14: EUR 1.25 at techfun.sk (already in the v14 order, so no extra shipping). The whole board comes to about EUR 38.15.

← KNIFE-015 · ↩️ Všetky KNIFE príspevky · KNIFE-017 →