# RFID Based Embedded System for Sustainable Food Management in an IoT Network Paradigm
## 3 RFID Food Management System
### RFID System  
In a HF EPC [4] RFID communication, RFID antennas are interrogating in a time-multiplexed procedure to RFID passive tags. Those RFID passive tags within the reading range, backscatter the signal back to the RFID reader. The RFID reader can not only inventory RFID tags within its read range, but also high and low-level indicators, which are included in the backscattered signal. High-level indicators, such as the identification code (EPC), timestamp, antenna port, and reader identifier, can also be obtained. One of the many RFID advantages in respect to other technologies is the unique identification of labeled-objects. This means each item is identified in a unique manner. For instance, we can differentiate between two cartons of milk from the same company, which have a different expiration date.  
* High-level indicators:
* Identification code;
* Antenna port;
* Reader identifier.
* Low-level indicators:
* Received signal strength indicator (RSSI);
* Radio frequency phase (PHASE).  
The proposed RFID system is composed of a single-board microcontroller which uses an Arduino Mega [10] due to its easy module connection (i.e., Ethernet and RFID modules). Furthermore, the Arduino Mega provides more memory than other models, which allows the development of more complex programs. The RFID module [11] reads all passive RFID tag labeled-objects [12]. Figure 1 shows how the RFID module is connected to the Arduino board through wired links. Figure 2 represents the  
Figure 1: RFM is composed of diverse hardware and software elements.  
connection between the Arduino board and the RFID Module. Each product is labeled with a passive RFID tag containing an unique identifier, linking the product with its information stored in the database (c.f. Section 3.2). Thus, the RFID Module reads the product passive RFID tag, sending this information back to the Arduino board. The Arduino board sends the information to a server, using an Ethernet module [13] via the SPI (Serial Peripheral Interface) protocol. This information is instantly accessible from the RFM app, as shown in Figure 1.  
Passive RFID tags are responsible for linking a unique identifier with a particular product. The MIFARE Classic 1K RFID passive tags provide an EEPROM memory of 1 KB, organized in 16 sectors with 4 blocks of 16 bytes each. Each sector reserves four blocks, three of them are used to store data and the other one, called a trailer, to keep the secret keys A and B that is required to read the written information. Hence, a total of 768 bytes (16 sectors*3 blocks*16 bytes) are free to save product information. Table 2 tabulates the bytes, per block and sector, used to locate the product information. Although 768 bytes are available to insert product information, only 63 bytes are used in this real-time embedded system version implementation, leaving the rest of bytes for future implementations. Note that the writing procedure is performed manually. However, in real implementation, the next generation of products with RFID tags will already contain this information from the manufacturer [14].  
Figure 2: Connection between the RFID module and the Arduino board.