Development of an IoT-Based (LoRaWAN) Tractor Tracking System

The use of new technologies and precision agriculture (PA) in farms has become more important due to the need for enough agricultural production for increasing world population opposed to decreasing farm areas. PA covers wide range of technologies like sensors, microcontroller-based devices, machine to machine communication technologies, global positioning systems but, the investment costs of these devices are literally expensive which become a constraint for farmers especially in developing countries. Internet of things (IoT) technology is a new era that agricultural production will be the one area mostly affected by. LoRaWAN is one of the new communication technologies for IoT which enables almost everything on the planet to be connected to internet and deliver high amount of data with no expense. In this research by using the advantages of LoRaWAN, a new IoT-based tractor tracking system including a LoRaWAN module and a web-based software was developed, and the test results were evaluated. As a result, it was found that the developed system was capable of measuring and sending tractor sensor data along with geospatial position of the tractor and serving the data on the web-based user interface.


Introduction
The world population is expected to reach 9 billion people in 2050, and today's 3.75 tons per hectare of wheat production should be as high as 6.25 tons per hectare (Meola 2017).This projection necessitates a 70% wheat production yield increase to feed that much population by 2050 however, it becomes more difficult to achieve this projection in countries where average farm areas are very small, the yield is low and PA technology use in farms is weak.Pierce & Novak (1999) have defined the PA as doing the right thing, in the right place and on the right time.Without enabling precision agriculture in the farms, yield and quality losses are inevitable.So, new technologies should be integrated into agricultural machines to implement PA to the farms to produce higher quantity and quality of product despite of the fact that the farm areas are consistently decreasing.
Tractors are the main power source in the farms so, new technologies should be integrated on them at first to make the farm practices more efficient.However, developing countries have huge barriers to implement new technologies on their tractors.In these countries, farmers' income is very low which forces farmers to use very old tractors that are incompatible to use with new high-tech PA devices (Onwunde et al. 2018).On the contrary, in developed countries farms are so big that farmers can use new high-technology tractors with several sensors and GPS (global positioning system) implemented.
In USA it is known that GNSS (global navigation satellite systems) technologies are used by more than 80% of farmers, and the use of GPS-based automatic steering systems has moved from 6% to 78% from 2005 to 2017 which requires the use of newer tractors (Erickson et al. 2017).Moreover, the use of precision farming technologies has reached 35% in Europe (Das et al 2019).In Turkey more than 45% of 1.8 million tractors (Turkish Statistical Institute 2019a) are more than 25 years old, and 21.4% of all are more than 10 years old (Turkish Statistical Institute 2019b) which makes the integration of PA technology on tractors very difficult.The farms in Adana region could be a good example of the need for implementation of new technologies on tractors however, farmers are having difficulty to invest in these devices.According to the survey that was done in Adana region with seven big farms, each one having more than 50 hectares of arable land and 3 tractors, it was revealed that in none of them PA technology was used on tractors (Civelek 2020).In a recent study to determine farmers' aim to use auto guidance systems in Adana region, it was found out that 96.4% of the farmers did not use PA technologies, since they did not know about it (Keskin et al. 2018).In another research had been conducted in the same region, however 35.9% of the farmers did not know about PA, 92.3% of them reported that they had followed new trends in agriculture, yet 61.5% of them were interested in satellite positioning systems on the contrary not being interested in automatic steering or variable rate application systems by 38.5% and 28.2%, respectively (Keskin & Sekerli 2016).The results of the last survey in the same region showed that besides most of the participated farmers were using computer and smart phones, none of them had unmanned vehicles, whereas 3 out of 422 farmers were using sensor equipped machinery (Saygılı et al. 2020).
Today's information technology covers digitalization, big data, IoT and blockchain, and IoT is expected to have the biggest effect on agriculture.European Commission declares that the development of digitalization in agriculture depends on connecting tractors to the internet using IoT technology either using 2G or LPWAN (low-power wide area network) which have advantages like wide coverage area and low-investment costs (European Commission 2017).In the literature several studies were found based on the integration of IoT into agriculture.Some of these studies were solar-powered automated IoT-based drip irrigation system (Barman et al. 2020), IoT-based soil health monitoring and recommendation system (Bhatnagar & Chandra 2020), IoT-based technology for low-cost precision apiculture (Dasig Jr. & Mendez 2020), IoT-based smart tree management (Shabandri & Madara 2020) and frost prediction in highland crops management using IoT (Mendez & Dasig 2020) in which the importance of integration IoT in agriculture was emphasized.However, from the literature research no evidence could be found related to the use of IoT technology on tractors.LoRaWAN communication technology was used on the hardware because of having several advantages over other IoT-based communication technologies, like transmitting data up to 5 km urban and 15 km in suburban areas and no registration requirement which makes it free to use (Davcev et al. 2018;Sahana et al. 2020).The main objective of this manuscript was to explain the adoption easiness, performance, production and purchasing costs, and advantages of the developed IoT-based tractor tracking system consists of a hardware and a software.

