Gingerbread House

I am prefacing this page by saying that this was all done in about half a Saturday with spare parts I had laying around the workbench.

So how did I end up getting that far gone? I was invited to a gingerbread house building competition and knew that I wanted to electrify the house somehow.  A quick glance at the parts on the work bench lead me to the Electret Microphone Amplifier from Adafruit that I never put to use.  All the wiring was scraps that were laying around, along with all the rest of the hardware.

How to Build it

Parts list: Arduino UNO, protoboard, wires, LED’s, Adafruit’s Microphone Amplifier, 47k ohm resistor, (10) 330 ohm resistors, breakaway header pins, and of course the simple tools like cutters, strippers, and soldering iron.

First, get familiar with how to use the microphone with the information at Adafruit. From there, you are building a clapper.  The signal from the microphone will not be so great on its own.  Here is how it looks on my scope without filtering.

Unfiltered Microphone signal

Unfiltered Microphone signal

I took that signal and added this filter before it came into the Arduino.

Ginger Bread Schematic

Ginger Bread Schematic

That makes it look like this instead.

Filtered Microphone Signal

Filtered Microphone Signal

Obviously, the capacitor and the resistor values can change a lot.  Also, this picture was taken without the resistor in the circuit.  I realized at the end that my scope was actually changing what the signal was doing slightly.  That is why I added the resistor.  At that point I had to stop using the scope and instead use the serial port to debug the signal.  It wasn’t too bad though.  I had searched for some clapper code examples, but decided that it was easy enough to just figure it out on my own, so I wrote my own version from scratch.  Maybe something else that is better is out there somewhere.

So here’s some pictures of the board along the build. First, some prototyping to test it all out.

IMG_20141221_095237

 

Then, scrap protoboard cut to fit with breakaway header pins added.

IMG_20141221_095036

Then I started adding more hardware. You can see the filter and the 330ohm resistors for the LED’s.  These can vary a little bit in size, like most of the hardware here.

IMG_20141221_094946

Finally, added the battery with a switch at the end of the day.  All the wires were twisted to keep them together.  I wish I had some 22 or 24 AWG wire laying around.  The 20 and 18 scraps were just too thick to get into the house the way I wanted.

IMG_20141221_095716

And finally, everything jammed into the house.  And yes, we won 🙂

Gingerbread1

But if you want to get technical, I did spend more than the 45 minutes everyone else had 🙂

Download the code here from my Google Drive

Originally Posted: December 21, 2014

Leave a Reply