Built to order

Bidirectional Person Counter with Automatic Hall Light Control

This project builds a bidirectional person counter: two IR break-beam sensors at a doorway detect the order of beam crossings to tell entry from exit, an Arduino maintains a live occupancy count, and a relay switches the hall lights on when the first person enters and off when the last one leaves. A 16x2 LCD shows the count and light status. It teaches interrupt-driven sensing, direction decoding, state machines and relay interfacing — with honest handling of the tailgating edge case. Suitable for B.E./B.Tech final-year projects in Electronics and Communication, Electrical and Instrumentation.

Chat on WhatsApp — get a quotation

Electronics / E&TC Arduino Uno16x2 LCDRelay moduleInterrupt-driven firmwareEmbedded C firmwareIR break-beam sensorsDirection state machinePush-button overrideHardware
Bidirectional Person Counter with Automatic Hall Light Control — project thumbnail preview
More project photos (3)

The problem

Halls and classrooms burn electricity lighting empty rooms, and the fix is not a motion sensor that leaves people in the dark but a counter that knows whether anyone is still inside. A single beam can count crossings but cannot tell direction; two beams in sequence can — the order of interruption reveals entry vs exit, the oldest trick in people-counting. This project implements it properly: two IR transmitter-receiver pairs across a doorway feed interrupt pins on an Arduino, firmware decodes the crossing order into direction, maintains the occupancy count, and drives a relay module for the lights. The LCD shows live count and light state, and the report discusses the real-world edge cases (tailgating, lingering in the beam) instead of pretending they don't exist.

SYSTEM FLOW

7 components 6 connections

Live flow
Drag to explore
100%
sensorIR pair A

First doorway beam; broken on entry first, on exit second.

Follow the working sequence

How it works

  1. Two IR transmitter-receiver pairs are mounted across the doorway, spaced a few centimeters apart along the walking direction.
  2. A person crossing breaks beam A then beam B (entry) or beam B then beam A (exit); each break fires an Arduino interrupt with a timestamp.
  3. Firmware compares the order and timing of the two breaks against the configured crossing window to decode direction.
  4. The occupancy count increments on entry and decrements on exit (never below zero); the LCD updates immediately.
  5. When the count goes from 0 to 1, the relay energizes the hall light; when it returns to 0, the relay releases it.
  6. The manual override buttons let the demonstrator correct the count or force the light during edge cases like tailgating.

Tech stack:

  • Arduino Uno (ATmega328P)
  • 2x IR break-beam sensor pairs (transmitter + receiver)
  • 16x2 LCD display
  • Single-channel relay module (light switching)
  • Interrupt-driven firmware with direction state machine
  • Push-buttons (override/reset)
  • Arduino IDE (C/C++ firmware)
Parameter Value
Sensors 2x IR break-beam pairs, approximately 38 kHz modulated (expected)
Doorway width Up to approximately 1.2 m (design target, beam alignment dependent)
Count capacity 0–99 persons (design target)
Detection Hardware interrupts, approximately <10 ms response (expected)
Relay rating 10 A / 230 V AC module (datasheet rating; demo on low-voltage lamp)
Display 16x2 LCD: occupancy, entries, exits, light state
Override Push-buttons: light force on/off, count reset
Supply 5 V / 1 A adapter

Project features

  • [Direction decoding] Two sequenced IR break-beams; the crossing order determines entry vs exit — a genuine bidirectional counter, not a single-beam tally.
  • [Live occupancy tracking] Firmware maintains the room count with a state machine that rejects partial crossings and beam-lingering.
  • [Automatic light control] Relay module switches the hall light on at first entry and off when the count returns to zero, demonstrating energy-saving automation.
  • [Interrupt-driven sensing] Beam breaks trigger hardware interrupts for reliable detection, teaching interrupt programming over naive polling.
  • [LCD status display] 16x2 LCD shows current occupancy, entries, exits and light state.
  • [Manual override] Push-buttons force the light on/off and reset the count, so the demo survives edge cases gracefully.
  • [Debounce and timing logic] Configurable beam-timeout and crossing-window parameters, tuned by the buyer for their doorway width.

What is included

  • Working person-counter prototype (sensor pairs, Arduino, LCD, relay, buttons)
  • Arduino firmware with direction decoding and light logic
  • Wiring diagram and doorway-mounting guide
  • Beam-alignment and timing-tuning procedure
  • Project report PDF (IR sensing, interrupts, state machines, energy-saving analysis)
  • PPT presentation for final review
  • Viva Q&A preparation document

Limitations & prerequisites

  • Tailgating (two people crossing as one) undercounts — a known limitation of all beam counters, discussed honestly in the report with the manual-reset fallback.
  • Works on single-file doorways; wide entrances need the beam spacing retuned and may need additional pairs.
  • Strong ambient IR (direct sunlight on the receivers) can desensitize the beams; indoor mounting is recommended.
  • The count is a demonstration value, not a certified occupancy figure for safety systems.
  • The relay demo should switch a low-voltage lamp; mains wiring must follow local electrical safety practice.

Frequently Asked Questions

How does it know direction?

Two beams, one after the other. Breaking beam A then beam B means walking one way; B then A means the other. The firmware checks the order and the time between breaks to accept or reject the crossing.

What happens when two people walk in together?

The beams see one continuous interruption and count one person — this tailgating case is a genuine limitation of beam counters, and the manual reset button exists exactly for it.

Why interrupts instead of polling?

A fast walker can cross a beam in tens of milliseconds. Polling in a busy loop can miss it; hardware interrupts catch every break reliably.

How does it save energy?

The light switches on only when occupancy goes above zero and off when the room empties — unlike a motion sensor, it never leaves seated, still people in the dark.

Can it handle a wide entrance?

Up to about 1.2 m with aligned beams. Wider openings need retuned spacing or extra sensor pairs, covered as future scope.

Is this project suitable for a final-year project?

Yes — for Electronics, Electrical and Instrumentation programs. It demonstrates IR sensing, interrupt programming, direction-decoding state machines and relay-based automation. Suitable for B.E./B.Tech final-year projects in Electronics and Communication, Electrical and Instrumentation.

Components & software requirements
  • Arduino Uno (ATmega328P)
  • 2x IR break-beam sensor pairs (transmitter + receiver)
  • 16x2 LCD display
  • Single-channel relay module (light switching)
  • Interrupt-driven firmware with direction state machine
  • Push-buttons (override/reset)
  • Arduino IDE (C/C++ firmware)
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Get a quotation