Complete & Powerful 5-Step Arduino Visit Counter Project | Count Visitors Using IR Sensor & LCD Display
This complete & powerful 5-step Arduino visit counter project is a perfect way to monitor visitor flow in any environment. The Arduino Visit Counter Project uses an IR sensor, OLED display, and Arduino Nano to display accurate counts. With this Arduino Visit Counter Project, you can track entry and exit with precision.
The Arduino Visit Counter Project also includes a BC547 transistor, LED indicator, and relay for automation. You can customize the Arduino Visit Counter Project for shops, events, or classrooms. The Arduino Visit Counter Project is simple to assemble on a perf board. Using jumper wires, the Arduino Visit Counter Project is easy to wire and program. This Arduino Visit Counter Project is ideal for hobbyists and professionals. With this Arduino Visit Counter Project, you’ll learn electronics and coding in a single build.
Introduction
In modern automation, tracking the number of people entering or leaving a space is more than just curiosity—it’s essential for safety, efficiency, and analytics.
Today, we’re building a complete & powerful Arduino visit counter project that uses an IR sensor, OLED display, and Arduino Nano to provide accurate real-time counts.
With just a few electronic components, you’ll have a functional visitor counter that can also trigger external devices—thanks to a 5V relay. This project is perfect for:
Shops and small businesses
Schools and libraries
Events and exhibitions
Personal electronics projects
And the best part? You can build it in just 5 steps.
Materials for the Project
No. | Component | Quantity | Description / Purpose |
---|---|---|---|
1 | Arduino Nano | 1 | Microcontroller for processing and display control |
2 | OLED Display (0.96″) | 1 | Displays the visitor count in real-time |
3 | IR Sensor Module | 1 | Detects movement (entry/exit) |
4 | LED | 1 | Status indicator for detection |
5 | BC547 Transistor | 1 | Drives relay from Arduino output |
6 | 1N4148 Diode | 1 | Protects against voltage spikes from relay coil |
7 | 100Ω Resistor | 1 | Limits LED current |
8 | 1K Resistor | 1 | Bias resistor for transistor |
9 | 5V Relay Module | 1 | Controls external devices based on visitor count |
10 | 2-Pin Terminal Block | 2 | For relay and power connections |
11 | Perf Board | 1 | For assembling the components |
12 | Jumper Wires | — | For connections between modules and Arduino |
Download Circuit Diagram
Circuit Diagram Explanation
The circuit is built around the Arduino Nano, which acts as the brain of the system.
IR Sensor
The IR sensor detects a person passing in front of it by measuring the reflection of infrared light.
The signal pin goes to the Arduino digital input (e.g., D2).
OLED Display
Connected via I2C interface (SDA to A4, SCL to A5).
Displays the current visitor count in a large, readable font.
LED Indicator
Connected through a 100Ω resistor to an Arduino pin for visual feedback.
Relay Control
The BC547 transistor drives the relay coil.
The 1N4148 diode prevents back EMF from damaging the transistor.
Relay output can trigger a light, alarm, or any load.
Power
Arduino is powered via USB or a regulated 5V source.
The relay and sensor share the same 5V supply.
How It Works
A person passes in front of the IR sensor.
The sensor sends a HIGH signal to the Arduino.
Arduino increments the count and updates the OLED display.
The LED blinks as visual confirmation.
If the count reaches a set threshold, the relay activates an external device.
Step-by-Step Guide
Step 1.
First connect Arduino.
Step 2.
- The IR sensors are connected to Arduino’s pins D2 and D3; the PCC pin connects to the 5-fold pin of the Arduino, and the ground pin connects to the ground pin on the Arduino.
Step 3.
- The OLED display connects via the I2C port to Arduino. Its VCC pin connects to the 5-fold pin of Arduino. its SDA pin to A4 pin of Arduino Connect its SCL pin to the A5 pin of the Arduino and its ground pin to the ground pin on the Arduino.
Step 4.
- Then connect a BC547 transistor and connect its pin number three to ground.
Step 5.
- Now connect a 1k resistor and connect its one pin to the D5 pin on the Arduino and its other pin to pin number two of the transistor.
Step 6.
- Now connect the 5-V relay and connect its one coil pin to the 5VT pin on the Arduino and its other coil pin to pin number one of the transistor.
Step 7.
- Now connect 1 N4148 diode and connect its cathode to the 5V supply and its anode to pin number one of the transistor. Now connect an LED and connect its cathode to pin number one of the transistor.
Step 8.
- Now connect a 100-ohm resistor and connect its one pin to the 5V supply and its other pin to the anode of the LED.
Step 9.
- Now connect a two-pin terminal block and connect its one pin to the 5-fold pin on the Arduino and its other pin to ground.
Step 10.
- Now connect another two-pin terminal block and connect its one pin to the common terminal of the relay and its other pin to the normally open terminal of the relay, so we have completed all the connections and our circuit is completed.
Step 11.
- Now let’s upload this code to Arduino and test the project.
Applications
Retail Shops: Monitor customer footfall.
Libraries: Track visitor entry.
Event Halls: Limit occupancy.
DIY Automation: Trigger lights when someone enters.
FAQs
Q1: Can I use an ultrasonic sensor instead of IR?
Yes, but IR is simpler and more cost-effective for short-range detection.
Q2: How accurate is this system?
With proper sensor placement, accuracy is over 95% in controlled lighting conditions.
Q3: Can I log visitor data?
Yes, by adding an SD card module or sending data to a cloud platform like ThingSpeak.
Q4: Can it work outdoors?
Only if you shield the IR sensor from direct sunlight and weather exposure.