How to Make Burglar Alarm Using Raspberry Pi Pico


In this tutorial, we are going to see how to make a burglar alarm system using Raspberry Pi Pico.

We recommend to check our below blog to set up Thonny Python with Raspberry Pi Pico.

Components Required


A burglar Alarm works whenever an object or motion is detected, It can be used for security purposes in Office/Home

The Connection is made with Sensors, Microcontroller, and buzzer, On detection of an object, the system produces sound to alert the user.


Raspberry Pi Pico to Sensor Connection

Raspberry Pi Pico Sensor
3.3V Vcc
Gnd Gnd
GP 4 Out

Raspberry Pi Pico to Led Connection

Raspberry Pi Pico Buzzer
GP 5 Postive(+)
Gnd Negative(-)


from machine import Pin 
import time 

sensor = Pin(4, Pin.IN)
buzzer = Pin(5, Pin.OUT)

while True:
  if sensor.value()==1:


This entry was posted in Blog and tagged .

Leave a Reply

Your email address will not be published. Required fields are marked *