Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Control an LED with a PIR Motion Sensor on Raspberry Pi

This guide demonstrates how to use Raspberry Pi hardware to read a Passive Infrared (PIR) motion sensor and control an external LED. The example is built within Simulink®, enabling you to create and run models directly on the Pi.

Introduction

The Raspberry Pi target for Simulink® provides a library of blocks that configure and access Pi peripherals. In this example, you’ll learn how to read motion events from a PIR sensor and trigger an LED in response.

Prerequisites

Required Hardware

Task 1 – Wiring the PIR Sensor and LED

The PIR sensor has three pins: VCC, GND, and OUT. Connect VCC to the 3.3 V rail, GND to ground, and OUT to a GPIO pin on the Pi. The LED circuit is connected to the same GPIO pin. Because the Pi’s GPIO operates at 3.3 V, use a 1.8 V red LED and a 270 Ω resistor to limit current.

  1. Wire the PIR sensor as shown in the schematic.
  2. Connect the red LED and resistor to the indicated GPIO pin.

Note: If a PIR sensor is unavailable, a momentary push‑button can substitute the OUT pin for testing.

For more detail: Motion Sensor

Manufacturing process

  1. TMP006 Infrared Temperature Sensor with Raspberry Pi: Python Library & Setup Guide
  2. Build a Remote Temperature Sensor with Raspberry Pi and Python – Step‑by‑Step Guide
  3. Secure Home Monitoring with Home Assistant on Raspberry Pi: Motion, Alarm, and Video Capture
  4. Build a DIY Infrared Motion Sensor for Raspberry Pi – Step‑by‑Step Guide
  5. Build a Low‑Cost Raspberry Pi Soil Moisture Sensor for Smart Irrigation
  6. Build a Raspberry Pi Home Temperature Monitor with MCP9808, InfluxDB & Grafana
  7. Master Raspberry Pi GPIO: Interfacing a PIR Motion Sensor on B+/Model 2
  8. Integrating the Acconeer A111 Pulsed Radar with a Raspberry Pi: A Practical Guide
  9. How to Connect, Calibrate, and Program the HC‑SR501 PIR Motion Sensor with a Raspberry Pi
  10. Infrared Eye‑Motion Tracking with Arduino Pro Mini – LED Control Demo