Raspberry Pi Pico Projects

Interfacing PIR Motion Sensor with Raspberry Pi Pico


In this Raspberry Pi Pico series tutorial, we will learn how to interface a PIR Motion Sensor with Raspberry Pi Pico. A PIR sensor is a sensor that is used to detect the presence of an object by measuring the infrared radiation emitted by the object. PIR sensors are used in various applications, including security systems, motion detectors, and automatic doors. PIR sensors can be used with Raspberry Pi Pico to detect the presence of people or objects.

Required Components

What is a PIR Motion Sensor?

pir-sensor with raspberry pi

PIR sensors are sensitive to infrared radiation, which is emitted by warm objects. When a PIR sensor detects an infrared ray, it produces a signal that can be used to trigger an event, such as turning on a light. In this tutorial, we’ll show you how to use a PIR sensor with Raspberry Pi Pico.

PIR sensors are available in many varieties of shapes and sizes in the market. In this tutorial we use The HC SR501  PIR Motion Sensor, This sensor is a good choice for this tutorial because it’s easy to use and it’s already

The PIR sensor has three pins: power, ground, and signal.

Circuit Diagram of PIR Motion Sensor with Raspberry Pi Pico

The circuit diagram is very easy to how a Raspberry Pi Pico and PIR motion sensor can be used together. The PIR sensor is used to detect movement, and the Raspberry pi pico is used to control the PIR sensor and turn it on or off the buzzer Or alarm.

PIR Motion Sensor with Raspberry Pi Pico

Micropython Code: PIR Motion Sensor with Raspberry Pi Pico

Open Thonny IDE and paste the following code: Check also How to Setup a Raspberry Pi Pico and Code with Thonny IDE



Raspberry pi pico with pir sensor using micropython

After the Upload code, You will see that the Buzzer remains OFF when no motion is detected and when the PIR sensor detects motion, Buzzer is ON.

Related Articles

Leave a Reply

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

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker