Since this is a project that I put together some time ago There really isn't a step by step process outlined here but the sound portion is something that is really simple & can be used on many different projects. I will try to explain enough that just about anyone could build the same project if they wanted to.
Step 1: A Word of Caution
Step 2: Parts List
-pneumatic solenoid valve & fittings
-plastic tubing (ice maker water supply tubing)
-(2) 1/8" headphone plugs
-1/8" headphone jack
-1/8" to 1/8" headphone cable (male plug on both ends)
-appliance switch (this is explained in the next step)
-two mp3 players (this is explained in detail later)
-inexpensive computer speakers
-wall wort the same voltage as your solenoid on the valve
-porch light motion sensor (simple)
-(2) screw in sockets (simple)
-lamp cord with plug at the end
-LED Christmas lights
-Arduino micro controller (advanced)
-CdS light sensitive resistor (advanced)
-LED lights (advanced)
-laser pointer (advanced)
Step 3: The Appliance Switch & Mp3 Players
There are two sounds for this project, a dormant or background sound, and an attention getting sound. For the background sound we will wire two wires up to the two contacts that allow electricity to flow when the switch is held closed. The other two contacts will be used for the attention getting sound.
One very important detail is you need mp3 players that will play a song repeatedly. I think most mp3 players are capable of this. I used IPods, because It's what I had available & only needed it for a short time. Really all that I did was break connection from the output of the mp3 player with the switch. When the switch is closed the connection for the sound output from one mp3 player is closed & you hear that sound while the connection for the other mp3 is broken. When the switch is opened, the opposite happens & you hear the audio from the other mp3 player.
What is happening if you look at the diagram is that we either have one or the other plug making a complete circuit. So that when the switch is open you hear the sound from one mp3 player & when the switch is closed you hear the sound from the other mp3 player.
Step 4: Building the Box
When building you box keep in mind the amount of force it will need to endure and the wear & tear it will be subjected to. A cylinder pounding on the lid all night long will rattle a flimsy box to pieces in no time. Reinforce the corners with 2X4's & use long enough screws to hold it all together for years to come. I mounted a metal plate to the inside of the lid to absorb the shock of the impact of the cylinder end. I also used denser wood on the mechanism that holds the head, some common building materials aren't really meant for constant shock, a pine board in this application would probably fail at some point.
The lid is mounted with door hinges also for durability. The lever mechanism that the head is mounted to also utilizes a door hinge. The head prop is mounted on threaded plumbers pipe, the prop doesn't actually come in contact with the lid of the box, it's the top of the pipe that does. With this design a styrofoam wig block can be used, there is very little wear & tear on the actual prop. The opening to my box is "U" shaped rather than a round hole, since mine pivots, it ejects on a radius & need additional clearance in the front.
One thing that needs to be considered is where you'll position the switch. You'll want the switch close enough to the hinge that the weight of the door is enough to hold the switch closed but not so close that your prop's door has to be completely open to activate your surprise audio sound.
Step 5: Solenoid Activation (easy Version)
I wired up the porch light motion sensor to the lamp cord. You should be able to insert a bulb and plug this into a wall socket & confirm that it works. Remember to set light to test because the motion sensor in it's normal mode will only work in the dark. Once you've confirmed that you've wired it properly & it works & you've properly sealed the electrical connections, remove the bulb(s) & replace them with the screw in sockets. We will plug our wall wort into one of these & the Christmas light into the other. When the motion sensor is activated it will provide power to the solenoid, activate the cylinder & power up the Christmas lights. Once the motion sensor times out, the power is shut off, the cylinder is retracted & the lights go off. The reason for using LED Christmas lights is for safety, incandescent lights will get hot, and in an enclosed space like this box it could be a fire hazard.
Step 6: Solenoid Activation (advanced)
I wanted to be able to have lots of control options. I mounted the CdS in a toy kaleidoscope so that it would be a little larger target to hit with the laser pointer and easier to hit from a distance. The box also move a little when it animates so a larger target helps compensate for this. The sketch also enables me to set the sensitivity depending on the intensity of light. I created some light banks from UV LED's & painted my prop with fluorescent paint. The light banks are also powered by a mosfet circuit because the power demands are greater that the 5 volts an Arduino pin delivers.
I used a Arduino sketch found on Instructables for The Arduino laser tripwire https://www.instructables.com/id/Arduino-Laser-Tripwire/ & modified it for my components.Adding a output for the mosfet for the solenoid & an output for the mosfet for the lights.