Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›PIR Motion Sensor (HC-SR501)
Step 3 of 18 in Sensors and measurementPart of a learning path.
Next

Component guide · Beginner · 3 min read

PIR Motion Sensor (HC-SR501)

How It Works and How to Tune It

By Geekobot Learning Team · Updated 24 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerHow a PIR sensor detects motionHC-SR501 adjustments: the two pots and the jumperWiring a PIR sensorStopping false triggersCommon mistakesFAQsParts and next steps
Short answer

A PIR (passive infrared) sensor detects movement of warm bodies by sensing changes in infrared heat across its field of view. The common HC-SR501 runs on 4.5 to 20 V, sees up to about 7 m across roughly 110 degrees, and outputs a 3.3 V high signal when it detects motion, so it connects directly to Arduino, ESP32 or Raspberry Pi pins.

Key specs at a glance

Supply
4.5 to 20 V DC (HC-SR501); 2.7 to 12 V (AM312 mini)
Output
3.3 V high when motion is detected, 0 V otherwise
Range
About 3 to 7 m, adjustable
Field of view
About 110 degrees cone
Hold time
About 3 s to 5 min, adjustable
Warm-up
30 to 60 s after power-on
Standby current
About 50 µA (HC-SR501)
01

How a PIR sensor detects motion

The sensor inside has two infrared-sensitive halves wired against each other. When the room is still, both halves see the same heat and cancel out. When a person walks past, one half sees their body heat before the other, producing a change that the onboard BISS0001 chip turns into a clean digital pulse. The white Fresnel dome focuses heat from many zones onto the sensor.

Because it detects change, a PIR sensor sees people walking but can lose someone sitting very still. For presence detection, combine it with a microwave radar module such as the RCWL-0516 or an mmWave sensor.

02

HC-SR501 adjustments: the two pots and the jumper

ControlWhat it doesTip
Sensitivity pot (Sx)Sets detection range, about 3 to 7 mTurn clockwise for more range
Time-delay pot (Tx)How long OUT stays high, about 3 s to 5 minSet fully anticlockwise and handle timing in code
Jumper H (repeat trigger)Stays high while motion continuesBest for lights
Jumper L (single trigger)One pulse per detection, then a short lock-outBest for counting events
Sensitivity pot (Sx)
What it does:
Sets detection range, about 3 to 7 m
Tip:
Turn clockwise for more range
Time-delay pot (Tx)
What it does:
How long OUT stays high, about 3 s to 5 min
Tip:
Set fully anticlockwise and handle timing in code
Jumper H (repeat trigger)
What it does:
Stays high while motion continues
Tip:
Best for lights
Jumper L (single trigger)
What it does:
One pulse per detection, then a short lock-out
Tip:
Best for counting events
03

Wiring a PIR sensor

VCC

to 5 V (the module's regulator drops it to 3.3 V internally).

OUT

to any digital input. It is 3.3 V, safe for ESP32, Pico and Raspberry Pi.

GND

to ground.

To switch a lamp, have the microcontroller drive a relay module rather than connecting the PIR to mains equipment.

Turn on an LED when motion is detected · Arduino C++Verify & upload in Electrolark
const int PIR = 2;
const int LED = 13;

void setup() {
  pinMode(PIR, INPUT);
  pinMode(LED, OUTPUT);
  Serial.begin(9600);
  delay(30000);                 // let the sensor warm up
  Serial.println("Ready");
}

void loop() {
  if (digitalRead(PIR) == HIGH) {
    digitalWrite(LED, HIGH);
    Serial.println("Motion!");
  } else {
    digitalWrite(LED, LOW);
  }
}
04

Stopping false triggers

  • ✓Keep the sensor away from heaters, AC vents, windows in direct sun and moving curtains.
  • ✓Give it 30 to 60 seconds to settle after power-up and ignore output during that time.
  • ✓On ESP32 builds, mount the PIR a few centimetres from the antenna; strong Wi-Fi transmission can trigger some modules.
  • ✓Use a clean supply. Ripple from cheap adapters is a common cause of random detections.
05

Common mistakes to avoid

  • !Expecting it to detect a person who is sitting still.
  • !Reading the output before the warm-up period has finished.
  • !Pointing it through glass; glass blocks the infrared it needs.
  • !Leaving the time-delay pot at maximum and thinking the sensor is stuck on.
  • !Wiring by photo instead of by label. Pin order varies between makers, so lift the dome gently and read the VCC, OUT and GND markings.
06

Frequently asked questions

What is the range of a PIR sensor?

The HC-SR501 detects up to about 7 m at maximum sensitivity across a cone of roughly 110 degrees. Mini sensors such as the AM312 reach about 3 to 5 m.

Can a PIR sensor detect through walls or glass?

No. PIR sensors need a direct line of sight; glass and walls block the far-infrared heat they sense.

Does a PIR sensor work in the dark?

Yes. It senses body heat, not visible light, so it works the same day or night.

Can I connect a PIR sensor directly to an ESP32?

Yes. The HC-SR501 output is 3.3 V, so it connects directly to any ESP32 GPIO. Power the module from 5 V.

Why does my PIR sensor stay on all the time?

Usually the time-delay pot is turned up, the jumper is in repeat mode with constant movement in view, or a heat source is in the field. Turn the delay fully anticlockwise and test in a still room.

Parts for this guide

  • 5V Relay Module with Optocoupler
    ₹74View
Shop Motion & Position Sensors

Terms in this guide

PIRPassive infrared: a sensor that detects changes in infrared heat, such as a person walking past.Fresnel lensThe faceted plastic dome on a PIR sensor that focuses infrared from many zones onto the sensor.GPIOGeneral-purpose input/output: a microcontroller pin that your code can read or drive.DebounceFiltering the rapid on-off bouncing of a mechanical switch so one press counts once.

Projects that use it

Put this into practice: 57 step-by-step builds in our project library use parts from this guide.

Beginner · 1 hourPIR intruder alarmView projectBeginner · 45 minutesVisitor door chimeView projectBeginner · 1–2 hoursWi-Fi room occupancy sensorView project
Browse all 57 projects

Keep learning

Component guideBeginnerRelay ModulesA relay module is an electrically controlled switch that lets a microcontroller turn a separate circuit on or off, such as a 12 V pump or a mains lamp.4 min read · Switches, Relays & InputComponent guideBeginnerESP32 GuideThe ESP32 is a low-cost 3.3 V microcontroller from Espressif with built-in Wi-Fi and Bluetooth, used for IoT devices, smart-home controllers and web dashboards.5 min read · Boards & MicrocontrollersComponent guideBeginnerArduino UnoThe Arduino Uno is a beginner-friendly microcontroller board that reads sensors and controls LEDs, motors and relays using simple C++ programs called sketches.5 min read · Boards & MicrocontrollersComponent guideBeginnerLEDs ExplainedAn LED (light-emitting diode) lights when current flows from its longer leg (anode, +) to its shorter leg (cathode, -).3 min read · Displays & LEDs

Sources

  • HC-SR501 PIR motion detector datasheet (module documentation)
  • BISS0001 micro-power PIR motion detector IC datasheet

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerHow a PIR sensor detects motionHC-SR501 adjustments: the two pots and the jumperWiring a PIR sensorStopping false triggersCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide1 item · ₹59

HC-SR501 PIR Motion Detector Sensor Module

Run itChange the inputs and watch the output

Real sketch waits 30 s for the sensor to warm up; here it starts at once.

LED (pin 13) OFF
Serial monitor9600 baud
Ready

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question