
Contact Mic Board
jackshisd/EoC-Lab
ESP32-based infant wearable for audio and video data acquisition with SD storage, BLE-triggered recording, and USB mass storage support.

ESP32-based infant wearable for audio and video data acquisition with SD storage, BLE-triggered recording, and USB mass storage support.
EoC Lab is an open-source printed circuit board by jackshisd, from the jackshisd/EoC-Lab repository on GitHub. It is a 4-layer board of 71 × 57.5 mm with 85 parts on 75 nets, routed with 667 tracks and 103 vias.
It is built around the TLV75528PDBV, TP4056-42-ESOP8 and TPS63060DSC, with the AO3401A, OV2640 and SS14 among its other parts. Its parts include 25 resistors, 21 capacitors, 6 connectors, 5 ICs and 4 diodes. It belongs with the audio and music boards and the ESP32 boards of this library.
| Supported Targets | ESP32 | ESP32-P4 | ESP32-S3 |
|---|
WARNING: This project writes audio/video files to the SD card. Back up your data before testing.
Records:
mic_0001.wav, mic_0002.wav, ...CT0001.WAV, CT0002.WAV, ...VID0001.MJP, VID0002.MJP, ...Core features:
Supports SD (SDSC, SDHC, SDXC) cards and eMMC.
0x3C):
-1)This project targets ESP32-S3 and uses an SD card breakout or slot, an I2S mic, an SSD1306 OLED, and an OV2640 camera.
Although it is possible to connect an SD card breakout adapter, keep in mind that connections using breakout cables are often unreliable and have poor signal integrity. You may need to use lower clock frequency when working with SD card breakout adapters.
This project doesn't utilize card detect (CD) and write protect (WP) signals from SD card slot.
On ESP32, SDMMC peripheral is connected to specific GPIO pins using the IO MUX. GPIO pins cannot be customized. Please see the table below for the pin connections.
When using an ESP-WROVER-KIT board, this example runs without any extra modifications required. Only an SD card needs to be inserted into the slot.
| ESP32 pin | SD card pin | Notes |
|---|---|---|
| GPIO14 (MTMS) | CLK | 10k pullup in SD mode |
| GPIO15 (MTDO) | CMD | 10k pullup in SD mode |
| GPIO2 | D0 | 10k pullup in SD mode, pull low to go into download mode (see Note about GPIO2 below!) |
| GPIO4 | D1 | not used in 1-line SD mode; 10k pullup in 4-line SD mode |
| GPIO12 (MTDI) | D2 | not used in 1-line SD mode; 10k pullup in 4-line SD mode (see Note about GPIO12 below!) |
| GPIO13 (MTCK) | D3 | not used in 1-line SD mode, but card's D3 pin must have a 10k pullup |
On ESP32-S3, SDMMC peripheral is connected to GPIO pins using GPIO matrix. This allows arbitrary GPIOs to be used to connect an SD card. In this example, GPIOs can be configured in two ways:
idf.py menuconfig in the project directory and open "SD/MMC Example Configuration" menu.sdmmc_slot_config_t slot_config structure in the example code.The table below lists the default pin assignments.
When using an ESP32-S3-USB-OTG board, this example runs without any extra modifications required. Only an SD card needs to be inserted into the slot.
| ESP32-S3 pin | SD card pin | Notes |
|---|---|---|
| GPIO6 | CLK | 10k pullup |
| GPIO7 | CMD | 10k pullup |
| GPIO5 | D0 | 10k pullup |
| GPIO4 | D1 | 10k pullup |
| GPIO16 | D2 | 10k pullup |
| GPIO15 | D3 | 10k pullup (required even in 1-line mode) |
| ESP32-S3 pin | Mic pin |
|---|---|
| GPIO38 | BCLK/SCK |
| GPIO40 | WS/LRCL |
| GPIO39 | DOUT/SD |
| 3.3V | VCC |
| GND | GND |
SEL/LR on the mic should be tied to 3.3V (right channel), which matches the code.
| ESP32-S3 pin | OLED pin |
|---|---|
| GPIO1 | SDA |
| GPIO2 | SCL |
| 3.3V | VCC |
| GND | GND |
I2C address is 0x3C.
| ESP32-S3 pin | Contact mic board pin |
|---|---|
| GPIO1 | CDATA / I2C SDA |
| GPIO2 | CCLK / I2C SCL |
| GPIO41 | MCLK |
| GPIO42 | ASDOUT / codec data out |
| GPIO43 | SCLK / BCLK |
| GPIO44 | LRCK / WS |
| 3.3V | Codec supply |
| GND | GND |
Current firmware behavior:
codec ok, normal operation begins.This project uses OV2640 over SCCB (I2C). The camera is sensitive to pin choice and initial frames are often corrupted.
Current working pin map (ESP32-S3 custom board):
| ESP32-S3 pin | OV2640 pin | Notes |
|---|---|---|
| GPIO18 | SCCB SDA | Camera I2C data |
| GPIO17 | SCCB SCL | Camera I2C clock |
| GPIO9 | XCLK | External clock (10 MHz) |
| GPIO47 | D0 | Data bit 0 |
| GPIO48 | D1 | Data bit 1 |
| GPIO14 | D2 | Data bit 2 |
| GPIO21 | D3 | Data bit 3 |
| GPIO12 | D4 | Data bit 4 |
| GPIO13 | D5 | Data bit 5 |
| GPIO10 | D6 | Data bit 6 |
| GPIO11 | D7 | Data bit 7 |
| GPIO46 | PCLK | Pixel clock |
| GPIO3 | VSYNC | Frame sync |
| GPIO8 | HREF | Line sync |
PWDN and RESET are tied in hardware (PWDN -> GND, RESET -> 3.3V). In software, they are disabled (set to -1).
What was broken and how it was fixed:
VSYNC and PCLK.
Fix: remove the bridge; camera now initializes and produces frames.SCL and the buzzer both used GPIO2.
Fix: remove all buzzer code so GPIO2 is dedicated to OLED SCL.SEL/LR pin high.VID0001.MJP and BLE timestamped names as MMDDHHMM.MJP / MMDDHHMM.WAV.Playback note: VIDxxxx.MJP is a raw MJPEG stream (not a container). VLC can play it; for QuickTime, convert to AVI/MP4.
Current camera behavior:
10 FPS to reduce camera/SD load and improve stability.The device scans BLE advertisements and uses a UUID-encoded timestamp to name files:
MMDDHHMM.MJPMMDDHHMM.WAVC to stay 8.3-safeIf no valid BLE timestamp is seen, it falls back to the index names:
VID0001.MJPmic_0001.wavCT0001.WAVUUID format (128-bit): 00000000-0000-0000-TT00-YYMMDDHHMMSS
00 00 00 00 00 00 00 00)TT = 01 short press, 02 long pressYYMMDDHHMMSS are BCD digits (base-10 nibbles)MMDDHHMM to stay 8.3-safeCurrent BLE scan behavior:
10 ms / 10 ms (~100%) to 5 ms / 80 ms (~6.25%) to reduce radio and power load while keeping start/stop trigger support during recording.| ESP32-S3 pin | Device |
|---|---|
| GPIO45 | Button (pull-up input) |
On ESP32-P4, Slot 1 of the SDMMC peripheral is connected to GPIO pins using GPIO matrix. This allows arbitrary GPIOs to be used to connect an SD card. In this example, GPIOs can be configured in two ways:
idf.py menuconfig in the project directory and open SD/MMC Example Configuration menu.sdmmc_slot_config_t slot_config structure in the example code.The table below lists the default pin assignments.
| ESP32-P4 pin | SD card pin | Notes |
|---|---|---|
| GPIO43 | CLK | 10k pullup |
| GPIO44 | CMD | 10k pullup |
| GPIO39 | D0 | 10k pullup |
| GPIO40 | D1 | not used in 1-line SD mode; 10k pullup in 4-line mode |
| GPIO41 | D2 | not used in 1-line SD mode; 10k pullup in 4-line mode |
| GPIO42 | D3 | not used in 1-line SD mode, but card's D3 pin must have a 10k pullup |
Default dedicated pins on ESP32-P4 are able to connect to an ultra high-speed SD card (UHS-I) which requires 1.8V switching (instead of the regular 3.3V). This means the user has to provide an external LDO power supply to use them, or to enable and configure an internal LDO via idf.py menuconfig -> SD/MMC Example Configuration -> SD power supply comes from internal LDO IO.
When using different GPIO pins this is not required and SD power supply comes from internal LDO IO setting can be disabled.
By default, this example uses 4 line SD mode, utilizing 6 pins: CLK, CMD, D0 - D3. It is possible to use 1-line mode (CLK, CMD, D0) by changing "SD/MMC bus width" in the example configuration menu (see CONFIG_EXAMPLE_SDMMC_BUS_WIDTH_1).
Note that even if card's D3 line is not connected to the ESP chip, it still has to be pulled up, otherwise the card will go into SPI protocol mode.
GPIO2 pin is used as a bootstrapping pin, and should be low to enter UART download mode. One way to do this is to connect GPIO0 and GPIO2 using a jumper, and then the auto-reset circuit on most development boards will pull GPIO2 low along with GPIO0, when entering download mode.
GPIO12 is used as a bootstrapping pin to select output voltage of an internal regulator which powers the flash chip (VDD_SDIO). This pin has an internal pulldown so if left unconnected it will read low at reset (selecting default 3.3V operation). When adding a pullup to this pin for SD card operation, consider the following:
gpio_pullup_en(GPIO_NUM_12); call. Most SD cards work fine when an internal pullup on GPIO12 line is enabled. Note that if ESP32 experiences a power-on reset while the SD card is sending data, high level on GPIO12 can be latched into the bootstrapping register, and ESP32 will enter a boot loop until external reset with correct GPIO12 level is applied.The following command can be used to program flash voltage selection efuses to 3.3V:
espefuse.py set_flash_voltage 3.3VThis command will burn the XPD_SDIO_TIEH, XPD_SDIO_FORCE, and XPD_SDIO_REG efuses. With all three burned to value 1, the internal VDD_SDIO flash voltage regulator is permanently enabled at 3.3V. See the technical reference manual for more details.
espefuse.py has a --do-not-confirm option if running from an automated flashing script.
See the document about pullup requirements for more details about pullup support and compatibility of modules and development boards.
Build the project and flash it to the board, then run monitor tool to view serial output:
idf.py -p PORT flash monitor(Replace PORT with serial port name.)
(To exit the serial monitor, type Ctrl-].)
The OLED status is more specific than a generic Ready screen:
Recorded Xs at + the standard mic filenameMic file savedMic saved; c failcodec okShort press toggles pause/resume during recording.
If SD mounting fails or is not ready, the OLED shows a warning:
SD init failedSD mount failedSD not readyWhen these appear, re-seat the SD card and try again. Also wait for the
Exposing SD card over USB log before unplugging or copying files.
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
When idle, the SD card is exposed over USB MSC for file access from your computer. During recording, USB MSC is stopped and the SD card is mounted to the application. After recording finishes, USB MSC is restarted and the card is visible again on the host.
Here is an example console output. In this case a 128MB SDSC card was connected, and EXAMPLE_FORMAT_IF_MOUNT_FAILED menuconfig option enabled. Card was unformatted, so the initial mount has failed. Card was then partitioned, formatted, and mounted again.
I (336) example: Initializing SD card
I (336) example: Using SDMMC peripheral
I (420) example: Mounting filesystem
I (538) mic: Waiting for long press
I (1840) button: Recording started
I (1841) mic: Recording started
I (9620) mic: Stop requested
I (9622) mic: Captured 7 sec to /sdcard/mic_0001.wav
I (9660) example: Card unmountedConnecting........_____....._____....._____....._____....._____....._____....._____
A fatal error occurred: Failed to connect to Espressif device: Invalid head of packet (0x34)Disconnect the SD card D0/MISO line from GPIO2 and try uploading again. Read "Note about GPIO2" above.
sdmmc_init_sd_scr: send_scr (1) returned 0x107 errorCheck connections between the card and the ESP32. For example, if you have disconnected GPIO2 to work around the flashing issue, connect it back and reset the ESP32 (using a button on the development board, or by pressing Ctrl-T Ctrl-R in IDF Monitor).
sdmmc_check_scr: send_scr returned 0xffffffff errorConnections between the card and the ESP32 are too long for the frequency used. Try using shorter connections, or try reducing the clock speed of SD interface.
example: Failed to mount filesystem. If you want the card to be formatted, set the EXAMPLE_FORMAT_IF_MOUNT_FAILED menuconfig option.The example will be able to mount only cards formatted using FAT32 filesystem. If the card is formatted as exFAT or some other filesystem, you have an option to format it in the example code. Enable the EXAMPLE_FORMAT_IF_MOUNT_FAILED menuconfig option, then build and flash the example.
If the initialization of the SD card fails, initially follow the above options. If the issue persists, confirm the connection of pullups to the SD pins. To do this, enable the
Debug sd pin connections and pullup strengthoption from menuconfig and rerun the code. This will provide the following result:
**** PIN recovery time ****
PIN 14 CLK 10044 cycles
PIN 15 CMD 10034 cycles
PIN 2 D0 10034 cycles
PIN 4 D1 10034 cycles
PIN 12 D2 10034 cycles
PIN 13 D3 10034 cycles
**** PIN recovery time with weak pullup ****
PIN 14 CLK 100 cycles
PIN 15 CMD 100 cycles
PIN 2 D0 100 cycles
PIN 4 D1 100 cycles
PIN 12 D2 100 cycles
PIN 13 D3 100 cycles
**** PIN voltage levels ****
PIN 14 CLK 0.6V
PIN 15 CMD 0.3V
PIN 2 D0 0.8V
PIN 4 D1 0.6VIn the absence of connected pullups and having the weak pullups enabled, you can assess the pullup connections by comparing PIN recovery time measured in CPU cycles. To check pullup connections, configure the pin as open drain, set it to low state, and count the cpu cycles consumed before returning to high state. If a pullup is connected, the pin will get back to high state after reasonably small cycle count, typically around 50-300 cycles, depending on pullup strength. If no pullup is connected, the PIN stays low and the measurement times out after 10000 cycles.
It will also provide the voltage levels at the corresponding SD pins. By default, this information is provided for ESP32 chip only, and for other chipsets, verify the availability of ADC pins for the respective GPIO using this and configure ADC mapped pins using menuconfig. Then test the voltage levels accordingly.
You can monitor the voltage levels of individual pins using PIN voltage levels and PIN voltage levels with weak pullup. However, if one pin being pulled low and experiencing interference with another pin, you can detect it through PIN cross-talk and PIN cross-talk with weak pullup. In the absence of pullups, voltage levels at each pin should range from 0 to 0.3V. With 10k pullups connected, the voltage will be between 3.1V to 3.3V, contingent on the connection between ADC pins and SD pins, and with weak pullups connected, it can fluctuate between 0.8V to 1.2V, depending on pullup strength.
207d2c1 (Initial commit)
| Qty | Value | Footprint | References |
|---|---|---|---|
| 7 | TestPoint | TestPoint:TestPoint_Pad_1.0x1.0mm | 1V2, A2V8, BATT1, TP6, TP7, TP9, VIN1 |
| 6 | 47k | Resistor_SMD:R_0402_1005Metric | R2, R3, R4, R5, R6, R7 |
| 4 | 0.1uF | Capacitor_SMD:C_0603_1608Metric | C14, C15, C16, C17 |
| 4 | 10k | Resistor_SMD:R_0402_1005Metric | R1, R12, R13, R14 |
| 4 | 1uF | Capacitor_SMD:C_0603_1608Metric | C18, C19, C20, C21 |
| 4 | 22 | Resistor_SMD:R_0402_1005Metric | R9, R10, R23, R28 |
| 4 | MountingHole | MountingHole:MountingHole_2.1mm | H1, H2, H3, H4 |
| 3 | 0.1uF | Capacitor_SMD:C_0402_1005Metric | C1, C3, C8 |
| 3 | 10uF | Capacitor_SMD:C_0603_1608Metric | C4, C5, C6 |
| 3 | 10uF | Capacitor_SMD:C_0402_1005Metric | C2, C7, C10 |
| 3 | 22uF | Capacitor_SMD:C_0805_2012Metric | C11, C12, C13 |
| 3 | SW_Push | Button_Switch_SMD:SW_SPST_TL3342 | BOOT1, RESET1, USER_INPUT1 |
| 3 | TestPoint | Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical | 3V3, GND1, TP3 |
| 2 | 0 | Resistor_SMD:R_0402_1005Metric | R15, R27 |
| 2 | 100k | Resistor_SMD:R_0402_1005Metric | R18, R24 |
| 2 | 4.7k | Resistor_SMD:R_0402_1005Metric | R11, R17 |
| 2 | 5.1k | Resistor_SMD:R_0402_1005Metric | R21, R22 |
| 2 | LED | LED_SMD:LED_0603_1608Metric | D2, D3 |
| 1 | 10pF | Capacitor_SMD:C_0402_1005Metric | C9 |
| 1 | 1M | Resistor_SMD:R_0402_1005Metric | R19 |
| 1 | 1uH | Inductor_SMD:L_Bourns-SRN4018 | L1 |
| 1 | 4.7K | Resistor_SMD:R_0402_1005Metric | R26 |
| 1 | 560k | Resistor_SMD:R_0402_1005Metric | R16 |
| 1 | AO3401A | Package_TO_SOT_SMD:SOT-23 | Q1 |
| 1 | AP2112K-1.2 | Package_TO_SOT_SMD:SOT-23-5 | U6 |
| 1 | Battery_Cell | Connector_JST:JST_PH_S2B-PH-K_1x02_P2.00mm_Horizontal | BT1 |
| 1 | Conn_01x09_Socket | Connector_JST:JST_GH_SM09B-GHS-TB_1x09-1MP_P1.25mm_Horizontal | J3 |
| 1 | ESP32-S3-WROOM-2 | RF_Module:ESP32-S3-WROOM-2 | U1 |
| 1 | FerriteBead | Resistor_SMD:R_0603_1608Metric | 600Ω@100MHz1 |
| 1 | Fuse | Fuse:Fuse_1206_3216Metric | F1 |
| 1 | LED | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | D1 |
| 1 | MIC 1 Connector | Connector_JST:JST_GH_SM06B-GHS-TB_1x06-1MP_P1.25mm_Horizontal | J4 |
| 1 | MIC 2 Connector | Connector_JST:JST_GH_SM06B-GHS-TB_1x06-1MP_P1.25mm_Horizontal | J5 |
| 1 | Micro_SD_Card_Det1 | Connector_Card:microSD_HC_Molex_104031-0811 | J1 |
| 1 | OLED | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J7 |
| 1 | OV2640 | OV2640:OV2640 | CAM1 |
| 1 | SS14 | Diode_SMD:D_SMA | D5 |
| 1 | SW_SPST | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | SW1 |
| 1 | TLV75528PDBV | Package_TO_SOT_SMD:SOT-23-5 | U4 |
| 1 | TP4056-42-ESOP8 | Package_SO:SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.41x3.3mm_ThermalVias | U3 |
| 1 | TPS63060 | Package_SON:Texas_S-PWSON-N10_ThermalVias | U2 |
| 1 | USB_C_Receptacle_USB2.0_16P | Connector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12 | J6 |
It measures 71 × 57.5 mm and has 4 copper layers, 1.6 mm thick.
85 parts, built around the TLV75528PDBV, TP4056-42-ESOP8, TPS63060DSC and AO3401A. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the jackshisd/EoC-Lab repository on GitHub, at the commit this page was made from: the board is Hardware/Main Board/Main Board.kicad_pcb and its schematic Hardware/Contact Mic Board/Contact Mic Board.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask jackshisd before reusing the design.

jackshisd/EoC-Lab
ESP32-based infant wearable for audio and video data acquisition with SD storage, BLE-triggered recording, and USB mass storage support.

jackshisd/EoC-Lab
ESP32-based infant wearable for audio and video data acquisition with SD storage, BLE-triggered recording, and USB mass storage support.

jackshisd/EoC-Lab
ESP32-based infant wearable for audio and video data acquisition with SD storage, BLE-triggered recording, and USB mass storage support.



SINRG-Lab/Drakon_AIGlasses
Hardware, firmware, and 3D models for the Drakon AI smart glasses.

ApoapsisHGV/CanSat2019-electronics
Circuit and PCB design files related to our 2019 CanSat competition



KaliAssistant/Fox-Jack
Portable social-engineering LAN tool for automated payloads and wired audits — based on Luckfox Pico Max

cajunpanda/bluetooth-nes-advantage
A bluetooth mod for the NES Advantage classic controller.