Audio Codec Breakout - WM8960 Hookup Guide

Pages
Contributors: QCPete, bboyho
Favorited Favorite 0

Example 3: Line Input 1 [or Single Ended Microphone Input ]

Similar to the past two examples, we will pass the line level audio source into the WM8960's line input 1 port. As an alternative, users can also wire up single ended microphones to input 1 instead of using a line level audio source from the TRS connector. The signal will go through the mixers and gain stages of the audio codec. Again, we will be sending the audio to the headphone output.

Hardware Hookup 1

Connect power, I2C, line input 1, and the headphone output as explained earlier. Your circuit should look similar to the circuit diagram below.

alt text

Connect a USB cable into your IoT RedBoard ESP32 and a TRS cable from your audio source (e.g. MP3 player, smartphone, or computer) into the audio connector. Then connect your headphones to the output. For those that are sensitive to sounds, you may want to hear the example output before inserting the headphones into your ears.

Hardware Hookup 2

Input 1 also has the ability to allow single ended microphones to the left and right inputs. As an alternative, you can also connect single ended electret or MEMS microphones to these pins. Connect power, I2C, single ended microphones, and the headphone output as explained earlier. Your circuit should look similar to the circuit diagram below.

alt text

Connect a USB cable into your IoT RedBoard ESP32. Then connect your headphones to the output. For those that are sensitive to sounds, you may want to hear the example output before inserting the headphones into your ears.

Upload Code

From the menu, select the following: File > Examples > SparkFun WM8960 Arduino Library > Example_03_INPUT1. If you have not already, select your Board (in this case the SparkFun ESP32 IoT RedBoard), and associated COM port. Then hit the upload button.

Open the Arduino Serial Monitor and set it to 115200 baud to view the serial output. Then hit the play button on your audio source if you are using a TRS connector. Make sure that the volume from the audio source is turned up. You should hear some music from the headphones. This is basically the same as the previous two examples but now we are using input 1.