Project idea
Use two spaced IR sensor pairs at a doorway to infer direction, update an up/down counter on an 8051, and drive a relay so loads are on when at least one person is inside and off when the room becomes empty. The live occupancy value is shown on a 7‑segment display, making it ideal for energy‑aware automation in labs, classrooms, and halls.
Project description
An IR transmitter–receiver pair on each side of the door feeds the microcontroller GPIOs, where sequence logic decides whether to increment or decrement the people count for robust bidirectional detection. The 8051 multiplexes the 7‑segment display for clear visibility and energizes a 5 V relay (via driver) to switch a demo lamp, ensuring loads are active only when presence is detected.
Components
8051 Microcontroller
7 Segment Display
Relays
IR Sensors
Crystal Oscillator
Resistors
Capacitors
Transistors
Cables and Connectors
Diodes
PCB and Breadboards
LED
Transformer/Adapter
Push Buttons
Switch
IC Sockets
Software
Keil µVision IDE
Embedded C
Features
Bidirectional counting using two IR sensor pairs with direction logic for accurate people entry and exit tracking on 8051.
Auto load control: relay switches lamp on when count > 0 and turns it off when the last person exits for energy savings.
Real‑time numeric display on multiplexed 7‑segment for clear visibility of current occupancy.
Applications
Automated room lighting in classrooms, labs, libraries, and offices with occupancy‑based control to reduce energy wastage.
Entry/exit counting for halls, events, and access points where tallying and basic utilization analytics are needed.
Project Includes:
Project components
Circuit diagram / circuit connections
Source code
Instructions document
Project Types:
- DIY KIT (Do It Yourself KIT) - Along with the components, you will get the source code, circuit diagram/circuit connections, and instructions document to help you build the project easily.
- Ready-Made - We are providing a fully assembled, tested and ready-made project soldered on a PCB with all the other components, code & circuit diagram.
Dimensions (cm)
Approx 10 x 8 x 4 cm when assembled on a 400‑point breadboard/enclosure footprint in the same class as the 8 x 5 x 1 cm board, allowing space for modules and display height.
Shipping dimensions (cm)
Approx 20 x 15 x 10 cm boxed with adapter, padding, and accessories to protect display, relay, and sensors in transit.
Weight
Approx 250 g assembled; reference: breadboard ~40 g plus lightweight semiconductors and modules such as diodes at ~0.35 g each, relay/display/modules, wiring, and lamp demo load.
Estimate project weight
≈ 1kg
Notes: All the products are made by LearnElectronics India and not for re-sale.

