# Research and Development of Automatic Monitoring System for Livestock Farms
## 3 Research Process
### Installation of Environmental Sensors and Communication Equipment  
In this research the environmental status information of the livestock farms was expected to instantly be received in order to make adjustments timely according to the environmental conditions. In consideration of the daily behaviors of dairy cows and ample space in the dairy barn, the temperature and humidity sensors were installed at the upper beam of the barn in a symmetrical manner versus the middle beam. The installation positions of the wind speed sensors and illuminance sensors were also designed with in-depth considerations to ensure the environmental parameters could be accurately retrieved from the entire site. The layout and illustrative details of sensors installation are shown in Figure 2. Moreover, Modbus communication protocols have been applied to ensure the smooth transmission of the data collected by the temperature, humidity, wind speed, and illumination sensors and so forth, to provide the important heat stress and body temperature analysis data of the dairy cows. The circuit wiring diagram of the input and output devices and PLC are shown in Figures 6 and 7.  
Figure 6: Experimental circuit wiring diagram for programmable logic controller (PLC) in dairy housing.  
The signal retrieved by the temperature, humidity, wind speed and illuminance sensor modules were transmitted to the PLC through the A/D modules, and then the signals have been converted into Modbus specification through the left communication module (FX3U-485 ADP-MB). Finally, the RS-232/RS-485 data were converted into ISM (Industrial Scientific Medical) wireless 429 MHz frequency band via RFU-400 CR wireless communication transmitting devices produced by ICP DAS CO., LTD. for receiving or sending out. The RFU-400 CR in the office was used for signal receiving and transmission purposes, and it would send the data out to PC and PLC for treatments. The retrieved environmental data were instantly displayed on the human-machine interface or displays and stored inside the database. Therefore, the administrator could read the real-time environmental information from the barns, and he could also analyze the historical data in the database to get the best environmental parameters [25]. The application of RFU-400 diagram is shown in Figure 8.  
A wireless communication network was then established through the RFU-400 CR wireless transceiver. The Master/Slave communication between devices were connected by using the Modbus communication protocol, and the commands were sent by the Master to have the Slave to transmit the  
Figure 8: Application of RFU-400.  
Figure 7: Experimental circuit wiring diagram for programmable logic controller (PLC) in piggery farm.  
data retrieved by PLC from sensors back to the Master. The livestock administrator could observe the environmental data in the barns at a remote terminal. The setting method was as follows: The Modbus station numbers of Master and Slave, communication settings, and packet latency could be set in the PLC program, and the data collected from different sensors were stored in the PLC register by using the \"ADPRW\" command [26] and then the signal could be smoothly transmitted to the register of the PLC.