This project was built as the final deliverable for our Embedded System course.
IntroductionIn this project we will use a laser pointer, a few electronic components, and a Raspberry Pi to make a laser tripwire. When an intruder crosses the laser light, buzzer play sound, the camera takes a photo, and then sends it to the telegram.
Detection of laser light breakingFor this purpose, we must first cover the LDR with an object so that it does not get light:
Now we want to connect the LDR and capacitor to the breadboard.
For this purpose, one foot of the LDR connects to a 3.3V pin (with a 3V3 tag) from the Raspberry Pi. The negative pin of the capacitor connects to the ground pin (GND label) and the positive terminal of the capacitor connects to the GPIO pin 4.
When the value of the numerical value of the resistance changes, Buzzer will sound. Using a breadboard, you simply connect the positive leg of the buzzer to any GPIO pin on your Raspberry Pi, and the negative leg to a Ground pin.
First, when the Raspberry is off, connect the camera module to the port for the spark plug and turn on the board and make sure the software is active so find the port and connect the camera.
The camera takes a picture when Buzzer is sounding. And saves on the desktop:
from picamera import PiCamera
from time import sleep
camera = PiCamera()
camera.start_preview()
sleep(0.1)
camera.capture('/home/pi/Desktop/image.jpg')
camera.stop_preview()
Comments