How to Make Burglar Alarm Using Raspberry Pi Pico

Introduction

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

Working

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.

Connection

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(-)

Code

from machine import Pin 
import time 

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


while True:
  print(sensor.value())
  if sensor.value()==1:
    buzzer.value(0)

   else:
     buzzer.value(1)

This entry was posted in Blog and tagged .

Leave a Reply

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