An IoT Smart Broiler Farming Model for Low Income Farmers

—The coming of Internet of things (IoT) brings opportunities for the deploying of wireless sensor networks. One area of deployment is smart poultry farming to improve the quality and security of chicken varieties that include broilers. The quality of broilers produced is dependent on the environment in which the broilers are kept. In addition, the revenue of the farmer is guaranteed if theft of stock is prevented. The current methods farmers use are labour intensive and time consuming as they are manual. Leveraging the features of IoT and sensors can help to monitor the environment and ensure adverse conditions are reported for farmers to take action before they harm the livestock. Incorporating intruder detection when monitoring conditions in the environment can also prevent stock theft and that can increase the income obtained by farmers. For such a system to be widely adopted by low income farmers, the cost should be low compared commercially available climate control systems that are meant for commercial farmers. The system should also provide ease of use for less technically skilled farmers, reduce the time taken by farmers to take action in controlling theft and conditions in the environment and be accessible from any location other than the broiler house. In this paper, we propose a low-cost model that can be used to monitor conditions in the environment of a broiler house and send the values to the farmer in real-time. The proposed model is based on open source microcontrollers


Introduction
The second goal of the United Nations sustainable development goals focuses on promoting sustainable agriculture, eradicating hunger and meeting food security and nutritional demands of the global population [1]. For this goal to be achieved, the way in which agriculture systems are managed must change to meet the food demands of the growing population. Further, projections indicate a 50% global expected increase in demand for milk and meat between 2015 and 2050 [2]. This projection and the United Nations sustainable development goals require making changes to livestock farming to meet growing demands of consumers. Livestock production is largely dominated by small and medium-scale farmers on the African continent including Zambia. Having the majority of farmers in medium and small scale category brings challenges in terms of incorporating high end ventilation and security systems. The ventilation and security systems are expensive and designed for large scale commercial applications [3]. These challenges force low income farmers resort to manual methods of monitoring environmental conditions and securing livestock.
Smart farming utilizes information and communication technology in managing farms physical cycles by making use of cyberspace [4].Smart farming main driver is the Internet of Things (IoT) as it provides connectivity while Cloud computing offers storage and presentation of data coming from a farm. In addition use of big data analysis on raw data stored in the cloud provides a better understanding of data and forms a foundation for future predictions. Smart farming does not only improve the physical management of the farm but also helps policy makers in decision-making. Many definitions of IoT have been provided by researchers but no consensus has been reached on a proper definition [5]. IoT enables integration and interconnection of real objects and cyberspace [6]. The objects are capable of communicating with each other even when human beings are absent. A variety of objects can be part of the IoT and these include cell phones, sensors, computers and many others. The early implementations of IoT used active Radio Frequency Identification (RFID) tags, which were expensive [7]. To provide more intelligence IoT started to incorporate sensor technology, which increased the number of devices that could be part of the network [8]. Modern IoT applications now include actuators and mobile nodes such as drones and robots [9]. IoT is divided into three layers namely perception, network and application [10]. The precipitation layer is also known as the sensing layer and mostly supports sensor technologies. The network layer is used for transporting information from sensors to different parts of the network. The application layer consists of applications such as web servers, databases and clients.
The cost of individual sensor units continues to reduce while coverage of networks that carry data such as Global System for Mobile Communication (GSM) are increasing [11]. This trend provides an opportunity to develop innovative solutions using IoT to achieve Millennium Development Goals and post-2015 Sustainable Development Goals for developing countries. Furthermore, rural communities that rely on agriculture can make use of IoT to increase productivity [12].
The objective of this paper is to propose a low cost IoT model for monitoring temperature and security of a poultry house. This paper is organized as follows: section II provides a background on poultry farming and challenges of monitoring temperature and security in Zambia. Section III provides the literature review and related works. Section IV explains the methods and proposed IoT model for temperature monitoring and security. Section V outlines the discussion of the preliminary results. Poultry farming in Zambia and Environment monitoring Zambia's poultry industry is dominated by small-scale farmers whose main produce are broilers. The majority of the small-scale broiler farmers are located in urban areas where the demand of poultry meat is high [13]. Figure 1 one shows the estimated number of birds produced in the year 2016 [14]. The poultry industry has posted growth rates ranging from 8% to 10% from the year 2000 to 2014 [15]. Existing literature also reveals that poultry was the second most consumed meat in Zambia in 2015. The increased growth rate and high consumption are expected to increase income for the farmers, provide sufficient nutrition for the consumers of poultry products and create employment opportunities. However, these expected benefits are not fully realized due to challenges facing the poultry farmers in relation to poultry management.
A key factor that contributes to the quality and increased production of poultry are the conditions in environment where the birds are reared especially temperature. The temperature of the poultry house requires constant monitoring to reduce the effects of heat stress when temperature is too high and prevent diseases such as pneumonia when the temperature is low. The Ministry of Fisheries and Livestock in Zambia provides guidelines on recommended temperature at different stages of bird development starting from brooding. Other researchers recommend that temperature in the environment where poultry is kept should be set to 23oC after the brooding period [16]. To determine the level of temperature especially during summer, farmers need to observe the behaviour of the chickens [3]. When temperature is high, birds tend to move away from other birds, extend their wings and reduce activity to avoid generating heat. The feeding pattern is also affected as the birds eat less feed and drink more water. Other signs include darker skin and increased panting. The signs become apparent after the effects of heat stress has already affected the birds and that can reduce growth rate and increase mortality. The approach of observing behaviour and other physical signs to determine conditions in the environment does not provide the farmer with sufficient time to react to drastic changes in the environment.
Another factor that adversely affects farmers is security of the birds. Evidence exists that shows high levels of stock theft [17]. This trend robs the farmers of the much- needed income to support their living. Existing solutions calls for placing a homestead near a poultry house as the cheapest possible solution. However, this approach does not guarantee the notification of the farmer during a breaking at the poultry house.

