Authorized Online Retailers:

Buy from USA Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES ここでご購入を!

In this project, we will use a PIR motion sensor to detect human movement. Once an intruder’s motion is detected, Pico will trigger a buzzer alarm. This is a typical application used in many home security systems.

  1. Raspberry Pi Pico board and microUSB cable
  2. A computer to run Thonny Python IDE
  3. A breadboard
  4. PIR motion sensor x 1 pc
  5. Active Buzzer (low voltage trig) x 1 pc
  6. Some jumper wires

In above circuit graph, you can see that:
PIR sensor VCC pin connected to VBUS(5V)
PIR sensor GND pin connected to GND
PIR sensor OUT pin connected to GP15
buzzer I/O pin   connected to GP14

Step 1: Create a New Project and Connect the Pico to Serial Port

1)Click the “New Project” icon, and a “My project” icon with a fancy name will pop up.

2)Click the “New” icon in “My Projects.”

Now you will enter a new graphic programming page. Please click the “CONNECT” button at the bottom of the page and connect your Pico board to your project. Then, your browser will pop up a Serial Port option menu. Please select “Pico” from the menu and click the “Connect” button.

If you cannot see “Pico” in the Serial Port menu, it means your Pico is not set up properly. You need to go back to “Lesson 1 Step 1” and set up Pico again.

After you connect Pico to Serial Port, your GUI Connect button will switch to the Disconnect button, as following:

Step 2: Build Graphic Coding Chips

1)Click “Chip” -> “Start,” then move “Start” chip to the coding area, as following:

2)Click “Loops” -> “Repeat while true” and move this block just below “Start” block, as following:

3)From “Logic” category, add an “If-Do-Else” block inside “Repeat while” block, as following:
4)From “Chip” category, add an “Is Pin 0 LOW” block to “If” area and change “pin 0” to “pin 15” and “LOW” to “HIGH,” as following:
5)From “Chip” category, add a “Turn Pin ON” block to “Do” area and “Else” area, then change pin number from “0” to “14” and “Do” area value from “ON” to “OFF,” as following:6)Add a “Turn Pin ON” block again to “Do” area and “Else” area, then change pin number from “0” to “14,” as following:

7)From “Chip” category, add a “Wait 1 seconds” block below outer “If-Do-Else” block, change wait time from “1” to “0.2,” as following:
Now we have finished building the program. We can click the “START” button to run the program.

Test the Program

When you put your hand close to the PIR sensor, it means some intruder is detected, and the buzzer will alarm. If you remove your hand from the PIR motion sensor, the buzzer will stop alarming.

Learn More about parts SKU:2021005900

No. Picture Product Name Link
1 Raspberry Pi Pico Board
2 Servo motor
3 Infrared Sensor Module
4 RFID Module and card
5 Push Buttons and Hats
6 LED(6 x White, 6 x Red, 6 x Yellow, 6x Green)
7 Servo motor
8 Piezo Buzzer Module
9 I2C LCD Display(16×2)
10 Philips Screwdriver
11 Solderless Prototype Breadboard
12 Potentionmeter (10K adjustable resistor)
13 40Pin M to M Jumper Wires
14 20Pin M to F Jumper wires 15cm