Skip to content

GogoVega/RFIDtoEEPROM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RFID to EEPROM

GitHub Release Version PlatformIO Registry ArduiChar Discord

Library to write an RFID Code in the EEPROM in order to check if the Code corresponds to a Code already saved.

Usage

This library is used for saving an RFID Code to your Arduino's EEPROM or I2C EEPROM rather than your Code to avoid showing your RFID Code. To then check if the Code corresponds to a Code already registered.

Warning: you must use the same number of bytes in your functions as defined in the Constructor!

How To Use

Go to the Libraries Manager on PlatformIO and search for RFID to EEPROM. Then you just have to install it in your project.

PlatformIO

Or use platformIO Core CLI and paste the following command:

pio pkg install --library "gogovega/RFID to EEPROM@^1.1.0"

How It Works

Constructor

  • Internal EEPROM
RFIDtoEEPROM(uint8_t byteNumber);

Set emulated EEPROM size (only needed for ESP32 and ESP8266)

void begin(uint32_t eepromSize);
  • I2C EEPROM
RFIDtoEEPROM_I2C(eeprom_size_t eepromSize, uint8_t address, uint8_t byteNumber);

Set I2C BUS Speed

void begin(twiClockFreq_t twiFreq);

Enumerations

Use one of the enumerations below to set EEPROM Size:

{
  KBITS_1,
  KBITS_2,
  KBITS_4,
  KBITS_8,
  KBITS_16,
  KBITS_32,
  KBITS_64,
  KBITS_128,
  KBITS_256,
  KBITS_512,
  KBITS_1024,
  KBITS_2048
}

And use one of the enumerations below to set twiClock (Wire) Frequence:

{
  TWICLOCK100KHZ,
  TWICLOCK400KHZ
}

Enable Debugging

Debugging makes it easier to find errors in a program. To use it, add the following function below your Serial begin and then open your Serial Monitor in order to receive error messages if there are any.

void beginDebug(Stream &debugPort);

Functions

This library contains several functions:

Name Description
CardNumber() Returns the number of Cards already registered.
SaveCard() Stores the RFID Code of a Card in the EEPROM. Returns true if the write succeeds. Otherwise returns false and restores the old Card.
CardCheck() Checks if the Code received corresponds to a Code already stored in the EEPROM. Returns true if a Card matches.
ClearCardNumber() Resets the number of recorded Cards to 0.
EraseAllCards() Resets all Cards to 0.
MaxCards() Returns the maximum number of recordable Cards. Currently set to 255.

Note: The EEPROM memory has a specified life of 100,000 write/erase cycles (depends on models), so you may need to be careful about how often you write to it.

Tested On

  • Atmel AT24C256
  • Microchip 24C65/P

Future Features

  • Be able to use the internal memory of the Raspberry Pi Pico.
  • Increase the number of recordable Cards (currently set to 255).

Limitations

  • It is not possible to use the internal memory of the Raspberry Pi Pico, you must add an external I2C EEPROM.
  • The Number of recordable Cards is fixed at 255.

Getting Started Link

License

MIT License

Copyright (c) 2022 Gauthier Dandele

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Library to write an RFID code in the EEPROM in order to check if the code corresponds to a code already saved.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages