Reading from SD Card

Hi folks,

I am currently working on a project that involves reading known RFID cards using Arduino Uno and an ethernet shield. Since I have to store a lot of UIDs (roughly 600), I am wondering if it is better to store them on a microSD card or whether it is okay to store them in PROGMEM of the Arduino.

Because I have to continuously check whether the scanned UID matches any of the stored UIDs, reading speed on the SD card has to be very fast. Is this possible or does it take too long to retrieve the data?

Kind regards,
Alex

No idea , you could write a simple sketch , use millis() and see the result for an SD card.

Have a look at FRAM , might do the job

There are several documented ways to speed up search of an SD file. First is to be sure the UIDs are in ascending sequence. Then you only have to read to the point of discovering the UID is not in your file.

Paul

Storing the UIDs like @Paul_KD7HB says opens up for fast search algorithms. The "half way distance" is one. Make an average based on the first and the last UID, and check there. If the UID is smaller than try half of the first halt intervall, and compare.
More sophiticated algorithms like Hast-tagging is an other oprtion.

Think about maintaining the "database", adding or deleting UIDs.

You probably do not need an SD card - which are now not available less than about 8 Gigabytes - to store your IDs. An EEPROM chip would be easy to connect and code for.

Searching 600 records would take less time than lifting your finger!

Paul__B:
An EEPROM chip would be easy to connect and code for.

Would the internal EEPROM on the Arduino be enough, or is it better to use an external chip?

600 tags times how many bytes? Do the calculation :wink:

The disadvantage of PROGMEM is basically that you have to update the code if a tag needs to be removed or added.

UNO has 1k EEPROM - 1024 bytes.

How many bytes per tag? It isn't one, because one byte has only 256 alternatives. :astonished:

Each UID is 8 bytes, so I'll have to use an external EEPROM.

Thank you so much for all your help :slight_smile:

Or , as I said FRAM !!