3
Literature review

IoT connectivity Platforms
The platforms used to provide connectivity are many and each has its own associated benefits and limitations as summarized in table 1. ZigBee provides low cost and security of data during transmission making it suitable for low cost applications. To provide the long-range, GSM technology can suffice and has wide network coverage.

IoT in Agriculture
The applications of IoT in agriculture are numerous and even rural dwellings of developing countries have the ability to benefit from IoT [12]. Applications include air monitoring, soil monitoring and animal monitoring [10]. These applications can incorporate actuators to control irrigation, fertilizer application, lighting control, climate control and access control to prevent theft. The data generated from applications can be subjected to further analysis to gain a better understanding about agriculture and make decisions for future improvements.

Wireless Sensor Networks
Wireless Sensor Networks are part of the perception layer found in the Internet of things [25] [10]. Wireless Sensor Network requires multiple nodes to form a network [43]. The sensor nodes continuously or at set intervals sense data from the environment and send the data to the sink node [26].The sink node collects the data from sensor nodes for viewing locally and sending for storage. The data from the sensor nodes can be accessed remotely over the Internet or other means by users [27]. The wireless sensor networks provide better methods of monitoring environmental conditions than manual methods [28]. Wireless Sensor Networks are now a reality with applications in Smart Grids, Smart Environments and machine to machine communication [29].

Cloud Computing and Big Data
Sensors in IoT have the ability to generate high volume of raw data. Therefore, adequate storage is required to store the generated data. In addition sufficient processing capabilities are required to turn raw data into useful information for purposes such as prediction [30]. Cloud computing and data mining provide sufficient processing, storage and analysis tools for understanding trends in raw data [44].

GSM, 2G and 3G Technology
GSM has a number of services that can be utilized in wireless sensor networks such as Short Messaging Service for controlling actuators and receiving notifications [31]. Other services such as calling can also be used for notification purposes. GSM may be popular in such applications because network coverage is wide standing at almost 95% for the entire world [32] [11]. The distribution of GSM coverage and subscription for Zambia according to the International Telecommunications Union shows a wide coverage of GSM as network shown in Table 2 [33]. Earlier statistics for 2015 by Zambia Information and Communications Technology Authority (ZICTA) showed that 64.6% of households had access to a mobile phone and mobile network coverage for the Zambia was at 92.8% in [34].

