Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
Deva Rivelino
Published

Anti-Theft Tool Using Raspberry Pi Pico

This project is a prototype of a smart home system using raspberry pi pico.

BeginnerFull instructions provided12 hours1,945
Anti-Theft Tool Using Raspberry Pi Pico

Things used in this project

Hardware components

Raspberry Pi Pico
Raspberry Pi Pico
×1
Buzzer
Buzzer
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
LED (generic)
LED (generic)
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Jumper wires (generic)
Jumper wires (generic)
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1

Software apps and online services

Thonny

Hand tools and fabrication machines

Solder Wire, Lead Free
Solder Wire, Lead Free
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Anti-Thief Raspberry Pi Pico with Sensor PIR

Code

Anti-Thief Raspberry Pi Pico with Sensor PIR

MicroPython
import machine
import utime

sensor_pir = machine.Pin(28, machine.Pin.IN)
led = machine.Pin(15, machine.Pin.OUT)
buzzer = machine.Pin(16, machine.Pin.OUT)

def pir_handler(pin):
    print("PERINGATAN!!!")
    for i in range(50):
        led.toggle()
        buzzer.toggle()
        utime.sleep_ms(100)
   
sensor_pir.irq(trigger=machine.Pin.IRQ_RISING, handler=pir_handler)
   
while True:
   led.toggle()
   utime.sleep(3)
        

Credits

Deva Rivelino
2 projects • 0 followers

Comments