39. People Counter with EEPROM

Objective

The task is to build a human counter system using a microcontroller with two push buttons, one to increment and one to decrement the count, and display the value on a serial terminal (e.g., PuTTY or Arduino IDE).

Requirements

  • Increment and decrement the count using two buttons.
  • Display the current count on the serial terminal.
  • Save the count in EEPROM so it persists after reset or power loss.
  • On startup, read and display the last saved count from EEPROM.

Why Use EEPROM?

EEPROM is a non-volatile memory that retains data without power, making it ideal for storing the count value so it remains available even after a restart.

Hardware Setup

Connect two push-button switches to GPIO pins using either a pull-up or pull-down configuration for reliable input detection.

This task can be implemented on the following microcontrollers:

  1. ESP32
  2. Arduino UNO

Submit Your Solution

Note: Once submitted, your solution goes public, helping others learn from your approach!