Related Works
Research was conducted in Brazil to evaluate effects of heat stress on humans and animals using temperature and humidity based on the Temperature Humidity Index (THI) [27]. The data values measured were transferred to an expert system that was running on a PC locally for analysis. The wireless sensors managed to achieve distances of 100m indoors and 1 km outdoors for data transmitted. The results showed that months of June and October were very uncomfortable for both humans and animals.
In Kenya, SmartPump was implemented from 2012 to 2013 in Kyuso district where hand pumps were equipped with GSM transmitters to send SMS about hand pump usage and maintenance [35]. The testing for the same project was conducted in Lusaka, Zambia, using 21 pumps in 2011 [11]. The data that was being sent from the pumps was stored in a relational database for analysis and the results reduced the downtime of pumps from 27 days to three days. After the trail 80% of the users were willing to pay for the service as compared to 20% before the trail began.
A prototype system was proposed to measure soil moisture in four plots of land and trigger alerts via SMS to the farmer for low moisture levels [36]. The system used waspmote for sensor nodes which consisted of Atmega 128 microcontroller, ZigBee transceiver and a soil moisture sensor. The sensor nodes were connected Meshlium gateway using 802.15.4 protocol. The gateway was responsible for collecting all the sensor data, storing and sending the data to the cloud using GPRS network in JSON format. Ubidots was used for cloud storage and it offers data visualization and analytical tools. The system was tested on four plots of land to prove the concept.
A prototype for monitoring conditions in a home using Arduino microcontrollers, ZigBee protocol, Google App Engine for Cloud computing and JSON for exchanging data between the sensor nodes and the cloud was proposed [37]. The prototype type had proximity and ambient light sensor, temperature sensor and humidity sensor than were connected to Arduino UNO microcontroller. The prototype also had actuators connected to another Arduino UNO microcontroller to turn on the lights and fan. The microcontrollers were able to communicate using ZigBee protocol. The users were able to control the actuators through a web application that could be accessed from a device with Internet connection. RFID cards were used to control how users had access to the system to control the actuators.
A prototype to monitor temperature, humidity, CO2 concentration and NH3 concentration from a poultry house using a wireless sensor network was designed [38]. The researchers main concern was the reliable transfer of the values measured to the monitoring system. The wireless protocol used was based on Modbus protocol. The measurements were placed on a remote real-time monitoring web page and were viewed by users using a web browser from remote locations. Reliability was supposed to be guaranteed even in the presence of packet loss. To provide reliability of transferred data, software and data fitting methods provided the correction and compensation of the data. In addition, data loss recovery strategies and online filling in methods were also employed based on the features of the sensor nodes. A novel data frame recovery protocol was designed for recovering lost packets. For packets that could not be recovered, the online system had algorithms that used multiple regression based on spatial correlations of node data to estimate and automatically fill in missing data. The system was tested for a continuous period of 24 hours and proved to be more reliable, economical and easy to extend than traditional methods of monitoring. An actual poultry house measuring 88 m long, 8 m wide, 3.7 m high was used for the testing the system. INCOME was designed as a solution to the minimum sensor deployment problem [39]. The aim was to determine the minimum number of sensor nodes that are required to give accurate precise measurements in land used for agriculture. The goal was to reduce costs by reducing the number of sensor nodes require. They measured the darkarea/light-area ratios using the Monte Carlo theory in agriculture fields. A split and merge algorithm was developed that divided the field under consideration into subregions. The sub regions had to satisfy both precision and size limit requirements theoretical calculations and simulations proved that the algorithm recommended using fewer sensors than regular deployment methods in ideal and worst case conditions. The algorithm, however, did not take account of different weather conditions, number of crops planted or thickness of canopies that can affect the sensor nodes.
A wireless remote sensor network based on android things for monitoring environmental conditions in storage warehouses was designed for the Food Reserve Agency in Zambia [40]. The system used sensor nodes to monitor temperature, humidity, water and motion. The temperature, humidity and water were used to monitor the state of the storage environment while the motion sensor was used to detect the presence of intruders. The data from the sensor nodes was sent to an aggregator node via ZigBee and later transmitted to the server in the cloud using a GSM network. The cloud storage service used was third party which may be inappropriate for storing data for a government agency. The full cost of mass production and implementation of the system was not specified.
A low cost wireless sensor network agricultural monitoring system using multiple ground sensor nodes and an Unmanned Aerial Vehicle (UAV) was proposed [41]. The ground sensor nodes were scattered several kilometres apart and would collect temperature and humidity values for each day. The UAV was equipped with a sensor node and would be flown once a day to collect the stored values from the ground sensor nodes using ZigBee protocol. The ground sensor nodes were fitted with an SD card to store data in cases where the data for the day was not collected. The sensor node on the UAV was capable of covering distances as long as 10 kilometres or in fields that covered an area of 100 hectares. The UAV was equipped with other subsystems that included an on-board computer, autopilot, camera, and a tank. The additional sub systems were supposed to be used in crop disease detection, pest infestation identification, soil moisture, and drought and flood monitoring. The tank would be used to transport and apply supplies such as pesticides and fertilizer to the different areas of the field. The entire system costs were low at $900. The amount was viewed as being low compared to the valuable information and ease with which the information was obtained about large agricultural fields. The system would be useful in monitoring vast land cultivation of crops such as wheat, rice and corn. The system was tested using a series of flights and it achieved its objectives. The system was not tested for extreme weather conditions and the effects of wind when delivering supplies were not tested. Real-time data could not be collected using this system.

