For my next project, I need to get audio data into the ESP32.
The GitHub repo with the sample code for this video is here: [ Ссылка ]
If you like ESP32 audio videos - I've got a complete set on this playlist: [ Ссылка ]
The ESP32 integrates two 12-bit ADCs - ADC1 has 8 channels and ADC2 has 10 channels.
If you have an I2S microphone (like the INMP441 you may want to watch this follow up video after this one - [ Ссылка ])
ADC2 is used by the Wi-Fi driver. So we can only use ADC2 when not using WiFi. In addition, some of the pins attached to ADC2 are strapping pins so cannot be used freely.
For simple low-frequency sampling, we can use the Arduino analogRead or we can use the Esspressif ADC functions directly (00:38).
If you need very accurate readings from the ADC then you can calibrate your ADC (00:46).
For chips manufactured recently, this may have been done in the factory. For instructions on how to manually calibrate your ADC please check the Espressif documentation here: [ Ссылка ]
There's also a useful set of utilities here: [ Ссылка ]
For audio we should ideally sample at 40KHz - for this, we should use the I2S (Inter-IC Sound) peripheral and DMA (03:40).
I've got two microphones break-out boards - the MAX4466 and the MAX9814 (05:00).
The power supply from the 3v3 line of the ESP32 is pretty noisy making the audio unusable, but we can fix this by filtering the VIN line and using a separate Low Dropout Regulator to generate the power supply for the microphone boards (6:20).
We can also filter out some of the noise by oversampling and then taking an average value as the sample value. I'm using a median filter here in these samples (09:00).
The audio is still not great but should be usable for my next project.
If you found this video useful then please do subscribe - there will be more videos coming!
UPDATE - I've made my own I2S Microphone board for the ESP32 - you can buy it here: [ Ссылка ]
Components:
MAX4466 - [ Ссылка ]
MAX9814 - [ Ссылка ]
ESP32 Dev board: [ Ссылка ]
---
Want to help support the channel? I'm accepting coffee on [ Ссылка ]
ESP32 Audio Input Using I2S and Internal ADC
Теги
esp32 audio recordingesp32 analog inputesp32 analog readesp32 i2s dacesp32 microphoneesp32 i2s adcesp32 adc calibrationesp32 adcanalog to digital converteresp32 projectsmax4466esp32 max4466max9814exp32 max9814esp32 analog digital converteresp32 audio inputmax4466 microphonemax9814 microphoneesp32 micesp32 microphone inputnyquist ratenyquist limitesp32 analogread exampleesp32 analogreadresolutionesp32 analogread arduino