Introduction: Making a "Singing Bass" (but Without the Fish)
These instructions are to create a box with a light sensor and buzzer that will play a single-note-at-a-time tune when a shadow is cast across it...such as from a passer by. This is done using an Arduino.
Step 1: Gather the Materials
You should be able to find most of this at radio shack, arbitrary electronic parts store, arbitrary tool stores, and/or walmart.
The 6.4Mohm resistor should probably be changed depending on your photoresistor. Choose a resistor about halfway between the usual light and dark values of your photoresistor.
*5" x 2.5" x 2" project box with metal insert. (like from radio shack)
*9V battery clip
* a radioshack piezolectric buzzer (no internal oscilator)
* 1x3 and 1x6 bits of pin header (http://en.wikipedia.org/wiki/Pin_header)
* 9V battery
* photoresistor (from radio shack, came in a variety pack)
* single pole double throw bat style switch (used and single pole single throw) (as in picture)
* resistors: 112ohm, 6.4Mohm.
* diode (1N4002) (may substitute some other power diode)
* stranded wire
* shrink tubing for just-in-case insulation since the parts are just freely connected.
* 2 sets of #2 machine screw and nut. 1/2" long.
* soldering iron and solder
* drill and assorted bits
* super glue
* a bit of pillow stuffing or something.
Step 2: The Wiring
Solder the circuit in the diagram to the pieces of pin header so you have connectors to your arduino board to this project. I am using the arduino uno and I was able to use a 3x1 header and a 6x1 header to get the job done.
You should be able to solder wire to wire when needed, and on parts that will be close (such as the leads coming out of the photoresistor) cover them with shrink tubing after soldering.
!!Remember to thread the shrink tubing on before closing off that part of the circuit!!
You will want to give extra wire to the photoresistor since it needs to be mounted in the top of the case and will want a little extra room to work with.
Step 3: Preparing the Box
You need to drill holes the aluminium mounting plate and the plastic top.
In the mounting plate you need a hole on one end for the switch to mount to (assuming the type of switch pictured) this should be the same size as the threaded shaft on the switch (in my case ~6mm) one in the other end for the plastic tube to hold the photoresistor. (mine was an old pen tube, which was ~8mm OD). A large one in the middle to let sound out of the piezoelectric buzzer (a vague "large" will do for size) and the two mounting holes to attach the buzzer. Measure these by placing the buzzer on the plate where you want it, and carefully holding it still use a pencil to color in the metal through the mounting holes.
The plastic top should have a slot long enough to allow the bat of the switch to swing with just enough room so it doesn't hit the edges. The speaker just needs a "speaker grill" of sorts, and i used a few little holes. The sensor tube just needs a tight fitting hole to fit into where it will later on be glued into place. Try to get it as snug a fit as possible.
Step 4: Putting It All Together
The speaker should be mounted on the "inside" side of the aluminium mounting plate. Put it sound hole side up, and attach it with the nut and bolts. For me this meant the attaching flanges are on the opposite side as the metal plate so they had to be the whole 1/2 inch long.
Screw the switch on in it's place, and make sure it is the right orientation for the groove cut in the lid.
Next you need to glue the tube into place. Work on a piece of paper so you don't stick the lid to what you're working on top of. Put the super glue on the outer edge of the tube and hold it level into the top for 30-60 seconds or however long the glue says.
Stick the sensor in by wedging a little piece of batting or stuffing or whatever's around like that between the leads of the photoresistor and pushing it in with a pencil or needle nose pliers. As long as it sticks tight it should be a semipermanent attachment since there's no weight on it.
!!!Be sure to thread the leads through the metal plate before wedging it into the tube!!!
Load the program (https://github.com/GilesVolmir/308L-Arduino-Project/tree/master/SingingBass) into the arduino, plug the components you just made into their places, stick the arduino and the battery into the box, hold the mounting plate and the top together (minding the placement of the tube) then stuff it all in the box, minding you don't catch any of the wires in the seam. Screw the top on and you're done!