Materials
Proposed IoT-based tractor tracking system was designed to provide farmers to track and analyze tractor performance data along with geospatial data.Overall design of the system consisted of two parts which were hardware and software.
The hardware was designed to connect several sensors such as fuel flow meter and PTO (power take off) torque meter sensors to measure fuel consumption and PTO power use.The hardware also had a GPS module to get geospatial position of the tractor on the farm using GPS satellites.All these tractor performance data were combined and sent to a server on the cloud using LoRaWAN protocol (Figure 1).One of the reasons for using LoRaWAN was that in several places of rural areas GSM (global system for mobile communication) base station coverage area is not enough which results in no internet connection.

Figure 1-General view of the designed system
Hardware's circuit diagram and the design of the motherboard were developed using Proteus software.The design of the PCB (printed circuit board) required to select proper electronic components like resistance, capacitance, crystal, regulator and microprocessors.Selected components were placed and connected to each other based on the requirements of the hardware and short-circuit tests were also conducted on the Proteus, and then PCB was produced based on the overall design (Figure 2 and 3).Microchip's PIC18F46K22 microprocessor was used as the main microprocessor of the developed hardware.Used microprocessor was capable of gathering and processing data using ADC (analogue digital converter) on which several sensors were connected.
Microchip's RN2483 LoRaWAN modulation module was used as the data transmission module to send data to the developed database on the cloud.This module was capable of sending data using either using 868 MHz frequency for Europe or 936 MHz frequency for USA.
A MODBUS communication port was also added onto the PCB for connecting a GSM module to maintain connection of the hardware to the internet where LoRaWAN communication is unavailable.For using MODBUS protocol, a MAX487 transceiver was embedded onto the motherboard.This transceiver was capable of transmitting gathered and processed data to the main microprocessor using MODBUS protocol via RS-485 port.
TELIT's SE868K7-A GPS module was chosen to get the real position data of the tractor (Figure 4).Small one-sided PCB was developed using Proteus software to integrate GPS module and to connect it to the motherboard over connection pins using 4-pin cable.The GPS module was controlled by the main microprocessor.GPS data was received in different modes by the module.After the module had fixed to the required GPS satellites, the data flowed in a row, delivered to the main microprocessor, and the data was parsed by the developed embedded software running in the main microprocessor.Using the parsed data, latitude, longitude and speed values were gathered with the sensor data.Example: $GPRMC,084722.000,A,3702.5115,N,03521.6524,E,0.17,206.91,270219,,,A*66 2 analogue and 2 digital I/O (input output) ports were added onto the developed PCB to connect different sensors to the developed hardware.Analogue ports were added to connect PTO torque meter to measure the torque and the speed of the PTO for calculation of the required power by the machine attached to the tractor, whereas digital input ports were added to connect two fuel flow meters, one for consumed fuel and the other one for returning fuel to tank from injectors, so that the fuel consumption could be calculated.The module was designed to run with a 3.3V battery to send the geospatial position of the tractor even when the engine was not running.Since most of the sensors needed higher voltage than the motherboard's supply voltage, tractor's battery was also used to supply energy for the sensors.To achieve this, a power connection port was added onto the developed hardware to energize the sensors.With the used 7805CV regulator on the developed PCB, 5V or 12V DC power could be supplied to the hardware based on the voltage required by the sensors.
A PIC16F1826 microprocessor was also embedded onto the motherboard to record and send fuel flow meters' data in case of an unexpected cut down on the energy supplied from the tractor's accumulator due to a sudden stop of the engine.At the time of an energy loss, energy was supplied to the hardware for several milliseconds by a capacitor that was soldered onto the motherboard so that the PIC16F1826 microprocessor had enough time to calculate the last measured fuel flow and send it to the main microprocessor.
The main microprocessor's embedded software was written using CCS C compiler and then it was programmed using Microchip Pickit3 circuit debugger.After the microprocessor was programmed, it was put under debugging test circle to find out and correct software errors using MPLAB software using the circuit debugger.
To deliver the data from the developed hardware to the database on the cloud, Kerlink's Wirnet Station gateway was used in the trials (Figure 5).Used gateway was capable to use whether 868 or 925 MHz frequencies for connection, more than 15 km coverage range, easy installation, and low-power consumption.

