Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: Sound Reactivity Question

  1. #1
    Junior Member
    Join Date
    Dec 2018
    Posts
    6

    Sound Reactivity Question

    I'm curious if anyone has any input on this. I am currently working on a sound-reactive project but starting slowly step by step and am stuck on this particular question...

    Do I necessarily need to use an audio shield (https://www.pjrc.com/store/teensy3_audio.html) to do sound reactivity or could I simply use a microphone module and use the library instead?

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,043
    yes - if the module translates correctly to the needed ADC-Voltage-level (1.2V range). The audio-shield is not needed - but i'd use it because more features like line in/out mic-in, headphone-amplifier.. higher quality..

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,979
    A microphone module can indeed by used directly to a ADC pin. No need for the audio shield if you don't need high quality sound.

    Here's a thread about a modification to one of Adafruit's popular mic modules for use with Teensy.

    https://forum.pjrc.com/threads/40468...l=1#post126317

    Sadly, the very best mic module is no longer available. But if you wanted to make it a DIY project, I'd recommend using this design.

    https://www.tindie.com/products/Neut...le-for-teensy/

    Adafruit's mic is a close second if you add the 220 ohm resistor and 100 uF capacitor as I described on that thread.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,979
    Something else to consider is a couple software limitations. The on-chip ADC is limited to only 1 audio channel. That's a great fit for a single mic module, but many times we've had people mistakenly assume the ADC can do stereo. This is purely a software limitation and may change in the future for the chips which actually do have 2 ADCs on-chip.

    The audio input also completely hogs the ADC hardware, so you can use analogRead(). Again, a software limitation that may someday improve for the chips where there are 2 ADCs, but today using a mic or other audio signal with the ADC means giving up any other analog input capability.

    If you really need a knob while using the ADC for audio, the Encoder library is probably the way to go.

  5. #5
    Junior Member
    Join Date
    Dec 2018
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    Something else to consider is a couple software limitations. The on-chip ADC is limited to only 1 audio channel. That's a great fit for a single mic module, but many times we've had people mistakenly assume the ADC can do stereo. This is purely a software limitation and may change in the future for the chips which actually do have 2 ADCs on-chip.

    The audio input also completely hogs the ADC hardware, so you can use analogRead(). Again, a software limitation that may someday improve for the chips where there are 2 ADCs, but today using a mic or other audio signal with the ADC means giving up any other analog input capability.

    If you really need a knob while using the ADC for audio, the Encoder library is probably the way to go.
    Do you perhaps know what kinds of limitations I would run into in regards to using a microphone module to do sound reactivity within a loud environment such as a music festival? I noticed that Ned's modified microphone module is seem to be the perfect piece for the Teensy module and am hopefully going to ask someone much more experienced than I to assist me on remaking the same module as I have no idea how to do that sort of work (but am slowly learning!). Thank you for the two suggestions!

  6. #6
    Junior Member
    Join Date
    Dec 2018
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    Something else to consider is a couple software limitations. The on-chip ADC is limited to only 1 audio channel. That's a great fit for a single mic module, but many times we've had people mistakenly assume the ADC can do stereo. This is purely a software limitation and may change in the future for the chips which actually do have 2 ADCs on-chip.

    The audio input also completely hogs the ADC hardware, so you can use analogRead(). Again, a software limitation that may someday improve for the chips where there are 2 ADCs, but today using a mic or other audio signal with the ADC means giving up any other analog input capability.

    If you really need a knob while using the ADC for audio, the Encoder library is probably the way to go.
    I will most likely ever will need only to use the audio channel to be for the microphone module. But I may run into this issue in the future if I forget but will keep note of the limitation within the software.

  7. #7
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,859
    Have you looked at the i2s microphones that are now available? These microphones provide input in a digital form using the i2s bus (not i2c). The audio shield provides input in this form, but if all you needed was the microphone and not the rest of the audio shield, it might be simpler to use that. Note, I am a software guy, not a hardware or sound guy, so I might be completely off base here.


  8. #8
    Junior Member
    Join Date
    Dec 2018
    Posts
    6
    I was lucky enough to take a look at Neutronned's microphone module and am now waiting and going to be in the process of making my own copy of his module that he once sold. Is there any tips on how to implement this? Please note that my only purpose for sound reactivity is to use a microphone to listen to sound and process it through the software and do reactive effects. I will never need or desire for plugging a sound source input to it. So if that's all I need, an audio adapter will not be necessary and I can freely use the Teensy 3.6 + OctoWS2811 adaptor freely without conflict right?

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,979
    Quote Originally Posted by Jvyy View Post
    So if that's all I need, an audio adapter will not be necessary and I can freely use the Teensy 3.6 + OctoWS2811 adaptor freely without conflict right?
    Yes, confirmed, no conflicts there - as long as you choose one of the pins not consumed by OctoWS2811. In fact, the SpectrumAnalyzer example in OctoWS2811 shows exactly this usage scenario, so maybe open that example to see how it's done. If your sound reactions will involve frequencies, maybe that example can give you a good starting point?

    Modifying Adafruit's microphone is probably simpler. The performance should be on-par with Ned's design if you add the resistor and capacitor to filter the 3.3V power.

    With a large LED project, you want to be sure to connect the mic to AGND and 3.3V at the board and keep those wires and the analog signal away from the massive power of so many LEDs with little PWM controllers built inside. Even though the frequency is much higher than the audio band, without a low-pass filter in the signal path it can get into the ADC and alias into the audio band. Ned's board has a simple filter (R4, R5, C4) which did this function, and if you really need this you could add that to Adafruit's output too.

  10. #10
    Senior Member
    Join Date
    Feb 2017
    Posts
    213
    Quote Originally Posted by MichaelMeissner View Post
    Have you looked at the i2s microphones that are now available? These microphones provide input in a digital form using the i2s bus (not i2c). The audio shield provides input in this form, but if all you needed was the microphone and not the rest of the audio shield, it might be simpler to use that. Note, I am a software guy, not a hardware or sound guy, so I might be completely off base here.

    I'd also go with I2S microphone. There's also this one: https://store.arduino.cc/usa/ics4343...tal-microphone

    I'm not a fan of Adafruit's I2S microphone, read my screed about it here: https://forum.pjrc.com/threads/47010...?highlight=i2s

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •