Hi all
I've been investigating the power consumption of the AudioMoth Dev board for my masters and have built a current-sense circuit to look with an oscilloscope. Here's what I'm getting at a 48kHz sample rate during recording. The SD card I'm using is the Samsung Evo Plus.
From what I understand, the large square waves (repeating every 340 ms) are the current drawn to write data to the SD card flash memory, but I can't figure out what the smaller, more frequent peaks are (see zoomed-in photo below). They seem to repeat every 2.7ms (~370Hz), which is too slow for clocking speed, sample rate or power switching and too fast for LED. I'm thinking SD card memory refresh, writing to SRAM , or some other component? Any advice on other features (such as which peaks correspond to the LED) or related information on power consumption would also be much appreciated.
Hi David, The analysis looks great. We measure the energy consumption of AudioMoth boards in a similar way with a Qoitech Otii.
https://www.qoitech.com
The small peaks are the processor waking up at the end of each DMA transfer. The processor transfers 1024 samples from the ADC to a buffer whilst the processor is asleep. When the buffer is full, the DMA transfer automatically switches over to another buffer and the processor wakes up to handle the data. The ADC is sampling at 384kHz and there are 1024 raw ADC samples between each DMA interrupt giving the interval you see of 1024 samples / 384000 samples per second = 2.7 milliseconds. The function in the main.c file which runs at each interrupt is:
inline void AudioMoth_handleDirectMemoryAccessInterrupt(bool isPrimaryBuffer, int16_t **nextBuffer); This function averages and filters the raw ADC samples to generate the requested sample rate and copies the final filtered samples to a circular buffer consisting of 8 x 32KB buffers. The SD card write is triggered when each 32KB buffer is full. This happens every 32 * 1024 bytes / 2 bytes per sample / 48000 samples per second = 341 milliseconds. The number of samples in the DMA transfer depends on the sample rate selected. It is calculated to ensure that the number of samples written to the circular buffer on each DMA transfer is a power of two so each 32KB buffer is filled after an integer number of DMA transfers. The raw DMA sample rate is always 384kHz unless an actual sample rate of 250kHz is selected.
We found the Samsung Evo Plus to be quite energy efficient at high sample rates but quite bad at low sample rates:
https://www.openacousticdevices.info/sd-card-guide
The energy consumption of SD cards varies a lot. The energy calculations in the Config App are based on a 32GB SanDisk Extreme card and some cards will use 3 - 4 times as much energy as this card.
Alex