Beep Boop
Home.:.:.The Remix.:.:.Neighborbot.:.:.Chimes.:.:.ActLab.:.:.Links


>
Neighborbot

Before I introduce you to neighborbot, it is necessary that you understand the neighbor game. My roommates and I found it necessary to devise a means of distributing shared goods among the household. To be simple, if you have an extra slice of cake, who do you share it with?

We found a fun solution in the neighbor game. Suppose Johnny has a slice of cake he wishes to share with the household, but would like to give everyone within earshot the same opportunity to eat it. He can shout "neighbor," and the first person to respond with "neighbor" receives the cake. Since its inception, the neighbor game has had many stipulations tacked onto it to deal with corner cases, but these are the essential details.

The idea to make the neighborbot came suddenly and with the purchase of a microcontroller. I had a mission - I would program the controller to sample and recognize the sound of the word "neighbor" and respond for me. All those missed slices of cake due to slow reaction time tormented me so, and finally the solution was within arms reach!

The Internals | The original concept was to interface both an electret microphone and a small 8-ohm speaker to the microcontroller - a 16 MHz arduino nano board. Interrupts would fire periodically on the board, sampling the electret mic and passing it through a filter cascade weighted properly to detect the spoken word "heighbor." The hardware design could be minimal, and could simply run off of USB power passively on a table somewhere in the house.

Making Sound | Trying to minimize the debugging complexity of the system, I started with the element most essential to the system - making sound. I spent a few days researching amplifier circuits, and then got to work configuring an LM386 analogue. After some considerable adjusting (and an irritating problem with the PWN ports on the arduino), I had neighborbot faithfully replaying 8-bit mono clips sampled at around 8 kHz. For those technically savvy and curious, I have sketched the schematic.
The electret microphone was problematic. I found several preamplifiers for which I either had parts for or could locate parts for locally, but had very little success achieving a usable signal. Pictured here are two of the amplifier configurations I attempted. One is a dual-transistor amp, and the other uses a 2n2222 transistor coupled with a dc-blocking lowpass filter. While I never had a chance to test any of these configurations with an oscilloscope, I am suspicious that the amplifier gain was too low to provide the ADC with any visible variation in signal.


The Ghost in the Machine
Disillusioned and out of ideas, I turned my attention towards the speech recognition algorithm. Almost immediately after digging out old notes on eigenspace reduction, I realized that I'd need to upload a training set of audio samples to the board in order to use my original algorithm - something the arduino nano most certainly doesn't have space for. A single 1-second 8-bit mono sound sampled at 8kHz consumed almost all the available memory on the board. I needed a new solution.

One simplification that I felt was acceptable and still fit the hack came to me - have the neighborbot passively listen for frequencies that fall into the human speech range and repeat anything that meets the basic frequency criteria for human speech. This could be done with a circular buffer and a fast fourier transform with no training set at all. Still, I had come up with no solution to my problem with microphone input...



The Resolution
Out of time and ideas, I was finally able to step back and realize how entirely I had missed the point of the neighbor game. Suddenly I felt strange for trying to cheat a game built upon fellowship and charity. Certainly it was a hack, but it illuminated to myself a part of my competitive nature I hadn't known before. It was in this way that my hack hacked me, bypassing completely my original intentions with strategic failures. I felt humbled by this simple piece of technology that had sprung forth from my handiwork.

To give it finality, I equipped neighborbot with a single LED and a single pushbutton which would cause it to parrot the word "neighbor." In this way, the robot that I originally intended to use for personal gain refused to participate in greed and instead provided me with a new means of initiating the neighbor game. I left it in this state as a monument to my own desire for more stuff that it might remind me to always share with my fellow man.