Home

Week 8: Input devices

This week, I used a microphone to control an LED. I experimented with ways to capture sound and use data. This exercise served as a a proof-of-concept for my final project.

I chose to re-use the PCB I had built for Week 6. I used the connections I had designed for the LED matrix of my Halloweend costume. This enabled me to connect the mic analog signal from the mic and digitize it within the SAMD21 chip. Even though it has a few jumper wires, my board is still sturgy and gets the job done.

I chose to use a adafruit MAX 4466 breakout board to capture sound. I made this decision because it includes an analog gain dial and was compatible with the 5V output of my board. To connect it to my board, I soldered connection pins to the breakout board and used jumper cables.



In the future, I might try to build my own breakout board. However, for the moment, this cheap and cheerful solution enabled me to quickly move on to signal processing and coding.


Once the connections were established, it was pretty straightforward to setup the mic as an analog input. I set up the pins and was quickly able to out AnalogRead values from the microphone and to print them in the Arduino Serial Output.

Based on code I found online, I used 2 ways to measure sound. First, I measured the direct output of the mic as the value of the audio waveform. These values oscillated between 600 and 800 Hz. I then used another script to measure the Peak-to-Peak amplitude in volts.


These measurements allowed me to activate the onboard LED based on set volume thresholds. Over the next weeks, I will experiment with signal processing and dititalization of sound. I might switch to a digital mike if it simplifies the deployment of filters. This will help me create triggers within the code for my final project.

This week's assignment was quite simple, but it is a proof of concept for my final project. I plan to spiral with iterations on sound filtering to make sure that I capture the right values from the sound input. My goal is to understand beat, bassline and melody. My idea is to build sound-based triggers that will generate LED-based visuals. Given the presence of libraries online and the community engagement toward LED project, I think that this is possible.


Download the files and build your own!