We already have a working recorder which saves wav files to an SD card (CPU already reduced to 80Mhz). Worked great but we need to lower the power consumption (Now: 30mA). I wish to get less than 5mA.
Digital mic (I2S or PDM) and SD card connected to a ESP32
I am pretty sure it is possible to record wav files in light sleep mode. Here is what i have in mind using I2S in the example. But not 100% sure if that works:
- In light sleep mode the I2S interface writes data from the I2S microphone to a buffer (I hope that DMA or any other memory is accessible)
- A timer wakes up the main CPU when the buffer is full which writes the data to the SD card
- I2S and the main CPU can't have access to the same buffer at the same time. So once the timer triggered. I2S starts writing data to a second buffer
- When the first buffer is written to SD card. The CPU will go to sleep again waiting for the next time trigger.
Does that make sense? Is there a better way? Please think about it and let me know your solution before we start working together :)