Charter 11 · count · available project

Path Tripwire

PIR Passage Detector

Place an invisible curtain of changing warmth and learn exactly where it has blind spots.

Difficulty
★★☆
Prefix
pt
Zone
outdoor-1
Type
path-node
Device
pt-01
Build time
7 hours

Mission

Build this

Build a fixed PIR passage detector that turns one long motion signal into one event, with an optional indoor IR comparison.

One kit, one team repository.

Borrowed parts are labelled below and have a fallback. The registered device ID is fixed; sensing and behaviour decisions remain yours.

Bill of materials

Parts

SourcePartFallback
● kitPIR sensor—
● kitIR emitter, receiver, 220 Ω and 10 kΩ resistors—
● kitSG90 servo—

Disconnect USB before rewiring. Motors, the relay, and the servo need appropriate power and a shared ground. Never drive an actuator from the ESP32 3V3 pin.

Your invitation

Build an invisible curtain from changing warmth

The Path Tripwire does not shine a beam across the path. It quietly watches the pattern of infrared warmth in several broad regions. When a warm body moves from one region to another, the pattern changes and the sensor wakes.

That makes it wonderfully simple and wonderfully imperfect. It can notice movement beyond the path, miss someone moving straight toward it, or react differently under sun and shade. Your job is to place it, test it, and turn one stretched signal into one fair event.

Invisible does not mean magical

“The sensor saw the gardener’s warm arm, but ignored the cold cart rolling beside them.”

The central idea

PIR notices change, not presence

PIR means passive infrared. “Passive” matters: the sensor sends nothing into the path. A small lens divides its view into regions. When warm infrared energy moves across those regions, the output changes.

Across the view

Warmth crosses several lens regions. Usually easy to notice.

Straight toward it

Less sideways change across regions. Sometimes harder.

Standing still

Warm body remains, but the pattern stops changing.

A motion signal is not yet a passage.

One person can hold the PIR output active for several seconds. Count the beginning of a debounced event, then wait through a refractory period before accepting another.

Why compare with an active infrared pair only indoors?

An emitter and receiver can form a beam that changes when something blocks it. That is a different clue from PIR and can make a useful controlled comparison.

Strong sunlight already contains abundant infrared and can overwhelm a simple receiver. Keep this comparison indoors or deeply shaded. The PIR remains the outdoor passage sensor.

Placement writes the question

The same sensor can watch a path, a tree, or the horizon

Low and across

Legs cross the regions

Good motion contrast, but small animals and warm ground may join the story.

Chest height

Bodies fill the view

Strong human signal, but vegetation and distant paths may remain visible.

Downward angle

Bound the background

Reduces distant motion, but changes the useful passage width.

A cardboard hood can narrow the sides without covering the white lens. Mark height, angle, and walking line before collecting data. If placement changes, the experiment begins again.

Wiring

Build the passive watcher before the optional beam

Let the PIR report raw HIGH and LOW transitions first. Add the servo after debouncing. Build the IR comparison only after the outdoor path detector is complete.

The power rule: The common PIR module uses 5 V and returns 3.3 V logic. The optional IR receiver pull-up uses 3V3. The servo uses a separate 5 V supply. Join all grounds.

Bench referenceOpen the exact wiring map
WiringPIR passage detector, optional indoor IR pair, and startled gesture
ESP325V / VINPIR sensorVCCGPIO 27PIR sensorOUTGNDPIR sensorGNDGPIO 25IR emitteranode via 220 ΩGNDIR emittercathodeGPIO 34IR receivercollector + 10 kΩ pull-upGNDIR receiveremitterGPIO 18SG90 servosignal (orange)external 5 VSG90 servopower (red)GNDSG90 servoground (brown)
ESP32 pinPartPart markingCarries
5V / VINPIR sensorVCC5V power — common HC-SR501 supply
GPIO 27PIR sensorOUTDigital in/out — 3.3 V logic output
GNDPIR sensorGNDGround
GPIO 25IR emitteranode via 220 ΩDigital in/out — optional indoor comparison
GNDIR emittercathodeGround
GPIO 34IR receivercollector + 10 kΩ pull-upAnalog voltage — pull up to 3V3; optional indoor comparison
GNDIR receiveremitterGround
GPIO 18SG90 servosignal (orange)PWM to actuator — short startled gesture
external 5 VSG90 servopower (red)5V power — separate supply
GNDSG90 servoground (brown)Ground — join servo and ESP32 grounds

