Another project I'm working on includes an OLED display. I want the display to be off most of the time since they have limited lifespans (< 30, 000 hours). I'd prefer not to need to replace the display after a few years of operation.
So, I'm looking for a simple switch to turn the device on and off and I'm trying to use parts I already have. First I tried a piezo transducer as a "knock sensor" but that didn't seem to work.
Next I found an Adafruit MAX9814 breakout board: simple microphone and amplifier.
SolutionThe MAX9814 is definitely overkill for making an audio switch, but hey, that's what I had lying around.
Hooking up the MAX9814 is super easy if you only hook up GND, VDD and OUT. I played with the 3 attack response (AR) options and the 3 Gain options (3x3 = 9 variants in total) so you don't need to: just leave both these pins floating (default options are fine).
I tried various sounds for throwing my switch: clapping, whistles, words, etc. In my case, I'm happy if any significant noise turns my OLED display on since it will be in the garage which is a fairly quiet environment for the majority of the time.
My demonstration code toggles an LED using a Wemos D1 Mini but it is fairly generic Arduino fare: just find yourself an analog input pin and a GPIO pin on any Ardiuno. I use some delay()s simply because it needs to behave the same way on faster MCUs (faster than the 16MHz Uno for example).
Circuit
Comments