37. EEPROM-Based Microcontroller Restart Counter

The task is to track the number of times a microcontroller restarts (due to reset or power failure) and display the count on a serial terminal (e.g., PuTTY, Arduino IDE).

We are going to use EEPROM (Electrically Erasable Programmable Read-Only Memory) to store the restart count because it retains data even after power loss.

Requirements

  • Increment and store the counter in EEPROM each time the microcontroller resets.
  • Display the restart count on the serial terminal.
  • Allow the user to reset the counter to zero via a serial command (e.g., typing ‘R’ or ‘reset’).


 Below are the solutions to the given task using different microcontrollers:

  1. ESP32
  2. Arduino UNO

Submit Your Solution

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