PIR Sensor
STM32-Experiments Free Updated Sep 20, 2026

PIR Sensor

PIR Sensor

We'll configure a GPIO pin as a plain digital input, read the PIR module's output, and react to it, lighting an LED and printing over UART when motion is detected. This is about as basic as digital sensor reading gets, a good one to have in your back pocket before moving on to trickier analog and protocol-based sensors.

3. Prerequisite

3.1 Hardware

  • STM32 Nucleo-F070RB development board

  • HC-SR501 (or similar) PIR motion sensor module

  • Breadboard and jumper wires

  • Micro-USB cable

  • PC with PuTTY

3.2 Software

  • STM32CubeMX (standalone)

  • STM32CubeIDE

  • ST-LINK USB driver

  • PuTTY, or an equivalent serial terminal app

Community Q&A

0 questions

Ask questions and get answers from our community and staff moderators.

No questions yet — be the first to start the conversation!

Ask a Question

Please log in to ask a question or post a reply.

Login to Participate