# Low-Cost IoT and LoRaWAN-Based System for Laying Hen Identification in Family Poultry Farms
## 4 Results and Discussion
### Field Testing  
Field tests were conducted in a real chicken coop to validate the proper functioning of the system's hardware components and assess its feasibility in an operational environment. The primary objective was to confirm that both the sensor nodes and NFC tags performed effectively under real poultry farm conditions, thereby validating the proof of concept (PoC). The following components were installed for these tests:  
Figure 5: Mobile application displaying real-time data during the laboratory testing phase. “Gallinero IOT” is the Spanish name of the mobile application. “Ponedero” and “Visitas” translate as “Nesting Box” and “Visits”, respectively. “CONECTADO MQTT” and “DATOS” translate as “CONNECTED MQTT” and “DATA”, respectively. Figure 6: Telegram interface with real-time alerts received during laboratory tests, indicating hen visits to specific nesting boxes, where messages like “Visita de gallina X a ponedero Y” translate as “Visit of laying hen X to nesting box Y”. * Five hens equipped with NFC tags for individual identification;
* Two nesting box nodes with NFC readers;
* One environment node with temperature and the humidity sensors;
* A LoRaWAN gateway, facilitating data transmission;
* The network server (The Things Stack) managing the LoRaWAN network;
* An application server, integrating data via Node-RED and storing information in a PostgreSQL database;
* A web application for recording data and mobile and Telegram applications for providing real-time notifications. This infrastructure enabled the validation of the IoT system's functionality and scalability in a real-world setting. As illustrated in Figure 7, the first step of the testing procedure involved selecting the nesting box and installing a sensor node, as shown in the top-left image. A false floor was used to facilitate the installation of the sensor node. To ensure optimal detection, the NFC reader was installed at the entrance of each nesting box--with a slight inclination to facilitate egg collection--as depicted in the top-right image. This position was chosen based on preliminary tests that confirmed this location as the most effective point for tag recognition. The hens' natural movement into the box guarantees sufficient proximity for successful reading. In addition, the system relies on multiple readings within short time intervals to confirm a visit, which mitigates the risk of missed detections due to temporary tag misalignment or brief signal loss. Once the sensor nodes were installed, NFC tags were attached to the hens, specifically on one of their legs, as illustrated in the bottom-left image. Finally, the bottom-right image shows a hen after laying an egg. For a period of 1 week, the infrastructure remained operational in the designated chicken loop to collect relevant data. During this time, the system successfully recorded the hens' interactions with the nesting boxes. The NFC tags attached to the hens were detected by the nesting box nodes, registering each visit. The collected data were then transmitted to the network server and securely stored in the database. The data were visualized through the web application, as illustrated in Figure 8. This figure presents several charts that display the number of visits to the nesting boxes per hour, per day, and per hen, as well as the distribution of activity across the different boxes. This information could enable the identification of behavioral patterns in the hens, such as preferences for specific times of day or particular nesting boxes, as well as individual differences between birds. The graphical representation could also serve as a valuable tool for assessing the system's performance and supporting daily decision making in poultry management. In addition, the system sent real-time notifications via Telegram whenever a hen visited a nesting box, enabling remote monitoring of activity in the chicken loop. The mobile application also provided quick and convenient access to usage data.