QUOTE (q789654 @ Feb 3 2008, 05:17 PM)

musical box: you open the box, stored mechanical energy drives pins onto a cylinder disc to produce sound
my DIY project: light activated device that plays an .mp3
project example: my device in a closed box, activated when the box is open
i looked around the internet, but couldn't find someone who already made such a device. So i decided to combine two DIY projects that i've found to produce my project
(light activated circuit):
http://hackedgadgets.com/2006/04/12/what-t...h-blue-bawls/2/("hacked" MP3 player):
http://popsci.typepad.com/how20blog/2007/1...-it-hack-y.htmlmy plan is to have a circuit like the first link, but instead of having an LED being activated, i would connect it to the PLAY button as shown in the second link
circuit diagram:

i'm a little confused about the diagram or how the transistor works. anyone can explain it to me?
Well the small circuit uses the transistor as a switch tough the npn transistor is fine radio shack 2n2222 as a substitute if need be. I would probably wire it a bit differently. The C or collector connect that to the plus side of the battery, connect the E or emitter to a reed relay (small relay) to one side of the coil, The second side of the coil to the negative side of the battery. This way you will be isolating your power both devices. Connect the Common and the NO normally open to the mp3 player play button, this will be your switch and you will not have to worry about voltage or current from each device. Next you will want to place a 50ohm pot or variable resistor before or after your cadmium sulfide photo cell, in series, this will give to control on how much light needs to trigger your circuit. you will also want to trade places of the photocell with variable resistor so it is first and the fixed resistor is below it, for your application.
In a dark box the photo has a much higher resistance than the 100k ohm with will allow the base of the transistor see more of a ground than a voltage verry little current will flow from the photo resistor to the variable resistor to the collector of the transistor and to the fixed resistor . The transistor will be in its off stage and will not engage the reed relay and your device will have an open switch.
When you open up the box the photocell will drop in resistance allowing the voltage / current to flow from the plus of the battery though the photocell to the base of the transistor through the fixed resistor to the - side of the battery creating current flow. the base of the transistor will have enough current flow to engage the reed relay which your device will see a closed button.
Now the music will play when the box is open, and off when closed, if the mp3 player will play, as long as the mp3 player can play music with the play button continuously pressed.
If you do not switch the photocell and the fixed resistor from the schematic above you will have the opposite effect, the player will play when box is closed and not when box is opened.
if you do not use a variable resistor in series with the photo resistor is fine, though u can use this in a room to play mp3 player when someone turns on a light.
I would highly recommend the reed relay, unless you measure the voltage at the mp3 players play switch and make sure your voltage source is the same, if your voltage source is too high you can make your mp3 player into a hockey puck. If you need to reduce the voltage by a little bit, try standard diodes witch should drop 0.7v per diode. However, the reed relay is the safest bet.