Introduction: Pocket Burglar Alarm
I recently added this project to my blog, if you don't want to wade through all the how to 'ness then this summary might be better to read.
I made it as part of the Gift Exchange.
It works by sending out a modulated infrared signal. The detector then senses any of the reflected signal, this is how it knows if anyone has passed by.
The main board contains a pickaxe chip. There is a mode select button which allows you to cycle through the different detection methods and alerts.
It runs off of 3 x AG-13 button cells and can sense up to 15cm+ in good conditions.
For a demo watch this video.
I also made a couple of instruction manuals which are attached.
Instructables reduces the image quality of uploads so I've included a PDF with all the diagram illustrations at high res.
Step 1: Materials
A few components can be scavenged for this project.
I've included links to techsupplies.co.uk so you can see what the pieces look like, as well as places you are likely to find the component.
Components: Likely places to find them:
- Picaxe 08M chip
- Perf / strip board
- IR sensor 38kHz
- 2mm red LED
- 5mm IR LED Any Remote control
- Piezo transducer Anything that makes a beep noise
- 6mm tactile switch Anything that clicks when you press it
- PCB mount slide switch
- Resistors with rough values of 32k, 10k, 1k, 300, 180 Ohms
- <1.2mm insulated wire
- Button cell battery contacts Anything powered by button cells
- 3 x button cell max size AG-13
- Small nut & bolt
also a Zippo style lighter, or other pocketable housing
(small altoids tin etc)
- Soldering iron with fine tip
- Drill with 1mm, 2mm, 4mm and 12mm bits
- Small files / sandpaper
- Needle nose pliers
- Side cutters
- Tin snips
- 2 part epoxy glue / hot glue gun
- Pva glue / nail varnish
These images show what I was able to get out of a broken electronic die.
small electronic things like this are the best place to look for battery contacts.
Step 2: Prototyping
Note: if following the above circuit it's been pointed out that on the breadboard image, the red led and switch are reversed compared to the circuit diagram. Also don't assume the pin out for your ir sensor will follow the circuit diagram, always check a data sheet.
This Instructable assumes you are familiar with Picaxe or some micro controller system.
If not I suggest you look into it, it's really easy to pick up (this is the first project I've done with it) and it's less costly than arduino.
Set up your circuit as shown in the pictures and circuit diagram.
Place the IR sender and receiver next to each other on your board, facing off of the edge, and make sure to place something between them so only reflected light will set off the sensor.
If you are using the example code then download it and test the circuit.
If you are writing your own program (which I suggest) then here are a few tips.
Read through any data sheets you can find for your sensor, it will only respond to a specific frequency (mine was 38kHz) and it responds best to certain burst lengths and gap times (how long the signal is on or off)
Also note that the sensor is in a high state (a 1 signal being sent to the chip) when there is no IR signal detected (this confused me at first).
Because this is used to count switch presses, switch bounce will ruin your program. (bounce is when, what seems like a single press to you, is registered as many presses by the chip)
To stop switch bounce simply add a pause (e.g. 100ms) after the program counts the press. This gives the switch time to settle.
When you are happy with the circuit and program you can move on to miniaturizing it to fit in a zippo.
Alternatively you could cut a slot out of a large tin, dump the breadboard and batteries in and use the intruder alarm just as it is.
But for me, making stuff smaller and more compact is way more fun.
Step 3: Modifying the Insert
This is quite a lot of work because I wanted to preserve the hinge mechanism of the Zippo.
You could easily get rid of the insert entirely and have the lighter close with some small neodymium magnets placed either side of the opening.
But I like the action of the hinge system so I did it the hard way.
Remove any cotton and wick from the insert and bend the chimney walls out flat.
Cut the chimney off but keep the hinge supports.
Using pliers or a drill remove the flint tube.
Using either some pliers or a drill remove the rivit that holds the spring onto the insert.
Take a large drill bit (slightly smaller than the width of the insert) and drill two large holes in the top of the zippo.
Stay well away from the hinge and remember the spring must be re attached later (a bit further up).
You now have your main hole and using pliers you can pull out the remaining pieces and clean up the opening (see pictures to get and idea of the size / location of the opening)
Now using either tin snips or a hack saw cut off the majority of the insert leaving roughly 10mm (again, see pictures)
Drill a small hole (same size as that in the spring) into the top of the insert and reattach the spring using a short nut and bolt.
you will also need to drill 2 small holes at the far left of the insert for the wires to run through. Carefully drill these using a 2mm (or larger depending on your wires) drill bit.
Finally you will need to drill a 2mm hole in the lighter body. This is where the red LED will poke through.
Whilst looking at the base of the lighter with the hinge on the left, you hole needs to be in the bottom left. (see pictures in the last step showing LED poking through case)
Step 4: Cutting the Stripboard
You will need 3 separate boards. One to hold the sensors in the top of the main body, a large board hidden inside the main board to hold the chip, red LED and resistors as well as a board in the lid to hold the switches and batteries.
For the battery board you need 11 strips of 4 holes.
Sensor board 14 strips of 4 holes.
Main board 14 strips of 8 holes.
The two smaller boards need to fit well, so cut them larger than you need and trim / file them down to size.
The boards shouldn't be too hard to get in and out. the battery board is held in by a screw and the sensor board is held down by the hinge so they don't need to be push fit.
With the main board copper side up cut one square out of the bottom left of the board (this is where the red LED will go)
The battery board is attached into the lid with a small screw. at the far left of the board (see illustration) you need to drill a hole for it.
You can also see the slits for the battery contacts but these will depend on what contacts you are using.
Step 5: Main Board
I recommend placing all your components in as a test fit before soldering anything.
Your board will likely be different depending on what resistors you could find.
The important part is the red LED, this is surface mounted onto the copper side. The -ive side is on the right, on my board the right hand track is going to ground (when looking at board copper side up). Make sure to put a fair bit of solder on this (i push on the red LED when removing the main board from the lighter)
Also remember that where ever the Picaxe chip is placed you must interrupt the copper tracks in between the legs. (you can do this with a drill bit, file or knife. But be careful not to slip and break other tracks.
When soldering the piezo, keep the wires somewhere between 5 - 10cm. This way you will be able to epoxy the piezo in place before you put the main board in, and the wires won't get in the way once it is all assembled.
The illustration shows an ideal configuration (if you had all the right resistors) but I've combined several to get the values I needed.
I haven't included a download circuit in here so make sure you are happy with the program and that the chip is working before you solder it in place.
Step 6: Battery Board
The hardest part of this is getting some solid battery contacts. I was lucky to find some perfect sized contacts and found a great way of attaching them to the board.
If you couldn't scavenge any your best option is to look at the pictures and try to cut something similar out of a piece of tin can (or if that's too tricky use a drinks can).
I cut out small slots where my battery contacts were going to go. I then threaded the small tabs through these slots, bent them over and 'tied' the contacts down with some thin wire.
I was then easily able to solder the contacts into position. Making sure that some of the copper track they were attached to was still free for attaching wires.
The other components are simple to place on. Notice that I have put the resistor tying the button to ground on the battery board so that I only have to run 3 wires (not 4) to the main body)
When attaching the wires that will go to the other boards leave them nice and long and you can get the exact length later.
Step 7: Sensor Board
The illustration shows suggested wiring (note: I've used wire that is < 1.2mm so that it will pass through the holes in the board) you could alternatively widen the necessary holes with a drill.
Solder the IR sender and reciever in place. Also solder on the wires that will go down to the main board, and make a note of where the wires from the battery will be soldered later.
Step 8: Attach Main Board to Sensor Board
You now need to expoxy the main board and sensor board together.
This will obscure the soldering of your sensor board so make sure it is all done correctly and that nothing is short circuiting!
Place the main board into the lighter (make sure the red LED is snuggly in place, now sparingly spread some 2 part epoxy across the top edge of the main board, then place the sensor board into the body of the lighter.
Important! you don't want to glue the boards into the lighter. You are just using the lighter to the line the boards up!!
Once the glue is cured take the two boards out. Don't try to pull the board out from the top, instead use a toothpick to push the board out from the bottom (through the LED hole)
For now the join between the two boards may be a bit flimsy but just be careful with it and resist the temptation to add any more epoxy until the end.
Take the loose wires from the sensor board and solder them into their places on the main board.
Step 9: Attach Battery Board
Before doing this test fit the main/sensor board into the body along with the hinge piece.
Once you are happy with this, remove the main board and thread the wires from the battery board through the hinge piece and cut them to right length ready to solder.
Too long is definitely better than too short (you can always loose the excess under the hinge).
Solder the wires from the battery board into their appropriate places.
Put in some batteries and test the circuit one last time before we insulate everything.
Step 10: Insulating
We are about to put a lot of small electronics into a metal box, which is a short circuiting nightmare.
Cationary Tale: Don't be tempted to start protecting and insulating things before the circuit is complete. I was insulating as I went along, slapping epoxy on everything. I tested the device before sending it, and it didn't work. TBH it would have been faster to start from scratch (there was a short circuit which was buried between the main and sensor boards, under about an inch of epoxy) But I eventually found the offending connection, severed it and rerouted the connection.
So leave this step till last!
Battery Board: flip the board over and file down the space in between the battery contacts as much as possible (don't go too far or you will break the connections)
This gives more space for the batteries (you may notice my lighter doesn't quite close)
I then pasted a thin layer of epoxy(clear nail varnish may allow you to get a thinner layer) over the back of the battery board. Otherwise the batteries will short out against all the other components.
Main/Sensor Board: with a small file go round all the edges removing any unnecessarily large solder lumps which may scrape against the edge.
Then go over these edges with epoxy / nail varnish to make sure they won't short.
You could cover the whole of these board but this is probably unnecessary)
Now that the circuit is finished don't be afraid to put epoxy on any vulnerable connections, especially put a lot on the ends of the wires that go across the hinge, these will be constantly bent about and are in danger of breaking.
Lighter Case: the batteries will come into contact with the lighter lid, so I covered the majority of the lid in pva glue, I used this instead of epoxy because I was able to paint it on and get a nice thin layer.
Step 11: Putting It in the Lighter Body
The nut to hold the battery board in place needs to be expoyed inside the lid. Use only a tiny amount of glue to do this or you may accidentally fill the nut with glue, and it's useless.
When everythiing is finally ready the last step is to epoxy the piezo to the side of the lighter. This will improve the volume of the device dramatically, if you just let the piezo rattle around inside then it won't be very loud at all.
Make sure the piezo is secure then begin to put the boards inside the lighter. Once everything is inside take it for a test run.
My favourite mode is the reverse detect, mostly hiding it places (in a cupboard, in the fridge, in a shoe, and seeing people jump when it goes off).
But it does work as a burglar alarm too.
I've no idea about effective battery life. But the batteries used during the demo vid were some 'dead' batteries I took out of a laser pen, so fresh ones should last a while.
Also the batteries will last longer when using the 'reverse' modes. (because the IR sensor isn't drawing power while waiting)