Ordered on weekdays before 14:00 = shipped the same day and delivered the next day in 98% of cases. Free returns 30-day reflection period 1-year warranty

Wiring diagram and code example

How to connect the Mini PIR pyroelectric infrared motion sensor to an Arduino UNO or ESP32, with an example sketch you can upload straight away.

Mini PIR Motion Detector

This project detects motion using a Mini PIR sensor and triggers the Arduino's built-in LED. When movement is detected, the LED turns on and a notification is printed to the Serial Monitor. Allow a brief warm-up period after powering on for the sensor to stabilize.

Wiring diagram: Mini PIR pyroelectric infrared motion sensor on an Arduino UNO
Wiring diagram · Click to enlarge
Connection table: Mini PIR pyroelectric infrared motion sensor on an Arduino UNO
Connection table · Click to enlarge
Mini_PIR_Motion_Detector.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : Mini PIR Motion Detector
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : Mini PIR
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// Pin definitions
const int pirPin = 2;
const int ledPin = 13;

void setup() {
  pinMode(pirPin, INPUT);
  pinMode(ledPin, OUTPUT);
  
  Serial.begin(115200);
  Serial.println(F("Mini PIR Sensor Initializing..."));
  Serial.println(F("Waiting 5 seconds for sensor to settle..."));
  delay(5000);
  Serial.println(F("Ready! Monitoring for motion..."));
}

void loop() {
  int motionDetected = digitalRead(pirPin);

  if (motionDetected == HIGH) {
    digitalWrite(ledPin, HIGH);
    Serial.println(F("Motion detected!"));
  } else {
    digitalWrite(ledPin, LOW);
    Serial.println(F("Scanning... No motion."));
  }

  delay(300);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Mini PIR Motion Detector with ESP32

This project detects human motion using a Mini PIR motion sensor. When motion is detected, the ESP32 turns on the onboard LED (GPIO 2) and logs a message to the Serial Monitor. Powering the sensor with 3.3V ensures safe signal levels for the ESP32 input.

Wiring diagram: Mini PIR pyroelectric infrared motion sensor on an ESP32 DevKit V1
Wiring diagram · Click to enlarge
Connection table: Mini PIR pyroelectric infrared motion sensor on an ESP32 DevKit V1
Connection table · Click to enlarge
Mini_PIR_Motion_Detector_with_ESP32.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : Mini PIR Motion Detector with ESP32
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : Mini PIR
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// Mini PIR Motion Detection with ESP32

const int PIR_PIN = 13;     // Connected to Mini PIR OUT
const int LED_PIN = 2;      // ESP32 onboard LED

int lastState = LOW;

void setup() {
  Serial.begin(115200);
  pinMode(PIR_PIN, INPUT);
  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, LOW);

  Serial.println("PIR Sensor Initializing... Please wait 10-30s for sensor warm-up.");
}

void loop() {
  int currentState = digitalRead(PIR_PIN);

  if (currentState != lastState) {
    lastState = currentState;
    if (currentState == HIGH) {
      digitalWrite(LED_PIN, HIGH);
      Serial.println("Motion detected!");
    } else {
      digitalWrite(LED_PIN, LOW);
      Serial.println("Motion ended.");
    }
  }

  delay(50);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Mini PIR pyroelectric infrared motion sensor

The little brother of the regular PIR sensor, the head has a diameter of only 1.1cm

  • Input voltage: DC 2.7-12V
  • Quiescent current: <100uA
  • Output voltage: High 3.3 V /Low 0V
  • Delay time: approximately 2 seconds (± 30% deviation)
  • Standard detection at approximately 3 meters distance
  • PCB dimensions: 10mm*8mm
  • Total dimensions: 12mm*27mm
  • Sensor angle: <100°
  • Operating temperature: -20°C - +60°C
  • Lens type: Small

Pins:
- Vin (indicated with "+" and/or "U1")
- Out (middle pin)
- GND/ground/min (indicated with "-" and/or "C1")

Dimensions
Length: 2.8cm
Width: 1.4cm
Height: 1.4cm

  • Compact size
  • 2 sec delay
  • 3 connection pins
  • -20°C to +60°C
Playing loads the video from YouTube.

Why choose this product?

  • Compact size – Fits easily in small projects.
  • Standard detection – Detects motion up to approximately 3 meters.
  • Short delay – Signal delay of approximately 2 seconds.
  • Three pins – Vin, Out and GND for connection.
Specifications
Width1,4 cm
Operating temperature-20°C - +60°C
Input voltageDC 2.7-12V
Output voltageHigh 3.3 V /Low 0V
Length2,8 cm
Diameter1,1 cm
Height1,4cm
PCB dimensions10mm*8mm
Quiescent current<100uA
Detection distance3 m
Delay timeapprox. 2 seconds (± 30% deviation)
Overall dimensions12mm*27mm
Sensor angle<100°
Lens typeSmall

Frequently bought together

Total: € 8,90

Reviews

★★★★★ 4,0/5 4 reviews
  • ★★★★★jean jacques ROUSSEAUXVerified purchase

    The range is very weak, two meters

  • ★★★★★Jan ZandijkVerified purchase

    Great.......

  • ★★★★★roan thieleVerified purchase

    Works well, but sometimes it detects movement that isn’t there

Write a review
Your rating

Shipping & returns

Shipping

  • Parcel with track & trace€ 7,70Within 24 hours
  • Pick up at PostNL location€ 7,40Within 24 hours
  • Letterbox parcel€ 3,70Within 2 business days
  • Letterbox parcel 24 hours€ 4,55Within 24 hours
  • Pick up in storeFree
All about shipping

Returns

Not satisfied? You have 30 days after delivery to return the product.

All about returns

Recently viewed

Vibration sensor SW-18020P

Vibration sensor SW-18020P

€ 0,55