Arduino Project - GilesVolmir/Skylar-Scott--308L-Junior-Lab GitHub Wiki

I found the arduino SDK and board drivers from arduino.cc I am going through some of the Arduino tutorial to get my bearings.

Ideas: "no" box: *turn switch on, it turns itself off, after some amount of tries it starts running away.

"singing bass" rick astley: *when someone comes near, light sensor, beam sensor, sound sensor etc. it starts rickrolling everyone.

Pitch meter or instrument tuner: Row of LEDs, 7 segent displays, something like that. actually, too hard to do the fourier transform.

Now I've decided on doing the "singing bass" project.

I have a photoresistor which I plan on putting in a voltage divider and connecting to an analog input as a light sensor. the light level will have to be sampled to look for changes in the light, not just a certain value if I want it to work in a variety of lights. I have a piezoelectric buzzer and with the "tone()" function on arduino I can do one note at a time melodies, which is already partially coded in an internal arduino demo. The general idea is to have it play a song when someone passes by. I would also like it to be able to be set somewhere, so a battery pack would be best, which itself will take some figuring out on how to power the arduino.
As for cost of parts: My dad has a lab I can use parts from, so I already have the photoresistor and piezoelectric buzzer, i will need to buy a battery pack and possibly a box to enclose it.

I have been able to do a mock up circuit just sticking the components together with cocktail clips and I have a working program that will play a sample tune when the light in the sensor changes. I have it programmed to keep a log of the last 100 samples it has taken (at ~100 ms intervals) and compare that to the current value, if beyond a certain threshold it will trigger the "song". After the event it refills the log. The program borrows large sections from the official arduino examples. The specific examples it borrows from are the "toneMelody" and "AnalogInput" sketches. Particularly the .h file for the note names.

arduino.cc under "hardware" suggests the external power supply be between 7 and 12 volts. A 9V battery and the simple attachment should do nicely, as Maria suggested.

Over the last couple days I bought 5" x 2.5" x 2" project box from radio shack (~ $4) and 9V battery clips (~$3 for more than i need). The box came with an aluminium plate for mounting inside.

From the electronic parts stock at my family home, I'm using:

  • a radioshack piezolectric buzzer (no internal oscilator)
  • a 1x3 and a 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)
  • resistors: 112ohm, 6.4Mohm.
  • diode (1N4002)
  • 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.

I wired up the circuit in the diagram (I'll upload it to github soon) by just blobbing solder onto the pins on the header and connecting with wires (no circuit board). The shrink wrap was over more exposed parts to prevent shorts.

I then drilled holes into the aluminium plate. Near one end a 6mm hole for the switch, near the other end an 8mm one for a pen tube I cut down to size to mount the photo resistor in, two small ones (small enough for #2 machine screws) spaced for connecting to the flanges on the piezo buzzer, and one large-ish hole between the mounting holes where the sound comes out of the buzzer.

The plastic top has a pill shaped hole cut for the switch bat to move freely, a few smallish holes for the sound to come through above where the buzzer is, and one for the plastic tube that cases the photoresistor. (the casing is just the tube from a cheap pen)

The screw mounts by passing through the hole and has a nut that screws over it. The piezo buzzer mounts with the hole towards the hole in the aluminium and the flanges away from the board (why they had to be a whole 1/2" long). I'm still figuring out the mounting of the light sensor.

Because of problems with multiple light sources shining on the photoresistor at the same time I am mounting it recessed into a black tube, to separate out only one light source so that it tends to pick up people passing where the box is pointed.

I am trying just wedging the photoresistor inside the tube using a piece of "batting" (sort of like pillow stuffing). Since there isn't really any way to put stress on the sensor besides sticking a rod down the hole and pushing, it works fine as a semi-permanent attachment.

I am thinking of supergluing the tube into it's little hole in the plastic top. I don't have the glue tonight so I'll see how that goes later on.

I found Gorilla brand super glue "impact-tough formula" at target in hopes that it would be able to stick the tube to the top, and possibly not shear as easily as regular super glue.

I've glued the tube in, and it seems to be holding well.

Figshare data at hdl.handle.net/10779/55fbacb09c5719daac13229a905e0d15 Instructables post at http://www.instructables.com/id/Making-a-Singing-Bass-but-without-the-fish/ Explanation Video: http://youtu.be/UFB2bePMrhs