Home › Builds › 11. PIR sensor: only when someone is there

11. PIR sensor: only when someone is there

Bench build · Fundamentals · Beginner · about 30 minutes

Step 11 of the automatic light: Q2 goes in series below Q1, its base driven by the PIR output. Now both must be on: dark (Q1) AND movement (Q2). The lamp lights only when someone walks by at night. Component 11 of 14: the pir motion sensor. A passive infrared sensor sees the heat of a moving body. The HC-SR501 module does all the work and gives a logic output: 3.3 V for a few seconds after it sees movement, 0 V otherwise. It runs on 4.5–20 V and needs about a minute to settle at power-up (shortened in the lab).

11. PIR sensor: only when someone is there: the finished build running on the simulator's bench

Build it in the labGuided build, test sheet and fault finding, free in your browser.

Parts list

Test procedure

Each test has an expected value and a pass range, like a factory test sheet:

  1. Dark, nobody there: lamp off
  2. Dark and movement: lamp on
  3. Daylight and movement: lamp off

How it works

The pir motion sensor. A passive infrared sensor sees the heat of a moving body. The HC-SR501 module does all the work and gives a logic output: 3.3 V for a few seconds after it sees movement, 0 V otherwise. It runs on 4.5–20 V and needs about a minute to settle at power-up (shortened in the lab).

Reading it. Three pins: VCC, OUT, GND (printed under the dome). Two trimmers: sensitivity (range) and hold time; a jumper sets single or repeat trigger.

Testing it. Power it, wait a minute, wave a hand: OUT goes to about 3.3 V and drops back after the hold time. A meter or an LED with 1 k on OUT shows it.

In the build. Q2 goes in series below Q1, its base driven by the PIR output. Now both must be on: dark (Q1) AND movement (Q2). The lamp lights only when someone walks by at night.

Builds on lesson 10: everything from before is still there.

Next: lesson 12, 555 timer.

Things to try

  1. Click the PIR to make movement (after its 2 s warm-up).
  2. Make it bright and click the PIR: nothing happens. That is the AND.

Background

One circuit, built up one part at a time: by lesson 14 it is a solar-powered, dusk-sensing, motion-triggered timed lamp with an alarm.

More builds: fundamentals