Can I store 16 digit card number and its 4-digit pin temporarily in Arduino Mega?

104 Views Asked by At

I have an RFID RC522 reader which reads 16-digit card number and a mini keyboard attached to Arduino Mega 2560 Rev3 which reads 4-digit Pin Number. Now I have attached a ESP-8266 Wi-Fi module in order to send that 16-digit card number and 4-digit pin to server for verification whether it is valid card user. So now I want to send both card number and pin to server at once to make less number of requests to server.

Now I want to ask that whether there’s enough memory in Arduino to store 20 digits temporarily and get a bool value from server whether it is a valid user or not.

1

There are 1 best solutions below

0
On

The ATmega2560 in the Mega2560 has the following memory space :

Flash 256k bytes (of which 8k is used for the bootloader) SRAM 8k bytes EEPROM 4k byte

The microcontroller on the Arduino and Genuino AVR based board has EEPROM: memory whose values are kept when the board is turned off (like a tiny hard drive). This library enables you to read and write those bytes.

The supported micro-controllers on the various Arduino and Genuino boards have different amounts of EEPROM: 1024 bytes on the ATmega328P, 512 bytes on the ATmega168 and ATmega8, 4 KB (4096 bytes) on the ATmega1280 and ATmega2560. The Arduino and Genuino 101 boards have an emulated EEPROM space of 1024 bytes.

To use the specific EEPROM library use: #include <EEPROM.h>

Examples

EEPROM Clear: Clear the bytes in the EEPROM.
EEPROM Read: Read the EEPROM and send its values to the computer.
EEPROM Write: Stores values from an analog input to the EEPROM.
EEPROM Crc: Calculates the CRC of EEPROM contents as if it was an array.
EEPROM Get: Get values from EEPROM and prints as float on serial.
EEPROM Iteration: Understand how to go through the EEPROM memory locations.
EEPROM Put: Put values in EEPROM using variable semantics.
EEPROM Update: Stores values read from A0 into EEPROM, writing the value only if different, to increase EEPROM life.

The full reference is here: https://www.arduino.cc/en/Reference/EEPROM

To summarise and answering specifically to your question, yes it is possible to store your amount of data in Arduino Mega, also using the EEPROM whose values are kept when the board is turned off (like a tiny hard drive). All the best