1) Communicate verbally and...
2) Be loud enough so that IF it happens to go off, EVERYONE around will know, and (hopefully) call for help.
We all know that many of those battery-powered, $20 alarms that come with double-sided tape that you can mount aren't very loud, and if you DO happen to have one that is REALLY loud, it is your professional, built-in multi $K wired security system. Well, this one uses a microcontroller, which means you can wire the sound output to an amplifier, be it homebrew (DIY) or one from the store.
Here's a video of it in action:
Step 1: Find the Stuff
- Parallax BASIC Stamp IIe microcontroller
- Parallax 'Board of Education' carrier board
- RGB LED (I used THIS ONE)
- 220 ohm resistor
- Some solid core wire
- Parallax PIR sensor (you can buy it online, or get it @ radioshack)
- Emic TTS module (from Parallax's online store; I was going to use this for another project, but that one was too big and expensive, and I never got around to it)
- Male header pins (I used THESE)
- Power supply
- Sparkfun connector wires (or any other wires that have crimped, plastic-housed, female connectors on both ends). I used THESE.
Step 2: Begin the Build...
Once you have everything laid out, this project is fairly simple. First, we will begin with hooking up the PIR sensor. Now, because of the design of the circuit board, the only way you can mount this sensor is if you insert it in the far upper-left hand corner of the breadboard on the BOE (the carrier board), near the servo headers.
Step 3: Hook Up the Emic Text-to-Speech Module
The Emic TTS module is a little big to just insert straight into the breadboard, and the pins on it are not at a right angle, so it will stick out and look ugly of you just pop it on the breadboard. So we will mount it on the back of the carrier board, and use the female-to-female hookup cables to hook it into the breadboard. Use an anti-static bag to keep the Emic TTS module in so that the circuit on the module won't short circuit itself/ the carrier board (or both) when piggybacking under the carrier board. Bring the hookup wire around and insert an 8-pin header row onto the breadboard, and then the hookup wires onto the header pins. Lastly, secure the TTS module to the carrier board with two rubber bands. We will worry about the connections in the next step.
Step 4: Make All the Connections & Add the RGB LED
Emic TTS Module:
- VCC goes to VCC (+)
- GND goes to GND (-)
- SP+ and SP- go to an 8ohm speaker or an external amplifier
- RESET goes to pin4
- BUSY goes to pin3
- SOUT goes to pin2
- SIN goes to pin1
- VCC and GND go to + and - respectively
- The pin labeled OUT goes to pin0
- RED goes to pin9
- BLUE goes to pin8
- GREEN goes to pin7
- The common anode (+; it's the longest lead) connects to a 200ohm resistor, which goes to +5V (VCC)
And last but not least, put a wire in one of the two pin5 sockets, and connect the other end to the same row as the 'SP+' output on the Emic TTS. This is so you don't have to have two different audio output devices (speaker, piezo, amp) for the beeps and the verbal messages. The Emic TTS module must have some sort of diode or protection from the voltage coming from the BS2 when it (the BS2) is doing a FREQOUT command. I have used this setup for a long time and it hasn't caused any trouble. Now as the audio output, you should either build a simple amp (with a LM741 or an LM386) or find a small battery-powered one to use for the audio and alarm. Connect this to the SP+ and SP- rows on the mini breadboard, and you're good to go.
Because of the simplicity of these connections, I'm not including a schematic. If anyone wants one, let me know
Step 5: Add a Speaker
Now we need a speaker. If you just use a 8ohm speaker for TESTING, that's fine, but it will definitely not be loud enough to use as an alarm! You'll need a louder output device, like a battery-powered amplifier. I have one that I've used for previous projects; it's from radioshack and I think it costs about $8. You can even make one if you have the parts; there are PLENTY of audio amplifiers here on instructables. The amp pictured here says the power output is 200mw. When I turn it up even 1/3 of the way, and the alarm sounds with it connected, you can hear it from outside the house!
When you connect the speaker to the audio portion of the DIY alarm, polarity doesn't matter.
Step 6: Upload the Code, and Test It!
Now all that's left is for you to upload the code, set it upright against a lamp or bookshelf or anywhere it has a 'view' of the whole room, turn it on, and walk away. You can even place it behind a picture frame that's on a desk/table/bookshelf, and leave the PIR sensor poking out, but hide the 'guts' (and the battery-powered/plugged-in mini amp) so that it's inconspicuous. Now it's barely noticeable! The amp that I got from radioshack has a socket that accepts 9V wall warts, and the BS2 carrier board has a barrel jack connector, too and a regulator, so you can wire up the whole system to run on outlet power.
Below is the source code for the alarm.