NightJar.Gift
ENSK

NightJar / Electronics

Board v15

A button, a whistle, a sound module.

Fifteen board versions. The button still cuts the power, so nothing runs between presses; since v9 an ESP32-S3 listens through a microphone and lets the bird sing only when you whistle. Since v14 every part is sold in Slovakia and Czechia, and v15 charges while the cell stays connected.

The circuit

Nothing is on until you press, and nothing sings until you whistle.

  • The charger module brings in the cell and, while its cable is in, USB 5 V. D1 and Q2 pick one: on USB the board runs from USB and the cell only charges, so the charger finishes properly; without it, the cell feeds the board. The cable can go in or out at any time.
  • The button sits after the 84 °C thermal fuse F1. While it is held, everything behind it has power; released, nothing does.
  • U3, a LaskaKit XC6220 low-dropout module, turns the cell's 3.4 to 4.2 V into a steady 3.3 V for the ESP32-S3 dev board.
  • The ESP32-S3 powers the MAX9814 microphone from one of its pins (GPIO6) and listens for a steady tone of 0.9 to 3.5 kHz lasting a quarter of a second.
  • On a whistle it switches the microphone off and turns on Q1, an IRLB4030 MOSFET in the DFPlayer Pro's ground: the player gets power and plays the 6-second churr. Afterwards the player is cut and the microphone comes back on. R5 holds Q1 off while the ESP32-S3 boots.
  • C1, 470 µF across the battery, covers the amplifier's current peaks; R1 ∥ R2, 5 Ω, keep the 0.5 W speaker within its rating.

Board 89.4 x 27.9 mm, two layers, the same outline since v4. v15 replaces both v14 (battery) and v14L (USB from the ESP32-S3 board).

Schematic of board v15
Schematic, v15. Battery or USB (D1, Q2) and fuse, button, regulator, ESP32-S3 and microphone, the MOSFET in the player's ground, the 5 Ω resistor pair and the speaker.

Schematic, breadboard, PCB

Three views of version 15.

The boards are generated by scripts and checked by independent ones, not drawn by hand. The breadboard and the schematic are compared net by net, and the PCB copper is compared against the schematic netlist (14 of 14 nets).

Breadboard view of board v15 on a 60-column breadboard
Breadboard. The 60-column breadboard we use, rails only at the bottom. Simulated with the button held and a whistle heard: on the cell 3.68 V on the switched line, on USB 4.64 V with nothing drawn from the cell; 3.30 V for the ESP32-S3 either way.
PCB layout of v15, 89.4 by 27.9 millimetres
PCB, v15. J1 (three wires from the charger), wire pads for Q2, D1 and R8 along the bottom edge, F1, C1, the button in the centre, Q1 laid flat beside the DFPlayer Pro, and wire pads for the ESP32-S3 (J2), the microphone (J3) and the regulator module (U3).
PCB layout of v14, the battery-only board before it
PCB, v14, for comparison. Battery only: two charger wires, no D1, Q2 or R8. Charging with the button held kept the charger from finishing.

Design choices

Seven small decisions behind board v15.

Three keep cheaper parts within their limits. Three let a microcontroller join without changing how the bird behaves when nobody presses it. One lets the cell charge while it stays connected.

C1: 470 µF across the battery

The 503035 cell is rated for 0.25 A maximum discharge, less than the player and amplifier can draw on loud peaks. C1 supplies those peaks so the cell voltage does not dip. It sits on the battery side of the button so a press never dumps a charged capacitor through the switch contacts.

R1 ∥ R2: 5 Ω to the speaker

The amplifier's power is not published. A bridged amplifier on a full cell could put about 1 W into 8 Ω (an estimate), twice the speaker's 0.5 W rating. Two 10 Ω resistors in parallel cap the worst case near 0.38 W, at a cost of about 4 dB of loudness. If the bird is too quiet, one resistor can be bridged.

Charger: 3.3 kΩ PROG resistor

TP4056 modules ship set to 1 A, twice the 500 mAh cell's 1C limit and about 1.3 W of heat inside a closed wooden pocket. Swapping the module's 1.2 kΩ resistor for 3.3 kΩ sets 0.36 A: about 0.7C, a full charge in roughly 1.5 to 2 hours.

Q1: a switch in the player's ground

A microcontroller pin can supply a few tens of milliamps; the player needs 0.1 to 0.15 A. The DFPlayer Pro starts playing as soon as it has power, so a MOSFET in its ground is how the ESP32-S3 says play now. In the ground, 3.3 V on the gate turns it fully on at any battery voltage.

U3: a low-dropout regulator

The ESP32-S3 needs 3.0 to 3.6 V and a full cell gives 4.2 V. The dev board's own regulator sits behind a diode and would starve the chip as the cell runs down; the XC6220 holds 3.3 V down to about 3.4 V.

