SparkFun Forums 

Where electronics enthusiasts find answers.

Have a good idea for a new product for SFE or Olimex? Let us know!
By Dastardly
Ive got this idea copyrighted and im working on the patent

my idea is
"an electronic device that will be used to scare people that will be able to be hidden in a box's or something similar"

my idea is to scare someone with this when they open it so I would make a device that would be able to know when the box was opened than scare the opener

so how would i make a electronic device that would set off a piezo when the box is opened

I am working on making these and selling them worldwide anyone that wants to help me out can email me
, Andrew J. Meyer
Last edited by Dastardly on Wed Aug 07, 2013 7:30 pm, edited 3 times in total.
By Mee_n_Mac
Use a phototransistor, a battery and a piezo buzzer. Better if it's a photo-darlington. Buzzer goes between battery + and collector. Transistor collector goes to buzzer - and emitter goes to battery -. When light shines on the phototransistor it saturates and acts like a switch connecting the buzzer - to the battery -, thus completing the circuit and making the buzzer buzz. I didn't see such a transistor in SFE's parts list. Perhaps (ugh) Radio Shack has one ?

Alternately you can use a photocell, a resistor (perhaps a pot is better), a simple 2N2222 transistor and the buzzer and battery from the above. The photocell and resistor/pot are setup as a voltage divider and connected to each other and the base of the 2N2222. The emitter goes to battery - and the buzzer as above. (a 1k pot would be better)
I used a 9V battery in the simulation below and guessed that a buzzer resistance would be around 100 ohms (it's not so critical). Adjust the pot to about 500 ohms and you can see (read the graph "backwards" if you will) the current through the buzzer switches on as the resistance of the photocell goes from dark condition (10k) to light condition (1k).

I don't know which is cheaper or easier to get. Your call there.

(click on to enlarge)
You do not have the required permissions to view the files attached to this post.