Sensors 24 06976 v2
Sensors 24 06976 v2
Article
In-Depth Development of a Versatile Rumen Bolus Sensor for
Dairy Cattle
Gergely Vakulya , Éva Hajnal * , Péter Udvardy and Gyula Simon
Alba Regia Faculty, Obuda University, 8000 Székesfehérvár, Hungary; [email protected] (G.V.);
[email protected] (P.U.); [email protected] (G.S.)
* Correspondence: [email protected]
Abstract: Precision agriculture and the increasing automation efforts in animal husbandry requires
continuous and complex monitoring of the animals. Rumen bolus sensors, which are cutting-edge
pieces of technology and a rapidly developing research field, present an exceptional opportunity for
monitoring the health status, physiological parameters, and estrus of the animals. The objective of
this paper is to provide a comprehensive overview of the development process of a new sensor devel-
opment. We address the issues of conceptual design, an overview of applicable sensor modalities,
mechanical design, power supply design, applicable hardware solutions, applicable communication
solutions and finally the sensor detection algorithms proved in field tests. In conclusion, we present a
summary of the current opportunities in the field and provide an analysis of the foreseeable trends.
Keywords: precision livestock farming; digital data collection; LoRaWAN communication; intraruminal
device; accelerometer; heart rate estimation
1. Introduction
The Agriculture 5.0 trend, which is often called Precision Livestock Farming (PLF)
in the livestock sector, has been gaining ground after the Industry X.0 trends since the
2000s [1]. The emergence of this trend has been triggered by a number of factors, includ-
Citation: Vakulya, G.; Hajnal, É.; ing the optimization of the amount of labor invested and, more generally, the emphasis
Udvardy, P.; Simon, G. In-Depth on automation for economic reasons, with the aim of maintaining or improving product
Development of a Versatile Rumen quality [2–4]. The importance of sustainability has grown, and animal welfare and envi-
Bolus Sensor for Dairy Cattle. Sensors ronmental issues play a significant role. It is important to use environmental resources
2024, 24, 6976. https://doi.org/ responsibly, preferably through a circular economic model [5–9]. The traditional protocol
10.3390/s24216976 for automation involves a cycle of measurement, evaluation, and action. Sensor systems
and robotic solutions are becoming more and more common in animal husbandry [7,10–15].
Academic Editor: Wonsuk
(Daniel) Lee
The growing significance of integrated data collection, databases, and data processing
needs to be mentioned. Rumen bolus sensors are becoming more important in the dairy
Received: 8 September 2024 cattle sector, which is the topic of our current article [16–18]. The bolus technology in
Revised: 14 October 2024 the beginning phase was evaluated in detail. Experiments were conducted with bolus
Accepted: 27 October 2024 technology on a relevant number of animals. The retention of the bolus was investigated
Published: 30 October 2024
depending on the size, and specific gravity of the bolus, and the age and gender of the
animals. However, it is not possible to obtain direct information on the possible discomfort
of wearing a bolus, but based on theoretical considerations, both by measurement, it is
Copyright: © 2024 by the authors.
rightly assumed that there is no discomfort effect. During the experiments, there was
Licensee MDPI, Basel, Switzerland. no detected difference between bolus-containing animals and not-containing animals in
This article is an open access article physiological parameters and behavior [19]. The conclusion can be stated that the bolus is
distributed under the terms and a noninvasive technology because it can be swallowed easily without any veterinary action,
conditions of the Creative Commons it can stay in the animal for a long time, they do not get lost or fall off, and the animal will
Attribution (CC BY) license (https:// not feel any discomfort when wearing them [8,19,20].
creativecommons.org/licenses/by/ The initial rumen boluses were developed for veterinary applications, wherein they
4.0/). facilitate the controlled release of pharmaceuticals or microelements into the animal’s
digestive tract. Subsequently, the functionality underwent a modification, and boluses were
employed for the purposes of animal identification and the actual collection of sensory
data. The utilization of boluses as sensors is corroborated by the stability of the sensor
within the rumen, where it persists for an extended period, potentially throughout the
animal’s lifespan. This contrasts with sensors employed externally, which may be subject
to degradation or loss over time [5,21]. The use of boluses as sensors is supported by the
fact that the sensor is not removable from the rumen and remains in the rumen for a long
time, practically for the lifetime [5,22] of the animal, unlike sensors used externally.
The application of this technique is hindered by the manner in which information is
conveyed from the rumen. The initial sensors were predominantly designed for temporary
implementation, with applications in pH measurement and local data collection in fistulated
cows [23–26]. Subsequently, the range of modalities was expanded to encompass devices
for measuring temperature [22,27–35] and 3D acceleration [36] data, and the corresponding
radio communication technology [8,11,27,37,38] was also developed.
The field of rumen bolus technology has witnessed significant advancement in recent
years, largely due to the introduction of sophisticated bolus sensors with multiple sensor
modalities and extended lifespans. These advancements have enabled the monitoring
and data recording throughout the entire lifespan of the animal subjects [22,33]. The
rumen bolus sensor technology supports sustainable animal husbandry by continuously
monitoring animals, reducing the need for human resources for animal husbandry, and
supporting the farmer in animal husbandry decisions. There are many products on the
market that are highly variable in quality. The use of bolus sensors on farms is becoming
increasingly prevalent [16–18]; however, the technology has not yet achieved widespread
acceptance. Firstly, the reliability of these devices has yet to be established, and secondly, the
range of services they provide is not yet proven to be superior to those of other sensors [39].
Based on our experience, we can conclude that this market segment has significant
potential for both commercial and scientific growth and development. Therefore, further
development of these devices is required, including the extension of sensor modalities [40]
and an improvement in measurement precision. Furthermore, it is imperative to conduct
scientific studies to substantiate the efficacy and advantages of these devices, providing
farmers with a scientific rationale for their implementation. The ultimate objective is
to conduct a comprehensive evaluation of the animals and their housing conditions in
farms by continuously monitoring them with sensors, using big data solutions, artificial
intelligence applications, and automation solutions [1,7,41]. Our research aimed to develop
a lifelong rumen bolus sensor system, which is capable of measuring many physiological
attributes, including temperature, drinking, motion activity, rumination, and heart rate,
instead of using multiple sensors. The system is able to process these data with the
help of Artificial Intelligence (AI) on the server side to produce a complex monitoring of
animal welfare, health, and farming parameters. The process of creating such a system
involves multiple steps, beginning with the creation of hardware, followed by primary
measurements, and finally high-level data processing. The heart rate measurement is a
completely new function in rumen bolus sensors. This paper shows the development
of the system, including primary data processing. However, building such a tool is a
complex task and an interesting engineering challenge in the fields of electronic design,
resource management, telecommunication solutions, data analysis algorithms, and artificial
intelligence solutions. The objective of this article is to disseminate the scientific experience
of developing such a sensor to the wider academic community, as it may prove to be of
significant interest. A further important scientific topic is the validation of the data obtained
from such a sensor; the significance of this subject merits a dedicated article [42,43].
In this paper, we describe the implementation of such a complex sensor development.
In Section 2 the design of the system is introduced, including the global concept, mechani-
cal design, power supply design, sensor modalities used, and communication techniques.
Section 3 deals with the algorithms designed for the device, followed by a discussion and
conclusions in Section 4. As the main focus of this paper is to describe the technical aspects
Sensors 2024, 24, 6976 3 of 20
of the bolus development, and the testing is a very large and complex process that could
transcend this publication, it is only roughly described in the Section 3. Continuous testing
has been going on since August 2022. The test was conducted on adult animals, including
their reproductive periods. The animals that participated in the experiments were kept
with the control animals in the same barn with natural conditions. The temperature and
humidity were continuously measured during the experiments. The sensor validation in-
volved comparing the measured data to the original physiological characteristics whenever
possible. The validation was primarily carried out using videos recorded by a camera
system and Heart Rate (HR) measurements taken with Polar HR sensors.
2. System Design
2.1. Requirements
The development team consists of veterinarians and university agricultural specialists,
as well as agricultural experts from the test site. These stakeholders were involved in the
preparation of the specification. Our methodological choices were based on prior expert
experience, and we opted for methodologies and technologies that have already been
proven to work in research tasks thus far. The problem scope was defined based on the
experience of an expert team (veterinarian, farmer, agronomical expert, and engineers).
The system’s objectives can be classified into three principal categories: health monitoring,
illness recognition, and oestrus prediction [44].
Health monitoring is the cornerstone of any animal monitoring system. By continu-
ously tracking key indicators such as body temperature and activity levels, these systems
provide real-time data that can be analyzed to assess the overall health status of the animals.
This constant surveillance ensures that any deviations from the norm are promptly detected,
allowing for early intervention [30]. Essentially, health monitoring serves as an “OK” sign
for the farmer, indicating that all parameters are within the required range and that no
extraordinary events are occurring.
Recognizing illness at an early stage is critical for minimizing the impact of diseases
on animal welfare and farm productivity. Early detection allows for timely interventions,
reducing the severity and spread of illnesses. For instance, a sudden drop in activity
levels or an abnormal increase in body temperature can serve as early indicators of health
issues [35]. For the farmer, this functionality serves as an early warning system, signaling
potential problems before they escalate into serious conditions [3]. By providing these
early alerts, the system helps to improve the longevity and quality of life of the animals,
while also maintaining farm productivity and minimizing economic losses associated with
disease outbreaks.
Predicting oestrus is a crucial aspect where the system can generate additional profit
and significantly reduce the environmental footprint [10]. If insemination does not occur
during the short period of oestrus, an entire reproductive cycle is lost, leading to substantial
economic losses. Furthermore, accurate prediction of natural oestrus can eliminate the
need for artificial hormone programs, which are often used to induce oestrus. By relying
on precise oestrus detection, farmers can enhance reproductive efficiency and reduce the
use of hormones, leading to a more natural and environmentally friendly organic approach
to livestock management. This not only optimizes breeding schedules and increases
productivity but also promotes sustainable farming practices [2].
There are several practical products and experimental devices available for animal
monitoring, which can be attached to various parts of the animals’ bodies or even implanted.
Devices placed externally on the animals are often susceptible to being lost or damaged due
to the animals’ movements and interactions [44]. On the other hand, implants, while secure,
require complex procedures for insertion and removal, demanding special equipment
and skilled personnel. In contrast, a bolus, deployed inside the rumen, offers a reliable
and durable solution. By design, a rumen bolus is securely retained within the animal’s
digestive system, ensuring continuous operation throughout the animal’s lifespan without
Sensors 2024, 24, 6976 4 of 20
the risk of loss or external damage. This method provides a robust and low-maintenance
alternative for long-term health and activity monitoring [22].
The only viable method to retrieve the collected data from these devices is through
a low-power radio link. However, transmitting all measurement data in real-time is
impractical due to energy constraints and bandwidth limitations. Therefore, it is essential
to employ data reduction techniques inside the bolus such as compression, filtering, feature
extraction, or other forms of preprocessing. These methods effectively minimize the volume
of data that needs to be transmitted, ensuring that the system can function over extended
periods [8].
On the other end of the radio link, a receiver unit is required to relay the data packets
to higher-level systems for further processing and storage. At this point, employing
Low Power Wide Area Network (LPWAN) technology becomes advantageous. Two of
the most promising LPWAN solutions are Narrowband IoT (NB-IoT) and Long Range
Wide Area Network (LoRaWAN). NB-IoT [45] is a service provided as part of the existing
cellular network, which implies that the positioning of the base stations is beyond the
user’s control. Given that the signal is likely to be heavily attenuated by the bodies
of the animals, this lack of control can negatively impact communication reliability. In
contrast, LoRaWAN [46] allows for complete control over the network infrastructure.
Gateways can be strategically installed in close proximity to the animals, ensuring robust
and reliable communication. This flexibility in network deployment makes LoRaWAN a
more suitable option for maintaining consistent data transmission in animal monitoring
systems, especially in challenging environments where signal attenuation is a concern.
To design efficient preprocessing algorithms that run on the microcontroller, it is
essential to first collect raw, unprocessed data for offline analysis. This requires the creation
of a prototype bolus equipped with the same sensors as the final version but potentially
utilizing a different radio chip. This prototype bolus should be capable of transmitting all
sampled data continuously for a period of at least 8–10 days. Additionally, it is crucial that
the inertial behavior of this prototype closely mimics that of the final version to ensure the
accuracy and relevance of the data collected.
The preprocessed data are collected by the higher levels of the system, where complex
decision-making processes are executed. Advanced AI and machine learning (ML) process-
ing algorithms are employed at this stage, necessitating substantial training and external
support data to ensure accurate and reliable performance. The backend infrastructure must
include a robust database to store all historical data, enabling comprehensive long-term
data analysis and trend identification.
Additionally, the system must feature a user-friendly frontend interface, allowing
users to easily view critical data and insights. This interface should include an alert system
to notify users of events that require immediate intervention, ensuring prompt responses
to potential issues.
The lower size limit of the bolus is the experimental size at which the device no longer
remains in the rumen, but passes through the digestive system or returns to the esophagus
during rumination, so it is not worth reducing the size of the device too much. In practice,
it is worth choosing the size of the device in such a way that it is compatible with one of the
already tested and marketed applicators and can be easily administered with it. Based on
these constraints and the available applicator sizes the diameter of the bolus is chosen to be
40 mm. The applicator does not give a hard limitation on the length; 120 mm was chosen.
Choosing the material for the enclosure of the bolus sensor requires careful considera-
tion of durability and waterproofness. POM-C (polyoxymethylene) industrial plastic is an
excellent choice, offering robust protection against the harsh conditions within the rumen
as it has a certificate for usage in the food industry [47]. The photo of the applicator and
the enclosure of the bolus sensor is shown in Figure 2.
2.4. Sensors
It is essential that the applied sensors provide measurements that can be utilized to
derive the requisite characteristics and alerts. Furthermore, the sensors must be accessible,
low-power, durable, compact, and cost-effective. The device does not contain expensive
components, so the cost of the prepared sensor is comparable to sensors already on the
market, for example, a neck transponder. Most of the relevant characteristics pertain
to some form of movement or physiological change. To capture these, a MEMS (Micro
Electronic Mechanical Systems) accelerometer and/or gyroscope can be employed. These
sensors are effective for monitoring various types of movement, providing valuable insights
into animal behavior and health. Additionally, a temperature sensor is crucial, as it can
deduce several vital functions and health indicators from temperature data.
The use of accelerometers (and/or gyroscopes) and temperature sensors is well-
documented in both commercial [16–18] and experimental bolus sensors [22,34,35]. Another
sensor frequently mentioned in the literature is the pH meter, which helps track the
digestion process inside the rumen. However, pH meters typically do not survive for
several years, limiting their long-term utility. Therefore, this sensor modality was omitted
from the design.
A typical LoRa chip consumes between 80 and 120 mA during transmission. For the
calculation, the worst case active current itx = 120 mA and the longest transmission time
will be used. Such a system always has a non-zero standby current. With typical settings,
the standby current ist of the microcontroller, the sensors and the radio is estimated to be
lower than 100 µA. The capacity of a D-type non-rechargeable lithium thionyl chloride
(Li-SOCl2) battery is C = 19 Ah. The following calculations will use the SF12 spreading
factor, which gives the best link budget and results in a worst-case approximation in terms
of battery lifetime. The duty cycle of the radio can be calculated as follows.
ttx
d= , (1)
t period
where t period denotes the sending period time (1 h) and ttx is 1632 ms for SF12. These
settings result in d = 0.45 · 10−3 . The lifetime can be calculated as follows:
C
t= . (2)
d · itx + (1 − d) · ist
Using the slowest spreading factor (SF12) with a non-rechargeable Lithium D-type
battery, the estimated lifetime for the device, considering only radio communication is
approximately 14 years. This calculation provides a solid foundation for the energy budget,
ensuring long-term operation.
Additionally, LoRa supports downlink (gateway to sensor) messages, which can be
effectively used to adjust the parameters of the preprocessing algorithm or the system. This
capability allows for dynamic reconfiguration and optimization, enhancing the flexibility
and responsiveness of the bolus sensor system.
3. Results
3.1. Hardware
3.1.1. Experimental Bolus
The development of the preprocessing algorithms to be executed on the microcontroller
of the final bolus necessitated the utilization of a device (the experimental bolus) that
permitted the aggregation of raw measurement data.
This bolus version is based on an nRF52840 Dongle, which contains a complex System
on Chip (SoC) solution by Nordic Semiconductor (Trondheim, Norway). The microcon-
troller part of the chip contains a 64 MHz Cortex-M4 core, 1 MB Flash and 256 KB RAM.
This board has a convenient USB connector, that enables convenient firmware updates
debugging during development. The SoC contains a Bluetooth 5.3 compatible module,
which provides another communication possibility for further firmware modifications and
testing after sealing the device.
Although the SoC has versatile wireless capabilities, another radio chip was necessary
to use for data communication. All protocols offered by the chip use the 2.4 GHz band,
which is absorbed by the water. The device uses a Würth (Künzelsau, Germany) AMB3626-
M module, which implements a 169 MHz wM-Bus protocol with 4.8 kbps. This module
was employed in continuous mode to handle the high data rate necessary for capturing
detailed measurements. Note that LoRa is not suitable in this situation, due to its regulated
duty cycle.
The acceleration and the temperature are measured by a LIS2DTW12 MEMS digital
output dual motion and temperature sensor. The physical structure of the three modules
and the battery is shown in Figure 3a.
The energy source of the experimental bolus sensor was the same D-type lithium
battery as the final version, which achieved a lifetime of 15 days. The system continuously
checks the battery’s charge and sends this information hourly to the server. Sensor mal-
functions are not systematically checked, but the missing measurements are detectable on
the server side.
Sensors 2024, 24, 6976 8 of 20
Figure 3. The experimental bolus sensor (a) and the gateway (b).
The main component of the prototype gateway was the Raspberry Pi single-board
computer (SBC). During the experiment no real-time data forwarding was required; the
gateway only recorded the received data frames to a high-capacity SD card, which was
collected at the end of the experiment. Occasional data access was still possible through an
Ethernet or WiFi link. The data frames from the bolus sensor were received by the same
AMB3626-M module. The photo of the gateway is shown in Figure 3b.
Concurrent with the data collection experiment, the instrumented animal was also
subjected to visual inspection with continuous camera recording, and its heart rate (HR)
was monitored. An additional tilt sensor was attached to one of the animal’s legs to
accurately identify standing and lying periods. All measurements were synchronized.
This approach facilitated the identification of events and provided an alternative means of
validation assessment during the development phase.
This comprehensive data collection enabled the identification of patterns in the raw
data, which was essential for the development of the preprocessing algorithms. These pat-
terns provided critical insights into the animal’s behavior and physiological state, forming
the foundation for robust and efficient on-device data processing in the final bolus system.
Figure 4. The printed circuit board of the bolus with the high capacity battery (a) and the gateway
installed under the roof of the barn (b).
3.2. Software
3.2.1. Embedded Firmware
The architecture of the embedded firmware and the main components of the hardware
are shown in Figure 5. The internal peripherals of the microcontroller (MCU) can be
accessed directly by the firmware. The Timer can initiate periodic system events. The
analog–digital converter (ADC) is used to measure the battery voltage. The General
Purpose IO (GPIO) and Serial Peripheral Interface (SPI) are used to communicate with the
external peripherals (the accelerometer, temperature sensor and LoRa radio).
The firmware consists of two layers. The lower Services layer communicates with the
internal and external peripherals and provides abstract interfaces to the Application layer.
The Measurement Scheduler initiates the regular measurement events. The accelerometer
is used at 12.5 Hz, while the temperature sensor is used at a 1 Hz sample rate. The
Buffer Organizer organizes the message buffer and provides preallocated space for each
computed data. The Radio handler initiates the message sending once each hour. The
Settings manager handles the downlink (gateway to sensor) messages, which can contain
parameters for the processing algorithms. This module also stores the settings in flash
memory and reloads them after reset events. Finally, this layer contains a Self Diagnostics
module, which monitors the integrity of the system and generates a reset in case of a
soft lockup.
Sensors 2024, 24, 6976 10 of 20
The Application layer runs the different detection algorithms (Drinking detection,
Motion activity detection, Heart rate detection, Rumination detection), and the firmware
support for the Thermal shock/fever and the Oestrus prediction algorithms.
The preprocessing algorithms can be considered as a special kind of (lossy) data
compression. With a fixed measurement setup, the compression ratio can be calculated
as follows.
do
rc = ,
di
where rc is the computed compression ratio, do is the number of output bytes and di is the
number of input bytes, during an arbitrary amount of time. For the calculations, a one hour
period will be used. In this case do = 51 bytes is the size of a single radio packet and di is
the amount of data measured by the sensors during this period. With 12.5 Hz sample rate,
three axes and 2 bytes per axis the accelerometer generates 3600 · 12.5 · 3 · 2 = 270,000 bytes.
The temperature sensor does a measurement every 10 min (6 times each hour) and it
generates 2 bytes each time, which means 12 bytes per hour. As a result, di = 270,012 bytes
and rc ≈ 1.9 · 10−4 .
Figure 6. Native rumen temperature measured every 5 minutes. The drinking events observable in
the video footage are marked with asterisks. A total of eight drinking events are visible on the chart.
The bolus measures the rumen temperature t every 5 min. The algorithm compares
consecutive temperature samples and counts the events, where the temperature decreases
and the difference between the actual temperature t and the previous one tlast is at least th.
To prevent false double detections a w window is defined; at most one detection is allowed
in the window. The default value for w is 10 min (two samples). The default value of th is
2 °C, but it can be fine-tuned based on the temperature of the drinking water. Based on the
noise characteristics of the temperature sensor th cannot be lower than 1 °C. The drinking
detection algorithm is shown in Algorithm 1.
Sensors 2024, 24, 6976 11 of 20
Figure 7. The typical activity pattern. Red, green and blue traces denote the raw X, Y and Z
acceleration values.
The second component is the acceleration of the bolus caused by various movements.
These movements can be categorized into three types:
• General Motion: The motion of the animal produces larger, mostly aperiodic values.
These variations occur due to activities such as walking, running, or sudden movements.
• Heartbeat: The effect of the heartbeats produces smaller, periodic changes in the
accelerometer readings. These subtle variations are indicative of the animal’s cardio-
vascular activity.
• Rumination: Rumination creates a very specific pattern, which is associated with the
repetitive chewing and digestive processes of the animal.
By analyzing these two main components—gravitational force and movement-induced
acceleration—the accelerometer provides valuable insights into the animal’s orientation,
activity levels, and physiological state.
Sensors 2024, 24, 6976 12 of 20
Two distinct algorithms have been implemented to detect motion activity. The first
algorithm is a peak detector, which identifies the highest peak in the absolute value of
the acceleration values within a specified time interval. The search is performed in non-
overlapping 5 min blocks. The maximum value is categorized into one of 16 predefined
categories using thresholding. Each category is encoded into a 4-bit value for efficient data
transmission and processing.
The second algorithm for activity monitoring first filters out the effect of the gravity. It
uses an exponential averager for each sample:
x̂ = α · x + (1 − α) · x̂
ŷ = α · y + (1 − α) · ŷ (3)
ẑ = α · z + (1 − α) · ẑ,
where x, y and z are the measured acceleration values for each axis, α is the parameter of
the exponential averager, x̂, ŷ and ẑ are the filtered acceleration values.
Then the i intensity value is calculated, which is the distance between the filtered and
the unfiltered acceleration vector.
q
i = ( x − x̂ )2 + (y − ŷ)2 + (z − ẑ)2 (4)
î = β · i + (1 − β) · î, (5)
where β is the parameter of the exponential averager and î is the smoothed intensity value.
Finally, the intensity is categorized into three categories with two thresholds and the
counter for that class is incremented. In order to reduce the amount of data transmitted, it
is possible to further quantize the value of the counter prior to its transmission.
Figure 8 shows an hour of smoothed envelope intensity data, where a 16 min long
rumination period (between minutes 22 and 38), preceded and followed by other activities,
is shown. During rumination longer inactive periods and shorter active ones are happening
after each other, regularly. The algorithm finds this periodic pattern and cumulates the
length of the proper time periods. The exact criteria are specified as follows:
• The active state starts, when îe passes the th H high threshold (default value: 3500).
• The passive state starts, when îe falls under the low threshold (default value: 6000).
• The active period is accepted when its length falls into a predefined [tact,min, tact,max ] interval.
• The active-passive period pair is accepted when their total length falls into a predefined
[tint,min , tint,max ] interval and the relative difference between the k consecutive interval
lengths is lower than ∆tim . The default value for tint,min and tint,max are 50 and 100 s,
or 625 and 1250 samples, respectively. The default value for k and ∆tim are 5 and
0.2, respectively.
Sensors 2024, 24, 6976 13 of 20
Figure 8. The smoothed envelope of the intensity pattern with a 16 min long rumination period. The
high and low thresholds used by the detection algorithms are marked with a green and a blue line,
respectively. The active state is marked with a black trace. Note that the absence of the black marking
means passive state.
The algorithm stores the activity state in variable s (0 means inactive, where 1 means
active state). The t0 , t1 and t2 variables store the time, then an active period started, ended
Sensors 2024, 24, 6976 14 of 20
(and at the same time, a passive one started), that one ended. This means, that, for a full
active-passive period pair, the length of that period is t2 − t0 , while the length of the active
part is t1 − t0 . L is a FIFO-type buffer, which stores the length of the full periods c stores
the cumulated rumination value, and finally o tracks the ongoing rumination state.
The algorithm runs for each incoming îe value and the other input t is the actual
sample number. From this value the s state is tracked by lines 1–2 and 17–18. Lines 3–5 and
18 update the t0,1,2 variables.
For full periods, line 5 calculates the length and line 6 checks the related condition.
The negative case means the interruption of the pattern; o is nulled and the content of L
is dropped (lines 7 and 8). When the condition is true, then the actual period length gets
appended to L (line 10) and then the algorithm checks, if k full periods are collected in L,
and if the similarity of these numbers is within the required tolerance (line 10), rumination
is confirmed. When it is a newly detected one (o = 0, line 12), the sum of the elements of
L is added to the counter c and o is set to 1 (lines 13 and 14). When there was rumination
already, l is simply added to c (line 15). Lines 21–23 drop the periods with too short or too
long active parts.
Figure 9. A 10 s raw record of the accelerometer. The red, green and blue plots denote the x, y and
z axes. Note that the x and y axes are plotted on a [−0.2; 0.3] range, while the z axis is plotted on a
[−1; −0.5] range. The heartbeats measured by the ECG are marked with gray dashed lines.
Sensors 2024, 24, 6976 15 of 20
In our previous research, we have explored effective and sophisticated methods for
cow HR detection, but these algorithms are computationally demanding, presenting a
challenge for implementation in the bolus sensor [49,50]. In the development of the current
algorithm, it is of significant importance to consider that the primary computations must be
conducted on the microcontroller. Following this, a small amount of data can be transferred
to the server, where additional computations can be performed. The block diagram of the
algorithm is shown in Figure 10. The computations performed on the bolus sensor are
illustrated on the left-hand side of Figure 10, while the server-side computations are shown
on the right-hand side.
The accelerometer produces 3D measurements ACCx , ACCy , and ACCz , as shown in
Figure 10. The samples are collected in three buffers of length 75, encompassing a total
of three seconds’ worth of data. For the purpose of detection, the two axes exhibiting
the greatest acceleration are selected, as the cow’s heart is situated in close proximity to
the vertical axis, making it more susceptible to acceleration due to cardiac activity. In the
following steps, the computations are performed for the two selected axes, referred to as A
and B.
Figure 10. The block scheme of the HR estimation algorithm with the processing steps implemented
inside the bolus (left side) and on the server (right side).
In the next step, signal conditioning is performed, including baseline removal and
low-pass filtering. In the peak detection phase, local maxima and minima are sought in both
selected axes. The outputs of the peak detection blocks are the interval lengths between
the maximum points (I A,max , IB,max ) and the interval lengths between the minimum points
(I A,min , IB,min ) on both axes. It has been described in the literature that motion artifacts
can generate spurious periodicities [48]. In order to reduce the number of false detections,
the median value of the detected period lengths is calculated. Thus, the output of the
bolus-side computation is the four estimated period lengths, which should ideally all be
equal to the actual IBI.
On the server side, post-processing is conducted by a Multi-Layer Perceptron (MLP)
artificial neural network comprising four input and eight output neurons. Consequently, it
can classify IBI values into eight categories between 50 and 130 bpm [50].
The neural network was trained using parallel ECG data as labels. The control
measurements were conducted using a Polar ECG device. The distribution of mean absolute
error values for the detection algorithm is illustrated in Figure 11. The developed algorithm
exhibits a 10% error rate, which is inadequate for medical or veterinary measurement but
may offer useful insight in agricultural contexts.
Sensors 2024, 24, 6976 16 of 20
Figure 11. The mean absolute error(MAE) of heart rate detection in the bolus and after postprocessing
on the server. The mean heart rate of the dairy cattle is in range 700–800 ms, so the error is in 10%.
4. Discussion
This section presents a comprehensive overview of the principal challenges associated
with the development of a rumen bolus. The novel features of the device include an ex-
tended operational lifespan, the capacity for lifelong monitoring, on-device data processing
to yield physiologically meaningful insights, and, in particular, the ability to obtain heart
rate data from the sensor. Based on the literature comparison, it is striving to be at the
forefront of sensors in the market if it is marketed as a product. It is capable of measuring
all the characteristics defined in [44], and it can also detect rumination and HR levels. The
connection between HR and stress has been shown in several studies [42,51,52] making HR
detection an important feature. Thus, stress can be detected through the HR, which affects
the animal’s reproductive capacity and milk production [52]. The HR can also be helpful in
monitoring the state of health and calving.
The principal design constraints were the form factor and the obligatory requirement
for longevity. In the paper, we outlined the design and implementation of the actual
hardware, as well as the design and implementation of the firmware, with special emphasis
on the communication and the measurement strategy. It is our conclusion that the optimal
strategy is to conduct the primary evaluation of the data within the firmware, with the
bolus transmitting already physiologically interpretable, compact data via the gateway to
the server. In our evaluation, the primary characteristics that should be analyzed inside
the bolus are the number of drinks, the rumen temperature, the activity of movement,
the rumination time, and the heart rate. The calculation of these characteristics can be
performed using a variety of algorithms, some of the on-device solutions are presented
in this paper. It appears that it is possible to evaluate data concerning the quantity of
nourishment ingested and the duration spent in either a standing or recumbent position.
These parameters may serve as potential avenues for further research.
We propose that the server should subsequently undertake a post-processing of the
primary characteristics that were transmitted. The following fields may benefit from the
implementation of post-processing techniques:
• Through post-processing of the heart rate data, it is possible to obtain valid data free of
the influence of false periods. Furthermore, data processing should incorporate data
from the sensor in the stable, as well as data from the animal administration systems,
including expected estrus, medication, and other relevant variables.
• An elevated temperature in the rumen may also indicate increased fermentation
activity. However, when this is considered alongside the time spent ruminating and
the temperature in the barn, valuable information about fever can be obtained. The
same data can be used to infer heat stress by comparing them with stable humidity
and temperature.
• The detection of estrus on the server side is feasible based on the analysis of movement
activity and temperature data.
• The combination of activity and drinking data enables the detection of calving events.
Complex monitoring of the animal may indicate the presence of additional health
issues, including disease and lameness, through the observation of altered behav-
ioral patterns.
The sensor’s steady positioning renders it a dependable data collection instrument for
livestock farming, facilitating continuous monitoring in the stable. In the pasture, however,
it is often not feasible to establish an adequate radio communication infrastructure due to
the limited area that can be covered by gateways, which are subject to attenuation from
the animal’s body. Consequently, external sensors are now considered a superior option
in pasture. Nevertheless, for grazing animals, rumen bolus sensors can be developed that
send information intermittently, for example at milking for dairy cows or at watering for
beef cattle. This information can then be transmitted by gateways placed at the given
location. The prospective future development options for the rumen bolus are as follows:
Sensors 2024, 24, 6976 18 of 20
Author Contributions: Conceptualization, G.S. and É.H.; methodology, G.V.; writing—original draft
preparation, É.H. and G.V.; visualization, P.U.; supervision, G.S.; project administration, É.H.; funding
acquisition, É.H. All authors have read and agreed to the published version of the manuscript.
Funding: This research was funded by NKFIH Hungary grant number 2020-1.1.2-PIACI-KFI-2020-00109.
Institutional Review Board Statement: The study was conducted in accordance with the Declaration
of Helsinki, and approved by the Animal Welfare Committee of Hungarian University of Agricultural
and Life Sciences Szent István Campus under approval nr. MATE-MKK-2023/23.
Informed Consent Statement: Not applicable
Data Availability Statement: The datasets collected and analyzed during the current study are
available in the following repository on GitHub: https://github.com/Bolus-2021/Bolus_2024_data
(accessed on 13 October 2024). This repository contains all relevant data and supplementary materials
required to reproduce the findings of this study.
Acknowledgments: Thank You for Levente Kovács and Martin Czirok for their expertise and advice.
Conflicts of Interest: The authors declare no conflicts of interest.
References
1. Knight, C.H. Review: Sensor techniques in ruminants: More than fitness trackers. Animal 2020, 14, S187–S195. [CrossRef]
2. Berckmans, D. Precision livestock farming. Comput. Electron. Agric. 2008, 62, 1. [CrossRef]
3. Berckmans, D. Precision livestock farming technologies for welfare management in intensive livestock systems. Rev. Sci. Tech.
2014, 33, 189–196. [CrossRef]
4. Cabrera, V.E.; Fadul-pacheco, L. Future of dairy farming from the Dairy Brain perspective: Data integration, analytics, and
applications. Int. Dairy J. 2021, 121, 105069. [CrossRef]
Sensors 2024, 24, 6976 19 of 20
5. Caja, G.; Castro-Costa, A.; Knight, C.H. Engineering to support wellbeing of dairy animals. J. Dairy Res. 2016, 83, 136–147.
[CrossRef]
6. Daum, T.; Ravichandran, T.; Kariuki, J.; Chagunda, M.; Birner, R. Connected cows and cyber chickens? Stocktaking and case
studies of digital livestock tools in Kenya and India. Agric. Syst. 2022, 196, 103353. [CrossRef]
7. El Bilali, H.; Bottalico, F.; Ottomano Palmisano, G.; Capone, R. Information and communication technologies for smart and
sustainable agriculture. In 30th Scientific-Experts Conference of Agriculture and Food Industry: Answers for Forthcoming Challenges in
Modern Agriculture; Springer: Cham, Switzerland, 2020; Volume 78, pp. 321–334. [CrossRef]
8. Michie, C.; Andonovic, I.; Davison, C.; Hamilton, A.; Tachtatzis, C.; Jonsson, N.; Duthie, C.A.; Bowen, J.; Gilroy, M. The internet
of things enhancing animal welfare and farm operational efficiency. J. Dairy Res. 2020, 87, 20–27. [CrossRef]
9. Beszédes, B.; Széll, K.; Györök, G. A Highly Reliable, Modular, Redundant and Self-Monitoring PSU Architecture. Acta Polytech.
Hung. 2020, 17, 233–249. [CrossRef]
10. Gu, J.Q.; Wang, Z.H.; Gao, R.H.; Wu, H.R. Cow behavior recognition based on image analysis and activities. Int. J. Agric. Biol.
Eng. 2017, 10, 165–174. [CrossRef]
11. Alzahal, O.; Steele, M.A.; Valdes, E.V.; Mcbride, B.W. Technical note: The use of a telemetric system to continuously monitor
ruminal temperature and to predict ruminal pH in cattle. J. Dairy Sci. 2009, 92, 5697–5701. [CrossRef]
12. Borchers, M.R.; Chang, Y.M.; Proudfoot, K.L.; Wadsworth, B.A.; Stone, A.E.; Bewley, J.M. Machine-learning-based calving
prediction from activity, lying, and ruminating behaviors in dairy cattle. J. Dairy Sci. 2017, 100, 5664–5674. [CrossRef]
13. Ledgerwood, D.N.; Winckler, C.; Tucker, C.B. Evaluation of data loggers, sampling intervals, and editing techniques for measuring
the lying behavior of dairy cattle. J. Dairy Sci. 2010, 93, 5129–5139. [CrossRef]
14. Alsaaod, M.; Römer, C.; Kleinmanns, J.; Hendriksen, K.; Rose-Meierhöfer, S.; Plümer, L.; Büscher, W. Electronic detection of
lameness in dairy cows through measuring pedometric activity and lying behavior. Appl. Anim. Behav. Sci. 2012, 142, 134–141.
[CrossRef]
15. Nagl, L.; Schmitz, R.; Warren, S.; Hildreth, T.; Erickson, H.; Andresen, D. Wearable sensor system for wireless state-of-health
determination in cattle. In Proceedings of the 25th Annual International Conference of the IEEE Engineering in Medicine and
Biology Society (IEEE Cat. No. 03CH37439), Cancun, Mexico, 17–21 September 2003; Volume 4, pp. 3012–3015.
16. SmaxTec. Available online: https://smaxtec.com/en/smaxtec-system-in-detail/ (accessed on 27 June 2024).
17. Hokofarm Group. Available online: https://hokofarmgroup.com/ (accessed on 27 June 2024).
18. Moonsyst. Moonsyst Cattle Monitoring. Available online: https://moonsyst.com/bolus (accessed on 2 April 2023).
19. Ghirardi, J.; Caja, G.; Garín, D.; Casellas, J.; Hernández-Jover, M. Evaluation of the retention of electronic identification boluses in
the forestomachs of cattle. J. Anim. Sci. 2006, 84, 2260–2268. [CrossRef]
20. Nagyné Hajnal, É.; Kovács, L.; Vakulya, G.; Hajnal, É.; Kovács, L.; Vakulya, G. Dairy Cattle Rumen Bolus Developments with
Special Regard to the Applicable Artificial Intelligence (AI) Methods. Sensors 2022, 22, 6812. [CrossRef]
21. Ruiz-Garcia, L.; Lunadei, L. The role of RFID in agriculture: Applications, limitations and challenges. Comput. Electron. Agric.
2011, 79, 42–50. [CrossRef]
22. Mottram, T.T. Is A Lifetime Rumen Monitoring Bolus Possible? 2010. Available online: http://precisiondairy.com/proceedings/
s11mottram.pdf (accessed on 2 April 2023).
23. Zhang, L.; Lu, J.; Nogami, H.; Okada, H.; Itoh, T.; Arai, S. Solid-state pH sensor prototype for real-time monitoring of the rumen
pH value of Japanese cows. Microsyst. Technol. 2018, 24, 457–463. [CrossRef]
24. Mottram, T.; Lowe, J.; McGowan, M.; Phillips, N. A wireless telemetric method of monitoring clinical acidosis in dairy cows.
Comput. Electron. Agric. 2008, 64, 45–48. [CrossRef]
25. Sato, S.; Mizuguchi, H.; Ito, K.; Ikuta, K.; Kimura, A.; Okada, K. Technical note: Development and testing of a radio transmission
pH measurement system for continuous monitoring of ruminal pH in cows. Prev. Vet. Med. 2012, 103, 274–279. [CrossRef]
[PubMed]
26. Dogan, H.; Yavuz, M. A new wireless bolus sensor with active RFID tag to measure rumen pH. Fresenius Environ. Bull. 2018,
27, 1031–1037.
27. Lokhorst, C. Practical experiences of IoT applications in the IoF2020 Dairy Trial. In Practical Precision Livestock Farming; Banhazi,
T., Halas, V., Maroto-Molina, F., Eds.; Wageningen Academic: Wageningen, The Netherlands, 2023; pp. 269–292.
28. D’Alessandro, A.G.; De Palo, P.; Maggiolino, A.; Mele, M. ASPA 25th Congress Book of Abstract. Ital. J. Anim. Sci. 2023, 22, 1–320.
[CrossRef]
29. Ammer, S.; Lambertz, C.; Gauly, M. Is reticular temperature a useful indicator of heat stress in dairy cattle? J. Dairy Sci. 2016,
99, 10067–10076. [CrossRef] [PubMed]
30. Džermeikait, K. Innovations in Cattle Farming: Application of Innovative. Animals 2023, 13, 780. [CrossRef] [PubMed]
31. Lees, A.M. Evaluating rumen temperature as an estimate of core body temperature in Angus feedlot cattle during summer. Int. J.
Biometeorol. 2019, 63, 939–947. [CrossRef] [PubMed]
32. Vázquez-Diosdado, J.A.; Miguel-Pacheco, G.G.; Plant, B.; Dottorini, T.; Green, M.; Kaler, J. Developing and evaluating threshold-
based algorithms to detect drinking behavior in dairy cows using reticulorumen temperature. J. Dairy Sci. 2019, 102, 10471–10482.
[CrossRef]
Sensors 2024, 24, 6976 20 of 20
33. Nagyné Hajnal, É.; Vakulya, G.; Udvardy, P. Long Term Rumen Temperature Analysis of Dairy Cattle with Help of Bolus
Sensor. In Proceedings of the AIS 2022—17th International Symposium on Applied Informatics and Related Areas—Proceedings,
Székesfehérvár, Hungary, 17 November 2022; pp. 12–16.
34. Hanušovský, O.; Bíro, D.; Šimko, M.; Gálik, B.; Juráček, M.; Rolinec, M.; Herkel’, R. Drinking regime evaluation with continuous
ruminal monitoring boluses. Acta Fytotech. Zootech. 2017, 20, 1–5. [CrossRef]
35. Ipema, A.H.; Goense, D.; Hogewerf, P.H.; Houwers, H.W.; van Roest, H. Pilot study to monitor body temperature of dairy cows
with a rumen bolus. Comput. Electron. Agric. 2008, 64, 49–52. [CrossRef]
36. Riaboff, L.; Shalloo, L.; Smeaton, A.F.; Couvreur, S.; Madouasse, A.; Keane, M.T. Predicting livestock behaviour using accelerome-
ters: A systematic review of processing techniques for ruminant behaviour prediction from raw accelerometer data. Comput.
Electron. Agric. 2022, 192, 106610. [CrossRef]
37. Arai, S.; Okada, H.; Sawada, H.; Takahashi, Y.; Kimura, K.; Itoh, T. Evaluation of ruminal motility in cattle by a bolus-type
wireless sensor. J. Vet. Med. Sci. 2019, 81, 1835–1841. [CrossRef]
38. Benaissa, S.; Nikolayev, D.; Vermeeren, G.; Deprez, K.; Goethals, J.; Sonck, B.; Tuyttens, F.A.M.; Martens, L.; Plets, D.; Joseph, W.;
et al. Design and Experimental Validation of a Multiband Conformal Patch Antenna for Animal-Ingestible Bolus Applications.
IEEE Trans. Antennas Propag. 2023, 71, 6365–6377. [CrossRef]
39. Alexy, M.; Biszkup, M.; Barkó, B.; Balogh, P.; Márton, A.; Pajor, G.; Szabó, S.; Molnár, B. Digital solutions for tracking livestock
movement in outdoor farming systems. In Proceedings of the IEEE (Szerk.), 2nd International Conference on Cognitive Mobility
(CogMob), Budapest, Hungary, 19–20 October 2023; pp. 10–16.
40. Ghassemi Nejad, J.; Ju, M.S.; Jo, J.H.; Oh, K.H.; Lee, Y.S.; Lee, S.D.; Kim, E.J.; Roh, S.; Lee, H.G. Advances in Methane Emission
Estimation in Livestock: A Review of Data Collection Methods, Model Development and the Role of AI Technologies. Animals
2024, 14, 435. [CrossRef] [PubMed]
41. Tsakiridis, N.L.; Diamantopoulos, T.; Symeonidis, A.L.; Theocharis, J.B.; Iossifides, A.; Chatzimisios, P.; Pratos, G.; Kouvas, D.
Versatile Internet of Things for Agriculture: An eXplainable AI Approach. In Artificial Intelligence Applications and Innovations;
Maglogiannis, I., Iliadis, L., Pimenidis, E., Eds.; Springer: Cham, Switzerland, 2020; pp. 180–191.
42. Kovács, L.; Jurkovich, V.; Bakony, M.; Szenci, O.; Póti, P.; Tőzsér, J. Welfare implication of measuring heart rate and heart rate
variability in dairy cattle: Literature review and conclusions for future research. Animal 2014, 8, 316–330. [CrossRef] [PubMed]
43. Kovács, L.; Kézér, F.L.; Ruff, F.; Jurkovich, V.; Szenci, O. Heart rate, cardiac vagal tone, respiratory rate, and rectal temperature in
dairy calves exposed to heat stress in a continental region. Int. J. Biometeorol. 2018, 62, 1791–1797. [CrossRef] [PubMed]
44. Lee, M.; Seo, S. Wearable wireless biosensor technology for monitoring cattle: A review. Animals 2021, 11, 2779. [CrossRef]
45. Routray, S.K.; Mohanty, S. Principles and Applications of Narrowband Internet of Things (NBIoT); IGI Global: Hershey, PA, USA, 2021.
46. Pagano, A.; Croce, D.; Tinnirello, I.; Vitale, G. A survey on LoRa for smart agriculture: Current trends and future perspectives.
IEEE Internet Things J. 2022, 10, 3664–3679. [CrossRef]
47. POM-C. POM-C Usage. Available online: https://www.ensingerplastics.com/en/shapes/acetal-tecaform-ah-black#/product-
technical-detail-collapse-item-3-lvl-1 (accessed on 2 April 2023).
48. Curone, D.; Tognetti, A.; Secco, E.L.; Anania, G.; Carbonaro, N.; De Rossi, D.; Magenes, G. Heart rate and accelerometer data
fusion for activity assessment of rescuers during emergency interventions. IEEE Trans. Inf. Technol. Biomed. 2010, 14, 702–710.
[CrossRef]
49. Vakulya, G.; Hajnal, É.; Udvardy, P. Experimental Bolus Sensor for Dairy Cattle. In Proceedings of the 2022 IEEE 20th
Jubilee International Symposium on Intelligent Systems and Informatics (SISY), Subotica, Serbia, 15–17 September 2022;
pp. 000157–000162.
50. Hajnal, É.; Vakulya, G.; Udvardy, P. Heart Rate (HR) Detection by Cattle Rumen Bolus. In Proceedings of the 2023 IEEE 27th
International Conference on Intelligent Engineering Systems (INES), Nairobi, Kenya, 26–28 July 2023; pp. 000155–000160.
51. Mohr, E.; Langbein, J.; Nürnberg, G. Heart rate variability: A noninvasive approach to measure stress in calves and cows. Physiol.
Behav. 2002, 75, 251–259. [CrossRef]
52. Hagen, K.; Langbein, J.; Schmied, C.; Lexer, D.; Waiblinger, S. Heart rate variability in dairy cows—Influences of breed and
milking system. Physiol. Behav. 2005, 85, 195–204. [CrossRef]
53. Neethirajan, S.; Kemp, B. Digital twins in livestock farming. Animals 2021, 11, 1008. [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual
author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to
people or property resulting from any ideas, methods, instructions or products referred to in the content.