RPi Pico B.Tech/Diploma Beginner

Anti-Theft Alarm with Vibration Sensor & Raspberry Pi Pico

DIY Anti-Theft Alarm using Vibration Sensor & Raspberry Pi Pico Board with MicroPython Code, the Buzzer turns on when movement is detected

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

About this project

Overview
In this guide, we will build an Anti-Theft Alarm using Vibration Sensor & Raspberry Pi Pico with MicroPython Code. The Anti-theft alarm system works with the help of a
Vibration Sensor
installed in and around the vehicle. An impact or the movements inside the car activates the sensors. It, in turn, triggers the alarm system and sounds the alarm. Finally, the alarm goes off and alerts the owner/people.
In this project, the level signal of the vibration sensor is detected by the Raspberry Pi Pico. When vibration is detected, the buzzer is controlled to sound to achieve the effect of an anti-theft alarm. Earlier we made
Laser Security System
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. Vibration Sensor – 1
3. Buzzer – 1
4. Breadboard – 1
5. Jumper Wires – 4
6. Micro-USB Cable – 1
Vibration Sensor
A vibration sensor also called a vibration switch, is a commonly used alarm detection sensor.
The switch is in the open-circuit OFF state when it is at rest. When it is touched by an external force and reaches the corresponding vibration, the conductive pin will generate instantaneous conduction and become an instantaneous ON state. When the external force disappears, the open-circuit OFF state will be restored.
Circuit Diagram & Connection
The connection diagram for interfacing the Vibration Sensor with Raspberry Pi Pico is given below.
Connect the VCC, GND & Digital Output Pin of Vibration Sensor Module to 3.3V, GND & GP0 Pin of Raspberry Pi Pico Board.
MicroPython Code/Program
Open your Thonny IDE & Copy the following code & paste it to the editor window.

from
machine
import
Pin
PWM
import
utime
vibrate
=
Pin
(

Pin
IN
Pin
PULL_UP
)
buzzer
=
PWM
(
Pin
(

)
)
def
playtone
(
frequency
)
:
buzzer
duty_u16
(
1000
)
buzzer
freq
(
frequency
)
def
bequiet
(
)
:
buzzer
duty_u16
(

)
if
__name__
==
'__main__'
:
while
True
:
if
vibrate
value
(
)
==

:
for
i
in
range
(

)
:
playtone
(

)
utime
sleep_ms
(

)
bequiet
(
)
utime
sleep_ms
(

)
bequiet
(
)
Now you can run this code to test the working of the circuit. When you shake the circuit or even if a motion is detected by the Vibration Sensor, the alarm will turn ON.

Technologies used

Raspberry PiBLEPythonPWMMicroPython

Hardware components

  • Raspberry Pi

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.