The microphone runs from a pin

The MAX9814 module has no off switch, but it draws only about 3 mA, so an ESP32-S3 pin powers it. While the churr plays the microphone is off, so the bird does not hear itself, and its gain control starts fresh when it comes back.

D1 + Q2: charge with the cell connected

Before v15 the board hung on the cell. Holding the button while charging made the charger count the board's current as charge current, so it never saw the cell full and held it at 4.2 V. Now a Schottky diode runs the board from USB while a P-channel MOSFET disconnects the cell, which only charges and finishes properly; without USB the MOSFET turns on and the cell takes over. R8 is a low 470 Ω so the change-over takes milliseconds: in the simulation the bird keeps singing when the cable is pulled mid-song.

R_PROGCharge currentFor the 500 mAh cell
1.2 kΩ (as shipped)1.0 A2C, too high
2.4 kΩ0.50 A1C, the cell's maximum
3.3 kΩ (chosen)0.36 A0.7C, about 0.5 W of heat

Fifteen board versions

From 84 x 62 mm to a strip that fits the belly.

Part stock drove three of the four early redesigns. Automated routing plus an independent copper check caught what visual review did not. The outline has not changed since v4.

  1. PCB v1
    v127 Sep · 84.0 x 62.0 mm

    DFPlayer Mini, ATtiny85, AO3401A, 16340 cell. A review found a floating RESET line.

  2. PCB v3
    v327 Sep · 78.1 x 26.7 mm

    Re-laid out as a strip to fit the bird’s belly. Sleep firmware and first Nightjar enclosure.

  3. PCB v4
    v427 Sep · 89.4 x 27.9 mm

    Digispark, DFPlayer Pro and a LiPo with USB charger. The outline that stuck.

  4. PCB v5
    v528 Sep · 89.4 x 27.9 mm

    Bare ATtiny85 and TME parts, with SPICE models for the simulator.

  5. PCB v7
    v73 Oct · 89.4 x 27.9 mm

    No microcontroller. Slovak and Czech shops. Hold the button and the bird sings.

  6. PCB v8
    v85 Oct · 89.4 x 27.9 mm

    v7 plus a 77 °C thermal fuse in the battery line.

  7. PCB v9
    v912 Oct · 89.4 x 27.9 mm

    An ESP32 and a microphone: hold the button and whistle, and only then does the bird sing.

  8. PCB v14
    v1415 Oct · 89.4 x 27.9 mm

    v13 with parts sold in Slovakia and Czechia: an XC6220 regulator module and an 84 °C fuse.

  9. PCB v15
    v1515 Oct · 89.4 x 27.9 mm

    v14 and its USB twin in one: the charger can be plugged in or out at any time while the cell stays connected.

Versions v2, v6 and v10 to v13 are intermediate steps and omitted here. The price fell from about USD 34 plus a programmer (v5), through USD 31.50 (v6), to EUR 17.60 (v7); the whistle adds about EUR 19.30 (v14, ESP32-S3 board included) and charging with the cell connected EUR 1.25 (v15).

Safety

A lithium cell inside wood deserves layers.

The design protects the cell several times over, and says plainly what is still open.

  • Two protection circuits. The cell's own PCB cuts off at 3.0 V; the charger's DW01A at about 2.4 V.
  • Gentle charging. 0.36 A limits heat inside the pocket.
  • Thermal fuse. A one-shot 84 °C fuse (Hadex K368, since v14; v8 to v13 used 77 °C) after the battery and USB supplies opens permanently if the board gets too hot. It reacts to temperature, not current, and does not replace short-circuit protection.
  • Nothing runs between presses. The regulator, the ESP32-S3, the microphone and the player all sit after the button; in the simulation everything is off within 0.2 ms of letting go.
  • Planned: a non-flammable cavity lining (mica or ceramic paper) and silicone wiring. Still open: charging inside the closed wooden body is tracked as an open change request in the project documentation.
  • A swollen, hot or deeply discharged cell should be recycled, never recharged, and never charged unattended.

Verification

Checked by something other than the thing that drew it.

14 of 14 nets

The PCB copper of v15 was checked independently against the schematic, and the breadboard against the schematic, net by net.

14.1 mil

Minimum copper gap on v15, with copper kept 20 mil from the board edge.

Simulated, in every state

Button held or released, listening or playing: the player only sings with the button held and a whistle heard. A patched Fritzing simulator plays the churr while the speaker is driven.

Not yet built. No Gerbers are exported for v15 yet: the plan is to open the file in Fritzing 1.0.8, run the design-rule check and export them before ordering a board. The whistle firmware has not been compiled or run on hardware; boot times are estimates.

Board and enclosure files Parts list