RPi Pico B.Tech/Diploma Beginner

Laser Light Security System with Raspberry Pi Pico & LDR

Make a Laser Light Security System with Raspberry Pi Pico & LDR Light Dependent Resistor & RGB LED Module with MicroPython Code

  • Suitable forB.Tech/Diploma RPi Pico students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

Overview
In this project, we have designed Laser Light Security System Using Raspberry Pi Pico Board & LDR module. The project idea revolves around creating a security system. Whenever any object will obstruct the LASER ray the RGB LED will start blinking.
When you start the program, RGB LED initially displays green. We use the red laser emitter to aim at the LDR Light sensor and start timing. When it locks on the target (Light sensor), the RGB flashes red and blue, and stops timing.
This project can be implemented anywhere, not only in buildings or premises but many precious things like jewelry, diamonds, precious antique items in the museum, etc many other things are also secured using such an invisible LASER beam. Many people secure their homes, office, shops, warehouses, etc with the LASER beam security system. You can also make
Anti-Theft Alarm
project using Raspberry Pi Pico.
Components Required
In this guide, I used
Elecrow Raspberry Pi Pico Starter Kit
to test different Modules. You can buy the kit and perform some other operations as well. From this kit, you can use the following components.
1. Raspberry Pi Pico Board -1
2. Laser Light Module – 1
3. LDR Sensor Module – 1
4. RGB LED Module – 1
5. Breadboard -1
6. Jumper Wires – 10
7. Micro-USB Cable
Laser Light Module
The laser Transmitter module emits a dot-shaped, red laser beam. The Laser transmitter module consists of a 650nm red laser diode head and a resistor. Handle with caution, do not look directly into the laser head.
The specification of Laser Transmitter Module KY-008 is as follows:
Operating Voltage – 5V
Output Power – 5mW
Wavelength – 650nm
Operating Current – less than 40mA
Working Temperature – -10°C ~ 40°C [14°F to 104°F]
Dimensions – 18.5mm x 15mm
Circuit Diagram & Hardware Setup
Here is a simple connection diagram for Laser Light Security System with Raspberry Pi Pico & LDR.
Connect the R, G & B Pin of the RGB LED to Raspberry Pi Pico GP2, GP3 & GP4 Pin respectively. Connect the GND Pin of RGB LED to Pico GND Pin.
Connect the LDR Sensor Module to GP0 of Raspberry Pi Pico. Also, connect the output of the Laser Module to GP5 of Raspberry pi Pico. Connect their VCC & GND Pin to 5V (VBUS) & GND Pin of Pico respectively.
MicroPython Code/Program
Open your Thonny IDE & Copy the following code & paste it to the editor window.

from
machine
import
Pin
ADC
PWM
from
time
import
sleep
photo
=

# ADC0 multiplexing pin is GP26
LaserPin
=

#Red laser transmitter
Led_R
=
PWM
(
Pin
(

)
)
Led_G
=
PWM
(
Pin
(

)
)
Led_B
=
PWM
(
Pin
(

)
)
Led_R
freq
(
2000
)
Led_G
freq
(
2000
)
Led_B
freq
(
2000
)
def
setup
(
)
:
global
Laser
global
photo_ADC
photo_ADC
=
ADC
(
photo
)
Laser
=
Pin
(
LaserPin
machine
Pin
OUT
)
Laser
value
(

)
def
loop
(
)
:
aim_time
=

while
True
:
Laser
value
(

)
Led_R
duty_u16
(

)
Led_G
duty_u16
(
65535
)
Led_B
duty_u16
(

)
(
"time:"
aim_time
)
sleep
(
0.1
)
aim_time
+=
0.1
if
photo_ADC
read_u16
(
)
<
15000
:
# Hit by a red laser, the light flashes
(
"Aimed:"
aim_time
)
aim_time
=

for
i
in
range
(

)
:
Led_R
duty_u16
(
65535
)
# red light
Led_G
duty_u16
(

)
Led_B
duty_u16
(

)
sleep
(
0.1
)
Led_R
duty_u16
(

)
Led_G
duty_u16
(

)
Led_B
duty_u16
(
65535
)
# blue light
sleep
(
0.1
)
sleep
(

)
if
__name__
==
'__main__'
:
setup
(
)
loop
(
)
Now you can run this code to test the working of the circuit.
Aim the Laser Light at LDR so that red light will always fall on LDR Module. At this moment the green light of the RGB LED will turn on.
When there is any interruption detected or when the laser light is blocked by falling on LDR, the RGB LED will blink red & blue.
Working of Laser Light Security System
The project basically works on the principle of interruption. If by any means the LASER light is interrupted the LED start flashing. The laser is a concentrated light source that puts out a straight beam of light of a single color.
The LDR is sensitive to light and puts out a voltage when the laser light hits it. When the laser beam is interrupted and can’t reach LDR, its voltage output changes, and eventually the LED will flash.

Technologies used

Raspberry PiBLEPythonPWMADCMicroPython

Hardware components

  • Raspberry Pi
  • LDR

Software & tools

  • Thonny
  • MicroPython

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.