Help
  • FAQ
    browse most common questions
  • Live Chat
    talk with our online service
  • Email
    contact your dedicated sales:
0

Counting Vehicles with EEPROM Data Flash

Author : AIVON February 18, 2026

Content

 

Overview

EEPROM (Electrically Erasable Programmable Read-Only Memory), also called data flash in this context, is a nonvolatile memory that retains data after power loss. It can be erased and reprogrammed using a computer or a dedicated programmer. EEPROM is widely used to store device configuration, program code, and firmware updates.

 

Principle of the Application

Based on the characteristics of EEPROM (data flash) where erasure is relatively slow but byte writes are fast, it is possible to write data sequentially without performing an erase each time. A single byte write can take as little as 60 us, which enables efficient use of write operations for counting or logging.

For an electrophoretic rectifier used to process vehicles, the output current for each processed vehicle rises from 0 to a maximum and then returns to 0. By monitoring the current waveform, each processed vehicle can be reliably detected. On detecting a vehicle, the system writes the value 0x01 into one EEPROM byte starting at address 0x0000; the EEPROM internal address pointer then increments automatically, ready for the next detection. The value 0xFF is reserved as the erased indicator and should not be used as a record value.

 

Counting and Storage Capacity

Using the EEPROM byte addresses in this way indirectly records the total number of vehicles processed by the rectifier. The count can be displayed on a display such as a seven-segment display. A 16 KB EEPROM can store 16,384 records.

Example estimates:

  • If one vehicle is processed every 10 minutes and the system operates 16 hours per day, the EEPROM capacity supports approximately 16,384 / (6 vehicles per hour × 16 hours per day) ≈ 170 days of records.
  • To accumulate operating time by recording one entry every 10 minutes, the EEPROM supports approximately 16,384 / 6 ≈ 2,730 hours of samples.

 

Initialization and Readout

After a power loss and upon next power-up, the microcontroller initializes by reading EEPROM bytes starting from address 0x0000. It reads bytes sequentially until it encounters the erased value 0xFF. The number of non-0xFF bytes indicates the accumulated vehicle count or accumulated operating-time records. The count can then be displayed on the connected display. During subsequent operation, the system continues appending records until the EEPROM is full; a dedicated erase operation can then clear all sectors and restart counting.

 

Implementation Notes

This approach was implemented without modifying the original printed circuit board by using an MCS-51 compatible microcontroller, STC89C55RD+, and its internal EEPROM. The design enables recording during rectifier operation and preserves data across power loss. Experimental validation confirmed the feasibility of the method and that it extends the device's functionality.

 

Differences Between EEPROM and Flash

EEPROM and flash are both nonvolatile memories, but they differ in several ways:

  • Erase method: Traditional EEPROM often requires an explicit erase operation before programming individual bytes, while flash memory is typically organized in blocks and programming behavior differs based on flash type.
  • Write speed: EEPROM byte writes can be slower due to erase/program sequences, whereas flash technologies are often optimized for faster bulk writes.
  • Storage cell: EEPROM uses floating-gate transistors as storage cells; flash memory also uses floating-gate structures.
  • Capacity and reliability: Due to technological differences, EEPROM capacities are commonly smaller than flash, and flash implementations are often used where larger capacity is required.
  • Cost: EEPROM control logic for byte-level erase/program operations can be more complex, which affects cost compared with some flash implementations.

2026 AIVON.COM All Rights Reserved
Intellectual Property Rights | Terms of Service | Privacy Policy | Refund Policy