I imagine if you've watched a James Bond movie, browsed the tech categories here on Instructables, or watched a MacGyver episode you've seen lasers being used as theft deterrents. Of course if you've seen any tv shows you've seen people (like MacGyver) getting past lasers with dust, smoke, and optic cables and barely blinking an eye in the process. What if there was something else that worked just as well and can't be foiled by visible means? Do metal detectors come to mind? If not, they should because this is how we're building our new burglar alarm.
(Parts: 555 timer and maybe a microcontroller, 4x NPN transistors, various resistors, wires, an led and/or piezoelectric buzzer, some sort of metal slug (like a screw or magnet))
Step 1: Gather the Parts
As stated before you'll need a few components, and if you're not familiar with the transistors don't worry because I'll give a minor explanation of the components properties towards the end, but here are things you'll need to make this circuit, some are optional (opt.) and some can be swapped out to help with buy cost. (o short for ohms, M for megohms, k for kilo,
4x NPN transistors (I mostly used 2N2222's but you can cheat and use a 2N4401 or other NPN's)
1x 555 timer chip or microcontroller (depending on how adventurous you want to get)
1x of the following resistors: 100 o, 220 o, 2.2k(opt.)*, 100 k, 1 M,
2x of the following resistors: 1 k, 10 k (opt.)*
Piezoelectric buzzer (can be a siren or buzzer but not a speaker, this circuit only produces a straight voltage signal not a frequency)
wires, including a long stand of spare wire
A metal slug or other metallic object (opt. but desired)
* depending on what you have for resistors and how sensitive you want your alarm you may not need one of each of these, which can be replaced with another single resistor
You may also find it necessary to have a ruler and calculator handy for the formulas later in this Instructable.
Step 2: Building Part 1: the Receiver
Alright here is the simplest step: building the sensor (which I will fittingly name the receiver). The whole receiver is comprised of two simple circuits called Darlington Pairs (which I'll explain in the last step: An Explanation) stacked in series with each other. If you get stuck while I explain how to set them up just refer to the pictures at the bottom.
First, we start by taking one transistor and bending the collector leg so that when it sits in the breadboard it will have two open holes between it and the base leg. If you aren't familiar with transistors, each has an emitter, base, and collector leg (frankly, explaining these would take a while so you'll have to discover why on your own). For our circuit you only need to know that your emitter, base, collector (on both the 2N2222 and 2N4401) are on the left, center, and right respectively as you look at the transistor with the flat side towards you. Second, take two more transistors and do the same to them placing each so that their collector pins fit in the empty rows between the first transistors collector (C) pin and base (B) pin. The two new transistors must also connect their B pins to the emitter (E) pins of their previous transistors.( If you're lost I suggest the pictures below) Finally, take the last transistor and place it along side the last one, but this time it won't be connecting to the previous transistor in the same way as before. This time you'll need a jumper wire connecting the previous E to the last transistor's B pin.
The receiver is now mostly set up, just take the 1M, 100K, 10K, and 1K resistors and connect each to power and to the C pins of each transistor starting with the 1M resistor on the first transistor's C pin, then continuing till each transistor has a resistor on the collector (the final transistor should have the 1K resistor connected to it's C pin and power). Just so that you know where to plug in something later on, I suggest you locate the first transistor's B pin and connect a jumper wire to it, this will be useful later on.
Step 3: Building Part 2: the Interpreter/Switch
Now that we have the receiver finished, the next task is to build an interpreter. What is this interpreter you ask? Well, it is also another simple circuit involving a specific 555 timer layout known as a Schmitt Trigger. This trigger (when connected to the receiver) will determine whether the alarm should be tripped or not. (I'll explain how in the final step)
First, start with the timer chip. You'll need to put it so that it's within a moderate range of the last transistor's E pin. Next, you'll need to power your chip. For mine, I'm using a 9v battery with a 100 ohm resistor but you could also use a USB power supply if you wanted (just make sure you test it out with a battery first so you don't blow out a USB port). So with my 100 ohm resistor connecting pin 8 on my 555 timer and a wire connecting pin 1 to ground we can start setting up the Schmitt Trigger. (I heard you like steps, so I put steps into my Instructable steps)
Step 1. Connect a 1K resistor from power to pin 4.
Step 2. Connect a 220 ohm resistor to pin 3.
Step 3. Connect a 2.2K resistor to pin 6 and an empty spot on the board close to the last emitter ( or replace this with a potentiometer connected to pin 6 and the last emitter and skip the next step)
Step 4. Connect a 10K resistor to the emitter and the unused end of the 2.2K resistor.
Step 5. Connect a tactile switch to an empty portion of the breadboard.
Step 6. Hook up wires to the switch so it is normally open (meaning it needs to be pressed to be used).
Step 7. Connect switch wires to pin 4 and pin 6.
Step 8. Connect LED and/or piezoelectric device to the 220 ohm resistor and ground.
Step 9. Connect a jumper wire from pin 2 to the last emitter.
Step 10. Take a breath, stretch, or whatever you need to do to relax before... MATH! (up next)
Step 4: We Interrupt This Instructable...
Alright I promised math and you're gonna get it (aren't you feeling lucky?). Before you start throwing something at your screen or start running away let me tell you... it's not hard at all when you have a ruler and a calculator, you might actually use this math later on, so it's practical to know.
Basically we just have to make the last component to finish our circuit here which is also the most important part of all, a coil. An inductive coil is essential to this circuit's ability to detect intruders. (I'll explain why in the last step) First, understand this: it takes few measurements to create the best one for your project. Some coils are more naturally sensitive while others are not as sensitive. So what's the rule of thumb? A simple formula: L = (R^2 * T^2)/(9*R + 10*g) where L is inductance in microhenries, R is radius from the outside of the coil to the center in inches(half the diameter of the coil), T is the number of turns of the wire, and g which is the length of the coil itself from one end to the other in inches. This calculates inductance of a single layer coil if it is not filled with a core, like say a screw or magnet, for which you would need an entirely different formula.(which I do not have)
needless to say, follow the pictures below to see how to actually create a coil. You can also use a couple other formulas to help you find a specific inductance by finding the number of turns or by finding the length needed when you know either. ( T= sqrt[(L9R+10g)/R^2] and g= ((R^2 * T^2 / L) - 9R)/10 )
Step 5: Connect and Test
So now you've got your circuit and your new coil so it's time to wire them up and test 'em out. Simple right?
Well, sort of. You see, it's all fine and good that you have your circuit put together but getting it to trigger is another story. What you need to do is test out your coil by turning on the power, resetting the Schmitt Trigger with the switch you installed earlier and then (taking note of how much resistance you put between the 6th pin and emitter) start shifting your body at different speeds, from sudden to slow, to see what speeds will trigger the switch. By decreasing the resistance it will react to more subtle movements easier, but be careful not to turn down the resistance too much or the Schmitt Trigger will never turn off no matter how many times you reset! Turning up the resistance means it will take more sudden movements to trigger. For my circuit the ideal resistance was about 11.28K, which I swapped for a 2.2K and 10K in series but this could change depending on the inductance of your coils (mine were 6 microHenries each with a radius of about a quarter inch and a length of about half an inch with 7 turns of wire and an air core. Though they worked fine with air cores, I opted for magnetite cores which allows me to magnetically fasten them to metal surfaces.)
Step 6: An Explanation
Ok, you got it built and working... by why does it work and how? Well, I'll tell you. At least to my understanding. You see this circuit works almost exactly like a traffic light intersection or fast food drive-thru. When a car reaches a certain point the body of the car passes over an inductive coil (a larger version of what you made) set in the pavement. This triggers something in the circuitry of the traffic light that counts cars and after a while will switch the lights from green to yellow to red and so forth. At a drive-thru the same happens only instead of lights, an alert is sent to the order takers in the restaurant when you get near the speaker (after all you can't expect them to stare at a screen all day looking for cars right?). Our circuit works the same way but a little differently. Since you probably aren't building this to sense cars but rather people, you need to have a more sensitive circuit to detect the disturbances in magnetic flux caused by humans. What's magnetic flux and why can humans trigger disturbances? Simply put, magnetic flux is the magnetic field around a magnet (you've seen it done with iron fillings on paper) which also flows around a wire that has an electric current passing through. Humans are similar to the car frames because of their constant bombardment by WiFi, Radio, and cell phone signals. The disturbances caused by humans is smaller than that of a car but our circuit is tuned to be extra sensitive to these disturbances.
To explain how the circuit works, by my understanding, it goes like this: When the circuit is powered on (after you reset it to be in an off state) the coil acts like an antenna waiting for minute electromagnetic frequencies to come in contact with. While it waits, the transistors are less biased to pass current and are in an off state as well, much like a switch. Since these transistors are off, they don't pass large enough current to trigger the Schmitt Trigger and the lights and sirens remain off. Once there is a large enough disturbance in the EM field (such as a person entering or leaving it), the field that the coil thought was stable becomes unbalanced and more signals are received (because of the human presence receiving the signals and throwing them all over the place) thus more current is produced in the transistors which gain enough oomph to trigger the Schmitt Trigger and sound the alarm. The transistors are recognized in two pairs called Darlington Pairs which use the previous transistors emitted current to attempt to drive itself. With them in a 4x series the current gains through each of the four stages which allows the very, very tiny signals from the coil to be amplified to the point where they can drive the Trigger. In less exciting news, the switch you installed simply counteracts the on cycle by passing current to the reset pin, thus resetting the chip to an off state. You're probably wondering why the EM field created by the circuit itself isn't triggering the alarm. Well, that's a good question, but not unanswerable. The field around these are strong enough to trigger it but since these fields are stable, the coil doesn't really care about them and won't trigger. If you'd like to test this, take the coil and place it near a track that you can roll a metal marble down. Does it trigger? Touch the coil with your hand and touch a radio antenna. Does is trigger?
I hope you had fun building this and I hope you find it useful to you. With a microcontroller and a few modifications you can turn this into a power saving light control (walk in your room and it turns the lights on, stay still for too long and it shuts itself off) or use it to detect those pesky raccoons that always raid your garbage at night. Whatever you do with this, have fun doing it!