Head office, Rana Pratap Bagh, Delhi011 2721 1512+91 97116 99511

Science project idea

PIR corridor light that stays on for a set time after movement

A passive infrared (PIR) sensor detects the heat of a moving person. An Arduino switches a 12 V LED strip on through a relay and keeps it on for a timer period that restarts with every new movement, so the light never cuts out while someone is still walking.

What it shows

A passive infrared (PIR) sensor detects the heat of a moving person. An Arduino switches a 12 V LED strip on through a relay and keeps it on for a timer period that restarts with every new movement, so the light never cuts out while someone is still walking.

The science

The PIR module has a pyroelectric element behind a plastic lens that focuses infrared from many directions. When a warm body moves between zones of the lens, the element output changes and the module pulls its OUT pin high. The Arduino reads that pin with digitalRead, notes the time with millis(), and holds the relay pin high until the chosen number of seconds has passed since the last detection. The potentiometer sets that number through analogRead.

Materials

Cost: under Rs 1,500. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.

  • An Arduino Uno or Nano clone and USB cable
  • An HC-SR501 PIR sensor module
  • A 5 V relay module
  • A 12 V LED strip, 20 to 30 cm, with a 12 V adapter or battery pack
  • A 10 kΩ potentiometer for setting the hold time
  • Jumper wires and a breadboard

Safety

For this project: Low voltage only: the relay switches the 12 V strip, never a mains lamp. An adult must check the adapter connections.

Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.

All the safety rules

Step by step

9 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.

  1. Connect the PIR module VCC to 5 V, GND to GND and OUT to Arduino pin 2.

  2. Connect the relay module IN to pin 8, VCC to 5 V and GND to GND. Wire the strip through the COM and NO contacts with the 12 V supply.

  3. Wire the potentiometer ends to 5 V and GND and its middle pin to A0.

  4. Write a sketch: read the PIR; when it goes high, store millis() as lastSeen and set the relay pin high.

  5. In the loop, read A0 and map it to a hold time of 5 to 60 seconds; if millis() minus lastSeen is larger, set the relay pin low.

  6. Wait about 40 seconds after power-on before testing; the PIR needs that time to settle.

  7. Turn the small sensitivity and delay screws on the PIR to their lowest so the Arduino timer, not the module, decides the hold time.

  8. Walk past the sensor, then stand still: the strip should go off after the set time and come back when you move.

  9. Print the remaining seconds to the serial monitor so you can show the countdown during the viva.

What you should see

The strip comes on within a second of movement and switches off after the hold time with nobody moving. Turning the potentiometer visibly changes the hold time.

Viva questions

A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.

1Does a PIR sensor see a person standing perfectly still?

No. It responds to change in infrared, so a still person fades out after a while. That is why the timer restarts only on new movement.

2Why use millis() and not delay()?

delay() freezes the program, so a new movement during the wait would be missed. millis() lets the loop keep checking.

3Why does the PIR need a warm-up time?

The element and its amplifier need about 30 to 60 seconds to settle to the room temperature before the output is reliable.

4What limits the relay current?

The relay contact rating, usually 10 A, far above the strip current of a few hundred milliamps.

Free ebook: Viva Questions for Science Projects

Take it further

Add an LDR so the light only works after dark, and log each trigger time to the serial monitor.

Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.

Free ebooks for this project

WhatsApp us