Loading files…
This repo contains hardware design files for the BatGizmo Logger PCB, generated in KiCad, including the schematic, PCB layout, and local symbol/footprint libraries for the logger board.
General information can be found in this blog post. The firmware can be found here.
Open the project files in KiCad to see the most recent PCBs.
The BatGizmo Logger is an ultrasonic microphone that can be used for bat monitoring in two ways:
BatGizmo-logger.kicad_pro.BatGizmo-logger.kicad_schBatGizmo-logger.kicad_pcbUse KiCad's built-in exporters as needed:
Generated fabrication/output artifacts are intentionally ignored in git (see .gitignore), so they can be recreated locally per release.
Detailed build instructions with photographs can be found in the WIKI
This project is licensed under the CERN Open Hardware License v2 - Permissive (CERN-OHL-P v2).
See LICENSE.md for the full text.
Copyright (c) 2024-2026 John Mears.
Open the project files in KiCad to see the most recent schematic.
Decoupling capacitors are provided throughout in accordance with manufacturers' recommendations.
Be aware that surface mount ceramic capacitors generally use high dielectric constant dielectrics to achieve their small size. Unfortunately, the materials used are often piezo electric, meaning that such capacitors act as audio transducers: they can generate sound and act as microphones. Sound and vibrations generated by components are transmitted through the PCB to the MEMS microphone component, which picks it up as sound, thus appearing as narrowband noise in spectrograms. To avoid this, ceramic capacitors must be chosen to have a class 1 dielectric such as C0G, or be substituted with tantalum capacitors if appropriate. This is most important for higher value capacitors exposed to widely varying voltages, such as those upstream of power regulators. As a precaution it is wise to use C0G dielectric types for all ceramic capacitors.
The power is derived from either the USB 5V line or the battery holder (if fitted), as selected by the main power switch. Power is divided into two parts: digital and analogue, with separate LDO regulators to minimize the possibility of digital noise finding its way into the analogue circuitry. The four layer PCB dedicates middle layers to GND and power, divided into separate analogue and digital regions. Analogue power is 3V rather than 3.3V as that is the maximum specified by Infineon for the IM73A135 MEMS microphone. As far as possible, care has been taken to avoid shared 0v return paths between analogue and digital circuitry.
Power related components associated with the MCU are as described in the ST white paper. The MCU variant used includes both internal LDO and SMPS regulators, and can be switched between them under firmware control. SMPS is more efficient in terms of power consumption, but may introduce noise. It is therefore only used in auto logger mode where power consumption is important. In other modes the LDO is used. That said, I have seen no difference in noise levels between LDO and SMPS modes. Current consumption is in any case generally low so possibly SMPS mode could be sacrificed, reducing the component count and cost a little.
If the detector is only to be used in active mode (as a USB microphone, not as an unattended logger), the battery holder and power switch need not be fitted, though two pins on latter would need to be connected together on the PCB.
The analogue power LDO can be enabled and disabled by a digital line from the MCU, allowing analogue power to be turned off completely in logger standby mode. Likewise, a high side power switch is used in line with the SD power so that it can also be completely disabled when SD access is not required. Depending on the spec of the SD card actually used, there may or may not be benefit in doing this - another potential simplification opportunity.
A 16 Mhz crystal is provided for the MCU's "high speed external" clock to provide a stable frequency basis for the data sampling rate. I experimented with using the internal nominally 48 Mhz oscillator for this but it is not stable enough.
A low speed external crystal (32.768 kHz) is provided for the real time clock. Unfortunately, it introduces a faint line at 32.768 kHz in spectrogams because of acoustic coupling through the PCB to the MEMS microphone. This is however at a very low level so not a serious problem. It can be reduced somewhat by pushing a blob of blutack on the crystal to dampen its vibrations.
A CR2012 button battery can be provided to maintain the real time clock when the main batteries are removed. This is a convenience that allows the detector to remember the time and date and avoid the need to reset it frequently. A couple of components could be saved by removing this feature.
A push button is provided as a convenience for firmware update. The MCU enters Direct Firmware Update (DFU) mode when it starts up while the BOOT0 pin is high, allowing firmware to be transferred to and fro over USB. A small cost saving could be achieved by omitting this rarely used button, and instead providing two PCB pads to be shorted with a bent paperclip or similar.
The MCU Master Clock Oscillator (MCO) output is driven from the high speed external clock via PLL1 and a divider, providing a 9.6 Mhz clock. Fine frequency control is possible by using PLL1 fractional part. This allows the data sampling rate to be closely synchonized with the host device's USB frame rate under firmware control, avoiding the issue of handling excess and missing samples. The MCO output is connected with a short trace to Timer 2 external trigger which in turn divides it down to a nominal 384 kHz to trigger the ADC. Different sampling rates are achieved by using different divider ratios.
Serial Wire Debugging (SWD) is provided via a four pin molex connector and associated resistors. These components can be omitted unless firmware development and debugging facilities are required.
An SD card holder and associated decoupling capacitors and pullup resistors provide connectivity to the MCU's SDMMC peripheral, allowing data to be read to and written from an SD card. Writing data to SD requires large and spikey currents from the digital power supply, hence the decoupling capacitors close by. Many SD cards contain internal capacitors with class 2 dielectrics and consequently generate audio that can couple via the PCB to the microphone, ultimately appearing as narrowbound noise sychronized with SD data writes. These are both reasons for placing the SD cardon the opposite corner of the PCB from the sensitive analogue circuitry and microphone. It is worth experimenting with different brands and types of SD card to minimize this issue. If SD card access is not required, for example because only basic active mode is required, these components can be omitted.
Three LEDS (red, amber and green) are driven from three MCU digital IO lines under firmware control. Excessively bright LEDs are annoying in the dark and the series resistors should probably be increased further to reduce dazzle and distraction.
The mode switch has three positions which pull one of three MCU GPIO inputs to ground via a 1k resistor against internal pullup resistors. The auto mode position is also connected to PWR_WKUP2 so the MCU can leave standby if the mode is switched away from auto.
Analogue signals are referenced to a mid way voltage reference derived from the analogue power via a passive network and buffered by a low noise op amp. My initial pass at this design used a fancy "low noise" voltage reference chip (MAX6070)for this purpose, but a simple passive network is in fact lower noise and cheaper. You live and learn.
Op amps have been selected with gain-bandwidth products and slew rate limits well in excess of what is required for this circuit, to limit the possibility of signal distortion if limits are approached too closely. The front end op amp that handles the smallest signals is a low noise type, as is the mid way voltage buffer. Testing with a very low distortion sine wave generator at 40 kHz confirms that the analogue path introduces very little distortion, even when operating close to the power rails. The primary source of distortion and noise is actually the MEMS microphone itself, a known limitation of this technology.
The differential signal output from the microphone is amplified by 7.5x and converted to a single ended signal that is filtered by a single pole passive network (~140 kHz). The latter is a nod in the direction of antialias filtering.
That signal provides an input to a programmable gain amplifier (PGA) whose gain is controlled by the MCU under firmware control. The output drives a unity gain buffer and an inverting buffer which provide differential inputs to the MCU ADC. Differential mode reduces common mode noise and results in a better ADC performance according to ST's documentation, confirmed in practice. Those two signals drive the ADC inputs via passive networks including a capacitor very close to the MCU, in line with ST's white paper.
The analogue circuity could be simplified if programmable gain is not required. The differential signals output from the microphone could be directly passed via two op amps to the MCU ADC inputs, preserving differential mode end to end and reducing component count. However, programmable gain is a useful feature.
Higher than standard accuracy components have been used in differential circuitry to maximise the common mode rejection.
No comments yet. Be the first to ask about this board.