Use photo resistors to play sounds such that, when a photo resistor is covered, a sound plays once, and when multiple resistors are covered a different sound loops.
The design:
Our original idea last week was to use two arduino boards linked together, one connected to all of the photo resistors and the other connected to the wave shield. We thought that we would need two arduinos because it was our understanding that the wave sheild would occupy all but 3 or 4 of the pins on the arduino. To our delight, the wave shield actually left us with access to 10 analog pins, and because of this we only needed one arduino board to accomplish our task.
The Prototype:
Wave Shield
We first had to build the wave shield. This was mostly done by Anna. The construction went smoothly without any soldering mistakes. After the wave shield was constructed, we attached it to the arduino and soldered it into place. With the wave shield firmly attached to the arduino we had to find an SD card that we could use with the card. The SD card ended up being one of the more problematic aspects of the prototype, and we were confused as to why one was not included with the technology kit. Luckily one of our team members had a mircoSD card and adapter (to regular SD size) that we could load wav files onto. The SD card had to be formatted to FAT16, which required a bit of a work around on a mac (View complete process here). With a properly formatted Card, we were able to run the example arduino code and hear our audio files through the wave shield!
Photo Resistors
Our next task was to construct a circuit with a photo resistor that we could use to call the play() function on the wave shield. It took us some time to remember how to correctly organize all of the resistors and photocells and wires, but eventually we created a working circuit. From there we began to add conditional statements such that if the photocell circuit was being covered, it would play a sound. We were able to successfully connect the photocell to the play() function in the wave shield, and we then began to adapt the example wave shield code to play specific files from the SD card when a specific photocell was covered.
Problems
SD Card - We didn't have one in our Tech kit.
Our SD adapter frequently gives us the error that the card failed to initialize, we believe this is just a hardware error, because if we simply redeploy it will work.
Wires
Because the Wave shield has slots for wires to be soldered in place, it was fairly annoying to try and test with unsoldered wires. They kept popping out of their slots, and sometimes the connection was not reliable.
Headphones
We discovered that the original headphones we were using were broken, and had to switch to using earbuds.
The Working Prototype
No comments:
Post a Comment