Figure 5-LoRaWAN gateway for data transmission
The developed web-based software was consisted of front-end interface, back-end interface, and a database.A database was developed using MySQL to store the data that was sent by the developed hardware to the cloud.The database was capable of storing user information along with farm area, tractor and machine make and models, and also several tractor performance data tables were included, such as Nebraska tractor performance test results to be used as a guidance for farmers to select their tractors.
The front-end interface of the software was developed on the web basis to provide flexibility for the user to get access from any type of device, such as mobile phone, tablet or PC.So, it was developed using HTML (hypertext markup language) and PHP (hypertext pre-processor) programming languages.To record data sent by the hardware to the database, an algorithm was developed using JSON (java script object notation) format using PHP (Algorithm 1).When a data packet was sent by the developed hardware over the gateway, the developed PHP file was triggered, and the data was recorded into the database.Data packet was sent in a combined format including developed module's data such as used identifier, battery status, used frequency, date, RSSI (received signal strength), SNR (signal to noise ratio) values and transmitted tractor performance and GPS data.When the developed PHP file was triggered, combined data was parsed into the blocks and recorded corresponding header of the table in the database.

Methods
As the developed hardware had 2 analogue ports for measurement of the tractor PTO torque and speed and 2 digital ports for connecting two fuel flowmeters, the measurement reliability tests of the hardware should have been done in laboratory tests.The hardware was put under calibration tests using these connection ports.For analogue port tests, voltages between 1 to 10V by 0.02V step increments were applied each port using AA Tech ADC-3303 voltage generator, measurements were read using a Fluke 17B+ multimeter, recorded in an Excel sheet, and evaluated statistically.
For the calibration of the digital ports, pulses for different frequencies were applied to digital ports using UNI-T make UTG9005C model pulse generator.10 measurements were taken in each 30 seconds for 6 different frequencies which were 4, 10, 50, 1000, 16000 and 32000 Hz, respectively.
For continuous data transmission and battery drain tests, the developed hardware was left in the laboratory sending data packages in every 2.5 minutes until the battery fully drained.The data packages were analyzed at the end of the battery life, and by using the time data recorded into the database battery life was calculated.
For data transmission and GPS tests, Kerlink's Wirnet Station gateway was set up outside of the laboratory.For GPS data gathering and transmission tests, the developed hardware was taken several places in Cukurova University Campus.Data packages sent and recorded into the database by the developed hardware were analyzed.Developed web-based software was used to confirm the data package and reliability of the front-end user interface as shown in Figure 6.Tractor's geospatial data was also checked in the front-end user interface according to the related data point (Figure 7).Lastly, SNR (signal to noise ratio) values were gathered and analyzed in the data transmission tests.
The developed hardware's bill of materials (BOM) was also calculated to compare the affordability of the developed hardware with other devices available in the market.

