Introduction: Raspberry Pi Thief Detector
What is a Raspberry Pi ?
The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. It is a capable little device that enables people of all ages to explore computing, and to learn how to program in languages like Scratch and Python. It’s capable of doing everything you’d expect a desktop computer to do, from browsing the internet and playing high-definition video, to making spreadsheets, word-processing, and playing games.
What’s more, the Raspberry Pi has the ability to interact with the outside world, and has been used in a wide array of digital maker projects, from music machines and parent detectors to weather stations and tweeting birdhouses with infra-red cameras. We want to see the Raspberry Pi being used by kids all over the world to learn to program and understand how computers work.
This is a simple project no matter you are a beginner or an expert! This is so simple that children could also make it.From this Project you learn about GPIO pins too!!
This is a video from Element 14, In our project we just change the Switch with our Trigger and some other things:
OR
Visit http://www.element14.com/community/docs/DOC-65526/...
HOPE YOU ENJOY!!
Step 1: Find Materials Required:
For Making this you will need the following Items: (Items marked with * are only needed once for the initial process)
1. Raspberry Pi B+/ 2 and a Memory Card (pre-loaded Noobs/ Raspbian)
| www.element14.com/raspberry-pi/rpi2-modb-8gb-noob... |
2. Monitor or Tv (with HDMI Port)*
3. Keyboard, Mouse and Power Supply*
4.Computer speaker with external power supply
5. Hard Paper, Packing Foil and 2 Alligator clips
6. Solder Less Bread Board, Resistor () and male to male and male to female wire
7. An Audio file to played (Police Siren or any of your choice)
8. Raspberry Pi Case | www.element14.com/multicomp/mc-rp002-blk/raspberr... |
9. Daily tools like Scissors, Glue, Ruler and Pencil
10. Pi Break Out Kit (Optional) | https://in.element14.com/webapp/wcs/stores/servlet... |
Step 2: Making the Trigger!
1. Cut out a Rectangle of (you can change the dimensions according to you).
2. Now Fold it into 2 equal halves and make crease (Do not fold so hard that both sides touch each other).
3. Cut 2 Rectangles () of packing foil paste them inside on both the sides (Make sure that both of them dont touch each other).
4. Now attach the alligator clips on different sides (See pictures) and cut the remaining part.
This should work as an switch (You can test it) when some one steps on it the circuit would be complete and Raspberry pi would get the signals.
Step 3: Booting and Coding Pi!!
1. Boot up your pi, If you are doing it first time then visit
2. Open terminal and start typing the following codes One-By-One:
- Type: sudo apt-get update
- Type: sudo apt-get upgrade
Type: sudo apt-get install python-dev
Type: sudo apt-get install python-rpi.gpio
Press: Y
nano pi-thief-detector.py
First save this file as a text file ( http://www.element14.com/community/resources/stati... ) and then your sound(to played )(.mp3) to a thumb drive (in Windows, right click link and select “Save target as. . .”): and then connect the thumb drive to your Raspberry Pi.
Open file manager on your Pi, copy sound (.mp3) to your Pi directory.
Then select pi-thief-detector.py.txt and double-click to open it.
Select all the text and then toggle to the nano editor running in LXTerminal and right click to select Paste.
Once the text is in nano, press control-x (you'll be prompted to save your work).
Press Y and then press enter to save it as the same name.
Type: chmod +x pi-theif-detector.py
Type: sudo python pi-thief-detector.py
Step 4: Making Up the Connections:
- Connect one End of the Ribbon Cable (From GPIO Pins) to the Pi and the other End to the Breadboard {The ribbon cable has a white line down one side. (Black ones usually have a red line; grey ones usually have a red line.) That line represents the side of the ribbon that should be connected to Pin one. On the Pi – Pin one is in the corner of the board so plug in ribbon with the line on the corner.}.
- Plug the PCB into the Breadboard {There are two rows of pins on the bottom of the PCB – each row has to be plugged in to a different column A-E or F-G on the breadboard.}.
First Power the board.
Find a pin labeled 3.3v and run a jumper wire from that to a alligator clip.
Next, run a jumper wire from Pin 22 to any open row above (yellow wire).
Next add the resistor from the same row as the yellow wire to the power rail and connect resistors second end to second alligator clip.
Visit this link if you are having any problems http://www.element14.com/community/docs/DOC-65526/...
Step 5: Final Setup:
- Put Your Raspberry pi in a case for protection. (Optional)
- Make all the connections from step 4.
- Code It From step 3.
- Put the Trigger at the desired place.
- Power up your pi and log in.
- Connect the aux wire of the speaker into your pi.
- Power the speaker from additional power supply.(Pi could not give much current)
- Finally test Your unit by stepping on the trigger.
- If your audio plays then- BOOM!!
- if not re-check everything.
Step 6: Result:
This is not a permanent one. I do not assure you, If it will work every single time. Do not step on the trigger for long.You made need to change the trigger after a period of time.
How does it it work ?
Raspberry pi is a Linux based computer.Which has abilities to give or take signals through its GPIO Pins. In this case Raspberry Pi Gives current, the trigger completes the circuit. When Pin 22 receives signals back it plays our audio.
Raspberry Pi is a trade mark of Raspberry Pi Foundations.
For more information visit https://www.raspberrypi.org/
Thanks for visiting here. I have got some pictures above, you can download and put them in your Project.
I would be delighted if you share your valuable experiences and feedback in comments.