2018 IEEE 15th International Conference on e-Business Engineering (ICEBE)
A Data Collection Collar for Vital Signs of Cows on the Grassland Based on LoRa
Qi LI Zhanghua LIU Junsheng XIAO
School of Information Engineering School of Information Engineering School of Information Engineering
Inner Mongolia University of Science Inner Mongolia University of Science Inner Mongolia University of Science
and Technology and Technology and Technology
Baotou 014010, China Baotou 014010, China Baotou 014010, China
e-mail: richey@[Link] e-mail: 804593308@[Link] e-mail: xjsok@[Link]
Abstract—In recent years, animal husbandry in China has gateway is composed of Raspberry Pi and SX1301. The Lora
developed rapidly. However, due to poor network environment terminal node is worn on the neck of the grassland cow and
in pastoral areas, IoT technology is difficult to apply. Due to is responsible for collecting vital signs data of the cattle.
the lack of effective supervision, livestock suffer from varying Collected data is sent to the gateway via LoRa wireless
degrees of health problems. This has seriously affected the
technology. The gateway is responsible for collecting the
development of animal husbandry. The emergence of low-
power, long-distance Internet of Things technologies, data from the terminal node and uploading the data to the
represented by Lora, has made it possible to establish a real- data management server via Ethernet. Data Management
time monitoring system for the behavior of livestock. This Center needs to process and analyze the collected data. Then
system includes nodes, gateways, and servers, and is based on provide the results of the data analysis to the government and
LoRaWAN. These nodes take the SX1278 as the core and herdsmen. The system can provide timely information
integrate the STM32L151 low-power controller, GPS, and support for herdsmen, and at the same time can monitor the
accelerometer. The system is tested and analyzed. The herd's estrus status. The system can also analyze the health
experimental results show that the scheme has the status of livestock by comparing previous data.
characteristics of long communication distance, low power
consumption, convenient networking, and good real-time
performance. It has a wide range of application prospects.
Keywords—LoRa, cow smart collar, accelerometer, GPS, STM32
I. INTRODUCTION
The development of the Low Power Wide Area Network
(LPWAN) in the era of the IoT has accelerated the
development of the IoT in low power consumption, low cost,
wide coverage, and large capacity. LoRa, as a long-distance
communication technology of LPWAN, solves the
contradiction between the long-distance transmission and low
power consumption[1]. LoRa, as a new type of wireless Fig.1. The overall structure of the system
communication technology, uses advanced spread spectrum
modulation technology to improve the link's anti-interference
III. DATA COLLECTION NODE HARDWARE AND SOFTWARE
ability and stability[13]. The SX1278 module uses LoRa
DESIGN
technology to meet the requirements of long-distance
communication, high anti-interference ability and low power A. Data collection node hardware design
consumption. Comparing two mature LPWAN technologies,
Lora and NB-IoT, because of the poor network environment The design of the terminal node shown in Figure 2. The
in the grasslands and the fact that many remote locations do node hardware mainly includes MCU, SX1278RF module,
GPS module, accelerometer module and power module. The
not even have a network, the NB-IoT technology is not
node is mainly responsible for the collection of vital signs
suitable for smart livestock farming.
data of grassland cattle. The STM32L151 is the main
In this paper, Lora technology is applied to the wisdom of microcontroller with low power consumption.
animal husbandry, the use of GPS locators to capture Accelerometers are used to collect livestock heads down to
grassland cattle trajectory; the use of accelerometers to collect graze. Accelerometers are also used to collect motion data.
grassland cattle grazing data, health data. It solves the The data collected by the acceleration sensor is used to
problem of manual collection and observation which analyze the grazing conditions, estrus status, and health
consumes a lot of manpower and material resources. Also, status of livestock. GPS module is used to collect livestock
manual collection is prone to omissions. This design helps to trajectory data. The data collected by GPS is used to analyze
improve the level of automation of pastoral area. Lora's long- the trajectories, health status and conditions of grassland. At
distance communication capabilities greatly reduce the use of the same time, GPS data is combined with an electronic
relays and save costs. fence to determine whether the animal has crossed the fence.
If the animal crosses the fence, it needs to be alerted by the
II. THE STRUCTURE AND PRINCIPLE OF THE SYSTEM user application software. By recording and analyzing the
The overall design of the system is shown in Figure 1. behavioral trajectories of livestock, the system can help
The system mainly includes data management server, LoRa herders find problems in a timely manner. By collecting and
RF data transmission terminal module, and gateway. The analyzing the behavioral trajectories of livestock, the system
can help herders achieve remote grazing. Through data
978-1-5386-7992-0/18/$31.00 ©2018 IEEE 213
DOI 10.1109/ICEBE.2018.00041
collection and analysis of behavioral trajectories, the system operation. Its voltage range is 1.71 ~ 3.6V. In terms of
can issue pastoral warnings to herders through user range,LIS3DH supports four ranges of (+-)2g/4g/8g/16g. 2g
application software. At the same time, this node is the basis is sufficient for this application. In terms of accuracy,
for establishing an electronic fence. LIS3DH uses two 8-bit (16-bit total) registers to access the
current reading of an axis. Since the acceleration has two
directions, the 16-bit number is a signed integer and the actual
value is 15 bits. Calculated by the 2g range, the accuracy is
2g/2^15= 2000mg/32768 =0.061mg. In terms of interfaces, it
includes I2C and SPI. This design uses an I2C interface.
Acceleration sensor LIS3DH, with X, Y, Z three-degree-of-
freedom acceleration digital output, which can
comprehensively sense the motion information of grassland
cattle. The hardware design schematic is shown in Figure 4.
Fig.2. Overall hardware design
1) MCU control unit design
Because battery cannot be replaced during grazing, collar
nodes require polar power consumption. The choice of
microcontroller determines the performance and power
consumption of the node. Node uses STM32L151 as
controller. This is an ultra-low power controller chip. The
chip's operating frequency can reach32Mhz. This is a high-
performance chip. The chip has seven low-power modes:
low-power run mode, sleep mode, low-power sleep mode, Fig.4. Accelerometer module hardware design
stop mode with RTC, stop mode without RTC, standby mode
with RTC, and standby mode without RTC. These modes B. Gateway hardware design
facilitate low power design and can meet the node's low
The Gateway Concentrator Module is a multi-channel
power requirements.
high performance transmitter and receiver module. The
2) GPS module hardware design module is designed to receive multiple Lora packets
GPS module uses u-blox MAX-7Q. This is a very low simultaneously on multiple channels. The SX1301 is
power chip. At the same time it can ensure a higher connected to two SX1257s, which are responsible for
sensitivity. The chip supports I2C interface and UART converting in-phase quadrature digital signals into radio
interface. This is very convenient for users to use. Since the analog signals. According to the internal structure diagram of
I2C interface is occupied by the accelerometer in the design, the SX1301, the SX1301 is mainly composed of two MCUs
the GPS UART interface is used. Testing the GPS module and an ASIC (Application Specific Integrated Circuit). The
gets the following test data. The GPS module's cold start time AGC Radio management MCU connects two SX1257s via
is 50s. The module's cold start current is 40mA. The tracking the SPI bus, which is responsible for real-time automatic gain
current of this module is 30mA. The hardware design control, RF calibration and transceiver switching. The Packet
schematic is shown in Figure 3. arbiter MCU is responsible for allocating 8 LoRa modems to
multiple channels. The mechanism for arbitrating packets
includes rate, channel, RF and signal strength. IF0-IF7 are
LoRa channels. Their bandwidth is fixed at 125KHz. Each
channel can set the center frequency. Each channel can
receive 6 kinds of LoRa signals from SF7-SF12. The
bandwidth of the IF8 channel supports 125/250/500Khz for
high-speed communication between gateways. The IF9
澳 channel is used to transmit and receive FSK signals. The
Fig.3. GPS module hardware design hardware design is shown in Figure 5.
3) Accelerometer module hardware design
This design uses the MEMS accelerometer chip LIS3DH
produced by ST. It is a low power, high precision and high
sensitivity chip . LIS3DH works in two ways. One is that it
has built-in algorithms to handle common application
scenarios, and the other is that users can read the underlying
acceleration data through SPI/I2C and perform further data 澳
processing. This design combines these two methods .In Fig.5. Gateway hardware design
terms of power consumption , Current is only 2μA in low
power mode. Power consumption is only 15μA in normal
214
C. Data collection node Software design time, GPS shutdown time, LoRa data upload cycle, GPS duty
The system uses LoRaWAN network protocol. The cycle, transmit power, etc.澳 How to set these parameters is also
terminal node is a CLASS A terminal device. Terminal determined according to the activity rules of the cattle.澳 In
devices in the LoRaWAN network are divided into Class general, the GPS boot time can be set at 5:30 in the morning.澳
A/B/C 3 classes. These three types of devices basically cover GPS shutdown time can be set at 23:00.澳 In this application,
all IoT application scenarios. Class A equipment adopts the FPort is set to 8.澳 Because the data frame carries the payload,
ALOHA protocol to report data on demand. After each uplink, FRMPayload must be encrypted before the MIC calculation.澳
two brief downlink receiving windows are followed to The encryption scheme used is based on the generic algorithm
achieve bidirectional data transmission. This type of described in IEEE802.15.4/2006 Annex B [IEEE802154]
operation is the most power-efficient. Since the terminal node using AES with a key length of 128 bits. Data frame payload
requires the battery to be stable for more than six months, the (FRMPayload) content design is shown in Table 5.
terminal node is set to the CLASS A operating mode. This TABLE V. FRMPAYLOAD CONTENT DESIGN
type of terminal device must wait until the terminal reports
data before the server can issue commands to it. The Class B No. content meaning
1 0x01051EFF Daily boot time,5:30
terminal also has a receive window at a specified time in 2 0x021700FF Daily shutdown
addition to a random receive window like a Class A terminal. time,23:00
In order for the terminal to open the receiving window at the 3 0x03001EFF GPS work cycle,30
specified time, the terminal needs to receive the time minute
synchronization beacon from the gateway. The Class C 4 0x040001FF LoRa work cycle,1
minute
terminal basically keeps the receiving window open. It just 5 0x05000EFF Node transmit
shuts down when sending data, so it consumes more power. power,14dbm
1) MACPayload downlink command design 2) Collar node software design
LoRa distinguishes between uplink and downlink The collar node mainly completes the acquisition of
messages. The uplink messages are sent by the collar terminal acceleration data and GPS data. At the same time, the
and forwarded to the network server via one or more collected data is reported through the Lora network. In
gateways. addition, it also needs to receive commands from the gateway.
Uplink messages use the strict mode of LoRa radio The scheduling of events in the main program is mainly done
frames. The message contains PHDR and PHDR_CRC. The by timers. For example, initialize a timer that is timed one
payload has a CRC check to ensure message integrity. The minute in the main program. When the time is up, the
uplink PHY(Physical Massage Formats) is shown in Table 1. interrupt program will be executed to upload data. The node
goes into sleep mode after each upload of data. After that, the
TABLE I. UPLINK PHY FRAME FORMAT
device needs to be woken up by the next event. In order to
Preamble PHDR PHDR_CRC PHYPayload CRC prevent the program from falling into an infinite loop, a
The downlink messages are sent by the network server watchdog reset procedure is added where an infinite loop is
and forwarded to a single terminal through a single gateway. likely to occur. Ensure that the device can be reset
The downlink message also uses the strict mode of the radio immediately after a crash. The software澳 workflow of the
frame. The message contains PHDR and PHDR_CRC. But it collection node is shown in Figure 6.
is worth noting that there is no CRC in the downlink message.
The downlink PHY is shown in Table 2.
TABLE II. DOWNLINK PHY FRAME FORMAT
Preamble PHDR PHDR_CRC PHYPayload
All uplink and downlink messages of LoRa carry
PHYPayload. The PHY payload starts with a 1-byte MAC
header (MHDR), followed by the MAC payload
(MACPayload), and finally a 4-byte MAC check code (MIC).
The MAC frame format is shown in Table 3.
TABLE III. MAC FRAME FORMAT
MHDR MACPayload MIC
Which MACPayload is what we need to design. The
MACPayload, also known as the "data frame", includes frame
header (FHDR), port (FPort) and frame payload
(FRMPayload). Where port and payload are designable.
MACPayload frame format is shown in Table4.
TABLE IV. MACPAYLOAD FRAME FORMAT
FHDR Fport FRMPayload
Considering the low power performance of the terminal
node, some working parameters of the terminal node need to
be set by the downlink command. These include GPS boot
澳
215
[Link] node software flow chart Group Distance/km Number of Success
packets rate
received
IV. SYSTEM TESTING AND ANALYSIS 1 0.21 200 100%
It is important to establish a suitable test environment to 2 0.40 200 100%
3 0.54 200 100%
verify the viability of the system. The entire network includes 4 0.61 200 100%
five collection nodes, one gateway, and one server during 5 0.70 200 100%
testing. The RF center frequency of the device under test is 6 0.80 200 100%
433Mhz. Considering the requirements of low power 7 0.92 200 100%
consumption, the transmit power of the acquisition node is set 8 1.10 198 99%
9 1.21 198 99%
to 18dbm. Considering the geographical environment of the 10 1.46 194 97%
grasslands, we tested them in two different environments. The 11 1.63 190 95%
first test environment is a relatively empty and straight road. 12 1.81 180 90%
Another test environment is between buildings in a 13 2.03 164 82%
community. The first environment represents a relatively 14 2.25 106 53%
open environment on the grasslands, and this environment is It can be seen from Tables 6 and 7. As the communication
very close to the real grassland environment. The first distance increases, the success rate of data reception
environment is shown in Figure 7. The second scenario continues to decrease. The communication distance on an
represents the hilly environment on the grasslands. The empty road will be greater than between buildings. Tested on
second environment is shown in Figure 8. We have done a lot an open road, the packet loss rate is 18%, when the distance is
of data sending and receiving tests in these two environments. 2.03 km. Tested between buildings, the packet loss rate is
In each set of tests, the collection node will transmit 200 20%, when the communication distance is 0. 9km. Tests show
packets. The collection node sends data every 30s. Part of the that the system is feasible.
test results are shown in the Table 6 and Table 7. The test results show that the data acquisition node has
the characteristics of extremely low power consumption, long
communication distance and strong anti-interference ability.
The system can provide a feasible solution for herders
intelligent grazing and monitoring. The system can improve
the efficiency and breeding level of herders.
V. CONCLUSION
The article is based on practical applications. The article
澳 澳 is based on the understanding of the principles and
[Link] test environment diagram advantages of LoRa technology and designed the system for
the current situation of pastoral grazing. From the test results
of the experiment, the system is stable in operation, and the
power consumption is extremely low. It can work
continuously for more than half a year under the condition of
battery power supply. It provides a feasible solution for the
herdsmen to realize real-time monitoring of grassland cattle.
ACKNOWLEDGMENT
This work is supported by Inner Mongolia Science and
Technology Innovation Guidance Fund Project (2016CXYD-
5). In addition, this work is based on the construction of a big
data analysis platform for the Inner Mongolia grassland
Fig.8. Second test environment diagram animal husbandry based on anti-counterfeiting. The
correspondent is LIU Zhanghua, The address is Inner
Mongolia Kundulun District of Baotou city Arden Street No.
TABLE VI. TEST RESULTS BETWEEN BUILDINGS
7 school of information engineering Inner Mongolia
Group Distance/km Number of Success University of Science and Technology.
packets rate
received REFERENCES
1 0.25 200 100%
2 0.27 200 100% [1] Rashmi Sharan Sinha,Yiqiao Wei,Seung-Hoon Hwang. A survey on
3 0.45 200 100% LPWA technology: LoRa and NB-IoT[J]. ICT Express,2017,3(1).
4 0.50 200 100% [2] Tian [Link] Adaptive MAC Protocol for SDCS System Based on
5 0.63 196 98% LoRa Technology[A]. Research Institute of Management Science
6 0.70 196 98% and Industrial [Link] of 2017 2nd International
Conference on Automation,Mechanical Control and Computational
7 0.85 170 85%
Engineering(AMCCE 2017)[C].Research Institute of Management
8 0.90 160 80%
Science and Industrial Engineering:,2017:6.
9 1.10 130 65%
10 1.23 60 30% [3] Wenchang Wu. Application of LORA Spread Spectrum Technology
On Intelligent Water Meter[A]. Research Institute of Management
Science and Industrial [Link] of 2017 2nd
TABLE VII. TEST RESULTS ON STRAIGHT ROADS
International Conference on Materials Science,Machinery and
216
Energy Engineering(MSMEE 2017)[C].Research Institute of
Management Science and Industrial Engineering:,2017:4.
[4] Augustin Aloÿ s,Yi Jiazi,Clausen Thomas,Townsley William Mark.
A Study of LoRa: Long Range & Low Power Networks for the
Internet of Things.[J]. Sensors (Basel, Switzerland),2016,16(9).
[5] Semtech Corporation; Semtech LoRa(R) Technology Selected by
Schneider Electric for Next Generation Metering and Smart Building
Applications[J]. Computers, Networks &
Communications,2015.
[6] Juan Ignacio Huircán,Carlos Muñoz,Héctor Young,Ludwig Von
Dossow,Jaime Bustos,Gabriel Vivallo,Marcelo Toneatti. ZigBee-
based wireless sensor network localization for cattle monitoring in
grazing fields[J]. Computers and Electronics in
Agriculture,2010,74(2).
[7] Kae Hsiang Kwong,Tsung-Ta Wu,Hock Guan Goh,Konstantinos
Sasloglou,Bruce Stephen,Ian Glover,Chong Shen,Wencai Du,Craig
Michie,Ivan Andonovic. Practical considerations for wireless sensor
networks in cattle monitoring applications[J]. Computers and
Electronics in Agriculture,2011,81.
[8] E.S. Nadimi,H.T. Søgaard,T. Bak,F.W. Oudshoorn. ZigBee-based
wireless sensor networks for monitoring animal presence and pasture
time in a strip of new grass[J]. Computers and Electronics in
Agriculture,2007,61(2).
[9] Ayan Kumar Das,Rituparna Chaki,Kashi Nath Dey. Secure energy
efficient routing protocol for wireless sensor network[J].
Foundations of Computing and Decision Sciences,2016,41(1).
[10] Liang Xue,Ying Liu,Zhi-Qun Gu,Zhi-Hua Li,Xin-Ping [Link]
Design of Clustering and In-cluster Data Route for Heterogeneous
Wireless Sensor Networks[J].International Journal of Automation
and Computing,2017,14(06):637-649.
[11] Energy-efficient multipath routing in wireless sensor network
considering wireless interference[J].Journal of Control Theory and
Applications,2011,9(01):127-132.
[12] Rama K. YEDAVALLI,Rohit K. [Link] of
wireless sensor networks to aircraft control and health management
systems[J].Journal of Control Theory and
Applications,2011,9(01):28-33.
[13] Sujuan Liu. A Low-power Real-time Air Quality Monitoring System
Using LPWAN based on LoRa[A]. IEEE Beijing Section.2016 13th
IEEE International Conference on Solid-State and Integrated Circuit
Technology(ICSICT) Proceedings[C].IEEE Beijing Section:,2016:3.
[14] Tjeerd Kimman,Maarten Hoek,Mart C.M. de Jong. Assessing and
controlling health risks from animal husbandry[J]. NJAS -
Wageningen Journal of Life Sciences,2013,66.
[15] Tian Deng. An Improved LoRaWAN Protocol Based on Adaptive
Duty Cycle[A]. IEEE Beijing SectionࠊGlobal Union Academy of
Science and Technologyࠊ Chongqing Global Union Academy of
Science and TechnologyࠊChongqing Geeks Education Technology
Co., [Link] of 2017 IEEE 3rd Information Technology and
Mechatronics Engineering Conference(ITOEC 2017)[C].IEEE
Beijing Section ࠊ Global Union Academy of Science and
Technologyࠊ Chongqing Global Union Academy of Science and
Technology ࠊ Chongqing Geeks Education Technology Co.,
Ltd:,2017:4.
217