Methods and Proposed Model
To design the required model a systematic literature review was conducted on existing literature from 2002 -2017. The period was chosen because IoT and wireless sensing are new concepts that exists mostly in recent literature.

Hardware Design
The hardware design is depicted in fig 2. The model utilizes open source Arduino boards for sensor nodes and gateway. The connectivity is provided by ZigBee, GSM and GPRS. ZigBee is used for communication among the nodes in close proximity. The GSM network provides the means to communicate to remote locations when the farmer is mobile. GPRS is used to provide connectivity to the cloud from nodes in the wireless sensor network. The farmer can also make use of GPRS to access sensor data from the web application on a phone with GPRS connection.  The coordinator/gateway node has an LCD display connected to an Arduino mega fig 5 (a) (b). The mega is used because provides more input and output pins. In addition, the Arduino mega has more serial ports that makes it suitable for connecting the XBEE shield and the GSM900 modem fig 5 (c). The coordinator receives the values for temperature and motion from the sensor node and then displays them on the LCD. The coordinator also has buttons for setting the temperature and alarm. The coordinator node also has a buzzer attached to produce the alarm sound.

Software Design
The sensor node has a program written in C/C++ using Arduino IDE. The program reads temperature motion and ultrasonic distance from the sensors. The program checks if motion is detected and measures the distance from the sensor node to the object triggering the motion sensor. The sensor node then sends the current temperature and alarm trigger to the coordinator node. If motion is not detected or the distance is not measured the alarm variable is set to no trigger and is sent along with the temperature using the XBEE transceiver. The process is repeated to get the next set of values fig 6. When the values are received at the coordinator node the temperature is compared to pre-set values. If temperature is above or below the threshold the buzzer sounds and a message is sent to the farmer via SMS and to the cloud via GPRS. For the intruder detection the coordinator looks for the alarm trigger variable in the message from the sensor node. If the variable is set the buzzer sounds and the farmer is notified by phone call and SMS. The alert is also sent to the cloud for storage. Data for temperature and alarm status is also periodically sent to the cloud for storage.
One of the ways the farmer can interact with system is by using a mobile phone connected to a GSM network. Notifications from the coordinator/ gateway node can be received by the farmer as shown in fig 7. The farmer can also access the sensor data from the poultry house with a device that has a web browser and Internet connection fig 8. The farmer will not only have the ability to view real time data but also achieved data and edit farmer profile. The web application has a dash board to display charts of recent temperature updates. The web application uses PHP scripts to retrieve data from MySQL database. The web application requires the farmer to login in order to view real-time data from the poultry house. The web application displays recent values in form of a graph.

Discussion
The cost of the proposed model is low. The sensors and use of open source boards make the cost of the hardware low. Farmers have options for implementation configuration in terms of the number of the number of sensor nodes and whether to include GPRS connectivity to the cloud. The system can be implemented even for farmers that do not have Internet connectivity but can access the GSM network. Such an approach will not store sensor data in the cloud for later analysis but farmers will still have the ability to receive alerts through a phone call and SMS. The value of the temperature is constantly monitored from the poultry house. The values are uploaded once every 30 minutes to the cloud for storage. Triggers are sent immediately to notify the farmer. Detection of intruders by the sensor node is with a distance of 4 m from the sensor node. Accurate detection of beyond 4 m requires adding another sensor node. Depending on the placement of the sensor, one node is capable covering a maximum area of 16m2. One sensor node can detect intruders for 128 to 160 birds when the recommended stocking density of 8 to 10 birds per square metre is used.

Conclusion and future work
In this paper, we have proposed an IoT model for monitoring temperature and detecting intruders in a poultry house. The temperature in the environment is measured periodically and displayed to the farmer on an LCD, web application and SMS. Triggers for temperature extending set thresholds and motion sensors are via SMS to the farmer. The readings for temperature are periodically sent to a web server in the cloud for viewing and later analysis. The system design uses open source Arduino boards, ZigBee protocol and GSM network. The design components used in designing and implementing the model provides affordability, increased geographical reach and security of data for low income farmers. The farmers can not only monitor temperature in real time will have the ability to get a notification if a security breach occurs.
Our future work is to add measuring humidity, setting temperature threshold using SMS, sending real-time conditions on demand and include an app for accessing the data from the poultry house. Future work can be conducted on the model to replace the Arduino mega coordinator/gateway with raspberry pie. This will allow introduction of actuators, provide local storage of data, and extend ability to view sensor data using Wi-Fi or Bluetooth on smart phones. Future work can include eliminating open source boards and remaining with microcontroller only to reduce power consumption to enable system to be fully powered using solar power. The model can also be extended to monitor other types of livestock such as pigs or monitoring storage