Results and Discussion
For analogue port calibration tests 451 data points were gathered between 1-10V.The results of the regression analyze according to the analogue sensor test were given in Table 1.The ANOVA results showed that the measured voltage had a linear increment with R 2 value of 0.99.Using gathered test data, a calibration formula was developed (Equation 1), and the main microprocessor was programmed using this formula to measure correct values for analogue ports.In the Equation 1, y is defined as applied voltage and x is the voltage measured by the developed hardware.y = 0.01737357 + 0.000189173 × x (Eq.1)For digital port calibration tests, the difference of the last recorded two pulses was calculated so that the exact pulse number could be found for 30 seconds.It was found that the difference of the pulses for each measurement points in each frequency range had a linear differentiation (Figure 8).Regression analyses showed that the changes in each 30 seconds of measurement points were linear with R 2 value of 0.99 for each frequency (Table 2).Data transmission and battery drain tests were also conducted to measure reliability of the developed hardware.To achieve this, the hardware was left to send dummy data to be saved in the developed database.Two trials were ended in total 6 months, the hardware created 49121 and 52766 data points, and the batteries were drained in 95 and 98 days which confirms the assumptions that were given in by Aqeel-Ur-Rehman et al. (2014).
From the GPS tests that were conducted outside of the laboratory it was revealed that the position of the developed hardware was sensed with a maximum 3 meters of error which was declared by the producer of the GPS module.At the time of these tests, SNR values of the data sent by the hardware was also measured and analyzed.Average SNR value was found to be -11.13±1.21dB (0.95 confidence interval) with 2.47 standard deviation which showed similar results with the LoRaWAN-based IoT device developed for personal mobility vehicles by Santa et al. (2019).
From the BOM costs calculations, it was found out that the hardware could be produced for $55 including PCB manufacturing costs and taxes, excluding software development for the hardware according to prices in May 2020.When one of the tractor manufacturer's 4G LTE (long-term evolution) based unused device price was considered, which was $795 in the same date including taxes and excluding subscription to the service, it was evaluated that the IoT-based devices could be produced cheaper than commercially available ones.This situation concludes that IoT-based tractor tracking devices could be competitive to the 4G LTE-based ones.However, according to the information gathered from dealers, when commercially available devices were compared with the developed hardware, it was found that some of these devices cannot meet the communication frequency regulations declared by the government in every country, so that the farmers cannot use these devices on their tractors even if they could have afforded.

Conclusions
With the study it was revealed that an IoT-based tractor-tracking system for tracking of the performance and geospatial position of the tractor could be produced with a low production cost.The test results for the measurement reliability of the developed hardware showed that the data gathered from the sensors attached to the tractor could be measured with high sensitivity.The gathered data could be transferred to the database on the cloud and showed on the web-based interface.The LoRaWAN communication technology used in the developed hardware had an advantage over GSM communication technologies not only by providing data transmission with no expense but also using a free communication frequency which has no restriction or need any license to use.
The developed system in this research was not only low cost but also scalable.The developed database and web-based user interface are compatible with different sensors using LoRaWAN technology and communication protocol so, different sensors, such as soil moisture and temperature, could be set up in the farm and the data could be tracked using the developed software.When the necessity to achieve high yield and quality of agricultural products to feed increasing world population, it is clear that using newer technologies on tractors and agricultural machines is inevitable so, the developed system has an advantage for enabling farmers to purchase and adopt their tractors to use precision agriculture techniques in their farms, especially for developing countries.
As a future study, the developed hardware has been being tested on a farm, and the gathered data is being analyzed for further development of the web-based interface by using mathematical models and embedding artificial intelligence for providing farmers to make detailed analyzes.

Figure 2 -
Figure 2-Design scheme of the developed hardware

Figure 6 -
Figure 6-Front-end presentation of the developed web-based software (Power equals to PTO power)