Confirm your PIR pin order before powering it; modules differ. Keep outdoor joints dry. Never allow a 5 V module output to reach an ESP32 GPIO.

  • 5V power
  • Digital in/out
  • Ground
  • Analog voltage
  • PWM to actuator

The optional IR pair shown is for a bare emitter and phototransistor. If your kit uses a module, follow its printed pin labels and verify that OUT is 3.3 V safe.

Teach it to startle once

A long signal should produce one short event

quiet

PIR output LOW. Ready for a new event.

rising edge

Candidate begins. Confirm the signal.

active

Count once and gesture once, however long HIGH lasts.

refractory

Wait for LOW and a quiet interval before rearming.

Your team decides:

  • How long must HIGH persist before it is real?
  • How long must the path be quiet before rearming?
  • Does a very long HIGH state become “blocked,” “motion,” or “uncertain”?
  • What startled gesture is clear without moving the sensor?

Your path trials

Walk the same line until the sensor’s blind spots appear

  1. Mark the route.

    Fix the walking line, direction, speed range, sensor height, and angle.

  2. Run twenty crossings per condition.

    Test sun, shade, across-view motion, toward-view motion, and at least one distant distraction.

  3. Count misses and doubles.

    A detection rate without a double-count rate tells only half the story.

  4. Tune placement once.

    Repeat the full set after one justified change, then keep the better fixed result.

ConditionCrossingsDetectedDouble countsOther motion
shade, across view20______none
sun, toward sensor20_________
empty path, distant motion20 trials—___ false___

When the curtain ripples

The path is larger than the line you drew

The PIR fires for a minute after startup

It is stabilising. Keep the scene still during warm-up and exclude that interval from results.

One walker creates two events

The signal briefly dropped or your refractory period ended too soon. Require a sustained quiet interval before rearming.

Someone walking toward the sensor is missed

Their warmth crosses fewer lens regions. Turn the sensor so normal traffic moves sideways across its view.

Leaves beyond the path cause events

The field of view includes the background. Aim downward or add a side hood, then repeat the empty-path trials.

The servo gesture creates another event

It shakes the sensor or moves a warm structure in view. Isolate the mount and keep the gesture outside the lens field.

Choose your path question

What kind of tripwire team will you become?

The placement scouts

Make height, angle, and hood shape the experiment. Map the useful and distracting field of view.

The timing designers

Make confirmation and refractory periods the experiment. Balance misses against double counts.

The clue comparers

Indoors, compare passive warmth changes with an active IR beam and explain where each fails.

A calm way through the build

Collect four small wins

  1. pt-01 says hello.

    Join the garden before watching the path.

  2. One crossing creates one raw pulse story.

    Watch HIGH and LOW before counting.

  3. One long pulse becomes one event.

    Add confirmation and a refractory state.

  4. The startled gesture leaves the sensor undisturbed.

    Add separate servo power, then run the fixed route.

The garden handshake

Share what you found

These names are the rigid part of the project. They let another team find your work without knowing what you called the variables in your code.

When count changes

Accepted path events

garden/outdoor-1/path-node/pt-01/count

Unit: events

When state changes

Motion state

garden/outdoor-1/path-node/pt-01/motion

Unit: enum

Listen beyond your own device.

garden/entrance/counter/gk-01/count

Compare aggregate path and entrance activity over shared periods. Never claim that one path event belongs to one particular entrance event or person.

Finish line

Ready to introduce to the garden

  • pt-01 stays online and publishes accepted count and motion state.

  • The reject feed stays clear after the final code starts.

  • The device reads the aggregate Gate Keeper count.

  • Each debounced passage produces one short gesture without moving the sensor or blocking messages.

  • The build log records fixed placement, twenty trials per condition, detection rate, double-count rate, distant-motion false alarms, and one blind spot.

  • Outdoor electronics are protected, the mount is fixed, the servo is safely powered, and the device label can be scanned.

The Path Tripwire does not see people. It notices changing warmth in a chosen field of view. The strength of the project is knowing exactly how different those statements are.

Backbone now

Live status

Updates from the same public event stream

Checking pt-01…