1.15. Mini Access Counter
| Description | This project simulates a simple visitor-counting system. A push button acts as an entry sensor, and each press increases a visitor count displayed on an LCD screen. This project introduces counting systems, data storage, and user-interface displays. |
|---|---|
| Use case | This project is connected to real-world uses such as attendance systems, people counters, production monitoring systems, and access-control solutions. |
Components (Things You will need)
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|---|
Building the circuit
Things Needed:
- Arduino Uno = 1
- Arduino USB cable = 1
- Bread Board = 1
- Jumper Wires
- LCD Screens
- Push Button
Mounting the component on the breadboard and wiring the circuit
Step 1: Place the Push Button and I2C LCD Display on the breadboard.
-
Connect the I2C LCD display by connecting VCC to the 5V power rail on the breadboard, GND to the GND rail on the breadboard, SDA to A4 on the Arduino Uno board, and SCL to A5 on the Arduino Uno board using jumper wires.
-
Connect one pin of the Push Button to Arduino Digital Pin 2 using a jumper wire.
-
Connect the opposite pin of the Push Button to the breadboard GND rail using a jumper wire.
-
Ensure all GND connections share the same ground line.
-
Check all wiring for correct connections and polarity before connecting USB power.

Make sure to connect the Arduino USB cable to the Arduino board.
PROGRAMMING
Step 1: Open your Arduino IDE. See how to set up here: Getting Started.
Step 2: Write the complete program implementing the system logic with appropriate pin definitions, setup configuration, and the main control loop.
// Required Library: LiquidCrystal_I2C
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// LCD object
LiquidCrystal_I2C lcd(0x27,16,2);
// Button pin
int buttonPin = 2;
// Visitor count
int count = 0;
// Previous button state
int lastState = HIGH;
void setup() {
pinMode(buttonPin, INPUT_PULLUP);
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Visitors:");
}
void loop() {
// Read button state
int currentState = digitalRead(buttonPin);
// Detect button press
if(currentState == LOW && lastState == HIGH){
count++;
lcd.setCursor(0,1);
lcd.print(count);
lcd.print(" ");
delay(200);
}
lastState = currentState;
}
Step 3: Save your code. See the Getting Started section
Step 4: Select the arduino board and port See the Getting Started section:Selecting Arduino Board Type and Uploading your code.
Step 5: Upload your code. See the Getting Started section:Selecting Arduino Board Type and Uploading your code
CONCLUSION
LCD initially displays zero visitors. Every button press increases the count by one. Count updates immediately on the display.





