Pig house environment data analysis and transmission system based on embedded technology
By employing a multi-level data processing architecture and embedded technology, the complex transmission of environmental parameters in multi-story pig farms has been solved, enabling precise positioning of the pig house environment and rapid troubleshooting, thus ensuring environmental health.
Patent Information
- Application Number
- CN202421935340.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2034-08-12
AI Technical Summary
Existing technologies struggle to effectively process and transmit the complex and diverse environmental parameters in multi-story pig farms, leading to increased difficulty in environmental monitoring and an inability to accurately locate farm sites with abnormal conditions.
A multi-level data processing architecture is adopted, including sampling devices, regional servers, pig house servers, pig farm servers, and a central server. Data analysis and transmission are performed through embedded technology. Environmental parameters are collected using multiple sensors, and data is transmitted through RS-485 protocol and radio frequency signals to achieve hierarchical data processing and rapid anomaly location.
It enables precise location and rapid troubleshooting of complex environmental parameters within pigsties, ensuring environmental health, reducing server load, and improving processing efficiency and response speed to equipment failures.
Smart Images

Figure CN223742965U_ABST
Abstract
Description
Technical Field
[0001] This utility model relates to the field of agricultural engineering and information processing technology, and in particular to a pigsty environment data analysis and transmission system based on embedded technology. Background Technology
[0002] With the rapid development of the breeding industry, pig farming has shifted from scattered to large-scale farming. Large-scale farming has solved the problem of land resource occupation, but it has also increased the difficulty of monitoring the state of the breeding environment. The difficulty of environmental monitoring lies mainly in the processing and transmission of massive amounts of environmental data.
[0003] Existing technologies, such as the "Intelligent Environmental Control System for Multi-Story Pig Farms Based on Edge-Cloud Collaboration" proposed by Li Yijun et al., can automatically control and adjust the output illumination of lighting equipment to ensure that the illumination value in the pig farm meets the requirements most conducive to the healthy and rapid growth of pigs. This utility model uses light sensors to detect the illuminance at designated locations in the pig house, thereby adjusting the output value of the lighting equipment to achieve the function of regulating the pig farm environment. However, this system only performs intelligent measurement and control of a single illumination parameter, making it difficult to apply to scenarios requiring multiple environmental parameters.
[0004] Hu Zhuyin et al. disclosed "An Information-Based Method and System for Environmental Sensing and Control of Pigsties," whose functions include acquiring environmental temperature and humidity data, ambient air characteristic data, ambient light data, ambient noise data, and pig growth status data of the target pigsty, and predicting the ambient air conditions of the target pigsty to select the optimal environmental control scheme and improve breeding efficiency. Jin Xin et al. disclosed "An Environmental Control Method and System Applicable to Multi-Story Pig Farming," which includes a sub-control system and a main control system. The sub-control system uses environmental parameter sensors, wet curtains, ventilation windows, and turbulence fans to collect pigsty environmental data and introduce fresh air into each unit while expelling stale air; the main controller sends control commands to each unit, utilizing its self-adjusting and adaptive advantages to solve the problem of environmental control and ventilation in multi-story pig farming. Neither of these systems elaborates on the methods for classifying and transmitting large amounts of data in such complex structures as multi-story pig farming. Utility Model Content
[0005] The purpose of this invention is to provide a pigsty environment data analysis and transmission system based on embedded technology, which is used to process and transmit data on complex environmental parameters in multi-story pigsties, thereby accurately locating breeding points with abnormal conditions.
[0006] This utility model provides a pigsty environment data analysis and transmission system based on embedded technology. The system is applied to multiple pig farms, wherein one pig farm includes multiple pig houses, and the system includes:
[0007] Multiple sampling devices are provided, wherein a pigsty is pre-set with multiple sampling points, and multiple sampling devices are set at the location of a sampling point. The sampling devices are used to collect environmental status data of the sampling point corresponding to the sampling point.
[0008] Multiple regional servers are provided in one pigsty. Each regional server corresponds to multiple sampling devices at multiple sampling point locations. The server is used to obtain the working status data A of the multiple sampling devices and the regional characteristic environmental data of the area where the multiple sampling devices are located.
[0009] Multiple pigsty servers, with one pigsty server corresponding to each pigsty, are used to obtain pigsty environmental status data and working status data B of all sampling devices in the pigsty;
[0010] Multiple pig farm servers, with one pig farm server corresponding to each pig farm, used to obtain data from the multiple pig farm servers within the pig farm;
[0011] The main server is used to obtain data sent by the multiple pig farm servers.
[0012] Furthermore, the sampling device includes an ammonia sensor, a digital temperature and humidity sensor, a carbon dioxide detection sensor, a photosensor, a hydrogen sulfide sensor, and a sampling point controller STM32; each of the sensors is electrically connected to the sampling point controller STM32.
[0013] The environmental status data includes: ambient ammonia concentration, ambient humidity, ambient temperature, ambient carbon dioxide concentration, ambient light intensity, and ambient hydrogen sulfide concentration.
[0014] Furthermore, the ammonia sensor is an MQ137 sensor, the digital temperature and humidity sensor is a DHT11 sensor, the carbon dioxide detection sensor is an MG-812 sensor, the photosensor is an LM3993 sensor, and the hydrogen sulfide sensor is an MQ136 sensor.
[0015] Furthermore, the DOUT and AOUT pins of the ammonia sensor are electrically connected to the STM32 sampling point controller, the VCC pin of the ammonia sensor is electrically connected to the power supply circuit, and the GND pin of the ammonia sensor is grounded.
[0016] The I / O pin of the digital temperature and humidity sensor is electrically connected to one end of a pull-up resistor R18, and the other end of the pull-up resistor R18 is electrically connected to the power supply circuit. The I / O pin of the digital temperature and humidity sensor is also electrically connected to the sampling point controller STM32. The VCC pin of the digital temperature and humidity sensor is electrically connected to the power supply circuit, and the GND pin of the digital temperature and humidity sensor is grounded.
[0017] The AOUT pin of the carbon dioxide detection sensor is electrically connected to the STM32 sampling point controller, the VCC pin of the carbon dioxide detection sensor is electrically connected to the power supply circuit, and the GND pin of the carbon dioxide detection sensor is grounded.
[0018] The OUT pin of the photosensitive sensor is electrically connected to the STM32 sampling point controller, the VCC pin of the photosensitive sensor is electrically connected to the power supply circuit, and the GND pin of the photosensitive sensor is grounded.
[0019] The DOUT pin of the hydrogen sulfide sensor is electrically connected to the STM32 sampling point controller, the VCC pin of the hydrogen sulfide sensor is electrically connected to the power supply circuit, and the GND pin of the hydrogen sulfide sensor is grounded.
[0020] Furthermore, the regional server includes a voltage conversion circuit, a reset circuit, a U29 clock circuit, a U21 wireless transceiver chip, a U15 protocol chip MAX485, and a U34 controller STM32.
[0021] The voltage conversion circuit includes a U10 current PWM converter and a U12 buck regulator, which are used to connect the power supply and the circuit to step down the voltage.
[0022] The reset circuit is electrically connected to the NRST pin of the STM32 U34 controller, and the clock circuit is electrically connected to the PD0 and PD1 pins of the STM32 U34 controller.
[0023] The STM32 U34 controller is connected to H5 and H6 headers. The PB10 and PB11 pins of the STM32 U34 controller are connected to the MAX485 protocol chip via the H5 headers 485B and 485A to receive environmental data sent by the sampling points. The area server is powered and grounded by the sampling points via the H6 header. The CE, CSN, SCK, MOSI, MISO, and IRQ pins of the U21 wireless transceiver chip are electrically connected to the PB6, PB7, PB14, PB0, PB15, and PB2 pins of the STM32 U34 controller, respectively, for data transmission and reception with the pig farm server.
[0024] Furthermore, the pigsty server includes a voltage conversion circuit, a reset circuit, a U30 clock circuit, a U22 wireless transceiver chip, a U41 wireless transceiver chip, and a U19 STM32 controller.
[0025] The voltage conversion circuit includes a U33 current PWM converter and a U31 buck regulator, which are used to connect the power supply and the circuit to step down the voltage.
[0026] The reset circuit is electrically connected to the NRST pin of the U19 controller STM32, and the U30 clock circuit is electrically connected to the PD0 and PD1 pins of the U19 controller STM32.
[0027] The CE, CSN, SCK, MOSI, MISO, and IRQ pins of the U22 wireless transceiver chip are electrically connected to the PB6, PB7, PB14, PB0, PB15, and PB2 pins of the U19 controller STM32, respectively, for data transmission and reception with the regional server. The CE, CSN, SCK, MOSI, MISO, and IRQ pins of the U41 wireless transceiver chip are electrically connected to the PA1, PA2, PA3, PA4, PA5, and PA6 pins of the U19 controller STM32, respectively, for data transmission and reception with the pig farm server.
[0028] Furthermore, the pig farm server includes a voltage conversion circuit, a reset circuit, a U39 clock circuit, four storage expansion chips, a U1 wireless transceiver chip, and a U24 STM32 controller;
[0029] The voltage conversion circuit includes a U36 current PWM converter and a U38 buck regulator, which are used to connect the power supply and the circuit to step down the voltage.
[0030] The four storage expansion chips are used to store data sent by multiple pig house servers;
[0031] The reset circuit is electrically connected to the NRST pin of the U24 controller STM32, and the U39 clock circuit is electrically connected to the PD0 and PD1 pins of the U24 controller STM32.
[0032] The CE, CSN, SCK, MOSI, MISO, and IRQ pins of the U1 wireless transceiver chip are electrically connected to the PA1, PA2, PA3, PA4, PA5, and PA6 pins of the U24 controller STM32, respectively, for data transmission and reception with the pig farm server. The SCLK, MOSI, and MISO pins of the storage expansion chip are electrically connected to the PB0, PB1, and PB2 pins of the U24 controller STM32, respectively, for clock and control. The CS1, CS2, CS3, and CS4 pins of the storage expansion chip are electrically connected to the PB10, PB11, PB6, and PB5 pins of the U24 controller STM32, respectively, for chip selection of each chip. The IO2, IO3, and IO0 pins of the storage expansion chip are electrically connected to the PB4, PB3, and PB12 pins of the U24 controller STM32, respectively, for data input and output.
[0033] This utility model has at least the following beneficial effects:
[0034] This invention can process and transmit complex environmental parameters within pigsties, including temperature, humidity, carbon dioxide, ammonia, hydrogen sulfide, and light. By configuring one sampling point to correspond to multiple sampling devices, one regional server to correspond to multiple sampling points, one pigsty server to correspond to multiple regional servers, and a total service to correspond to multiple pigsty servers, this invention is applicable to environmental monitoring and management in multi-story, multi-room, and multi-regional multi-story pig farms. It can also accurately locate sampling devices with abnormal conditions, enabling rapid troubleshooting of equipment malfunctions and timely processing of abnormal environmental data, thus ensuring a healthy environment within the pigsty.
[0035] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of a pigsty environment data analysis and transmission system based on embedded technology provided in an embodiment of this utility model;
[0037] Figure 2 This is a circuit diagram of the ammonia sensor provided in this embodiment of the utility model;
[0038] Figure 3 This is a circuit diagram of the digital temperature and humidity sensor provided in this embodiment of the utility model;
[0039] Figure 4 This is a circuit diagram of the carbon dioxide detection sensor provided in this embodiment of the utility model.
[0040] Figure 5 This is a circuit diagram of the photosensitive sensor provided in an embodiment of the present invention;
[0041] Figure 6 This is a circuit diagram of the STM32 sampling point controller provided in this embodiment of the present invention;
[0042] Figure 7 This is a circuit diagram of a regional server provided in an embodiment of this utility model;
[0043] Figure 8 This is a circuit diagram of the pigsty server provided in this embodiment of the utility model;
[0044] Figure 9 This is a circuit diagram of the pig farm server provided in this embodiment of the utility model.
[0045] In the diagram: 10, sampling device; 20, regional server; 30, pigsty server; 40, pig farm server; 50, main server. Detailed Implementation
[0046] The technical solutions of the present utility model will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present utility model. Obviously, the described embodiments are only some embodiments of the present utility model, and not all embodiments.
[0047] In the description of this utility model, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this utility model and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this utility model.
[0048] Example 1: Combination Figures 1-9 This embodiment is described below.
[0049] This embodiment provides a pigsty environment data analysis and transmission system based on embedded technology, for example... Figure 1 The system shown is applied to multiple pig farms, where each pig farm includes multiple pig houses. The system includes:
[0050] Multiple sampling devices are provided, wherein a pigsty is pre-set with multiple sampling points, and multiple sampling devices are set at the location of a sampling point. The sampling devices are used to collect environmental status data of the sampling point corresponding to the sampling point.
[0051] Multiple regional servers are provided in one pigsty. Each regional server corresponds to multiple sampling devices at multiple sampling point locations. The server is used to obtain the working status data A of the multiple sampling devices and the regional characteristic environmental data of the area where the multiple sampling devices are located.
[0052] Multiple pigsty servers, with one pigsty server corresponding to each pigsty, are used to obtain pigsty environmental status data and working status data B of all sampling devices in the pigsty;
[0053] Multiple pig farm servers, with one pig farm server corresponding to each pig farm, used to obtain data from the multiple pig farm servers within the pig farm;
[0054] The main server is used to obtain data sent by the multiple pig farm servers.
[0055] This system primarily uses an STM32F103 microcontroller as the sampling point controller. Multiple sampling devices 10, located at a single sampling point, employ five sensors to collect environmental data for the pigsty. These devices collect parameters such as temperature, humidity, light intensity, ammonia concentration, carbon dioxide concentration, and hydrogen sulfide concentration at the sampling point. A regional server 20 collects and analyzes the environmental parameters from multiple sampling points within that region, determining the operating status (A) of each sensor and the region's characteristic environmental parameters. A pigsty server 30 collects the operating status data (A) of each sensor within the pigsty and the environmental parameters of each area, analyzing the pigsty's environmental status data. A pig-farm server 40 collects all information obtained from each pigsty server 30 and analyzes the pig-farm's environmental characteristic parameters. A central server 50 collects all information from each pig-farm server 40 and displays it uniformly through an interface.
[0056] It should be noted that as the number of pig farms increases, the number of sampling devices 10 will also increase, and the amount of data collected by the sampling devices 10 that needs to be analyzed and processed will also increase significantly. If a conventional system architecture is adopted, the data collected by the sampling devices 10 will be uniformly aggregated to a unified server for processing, which will greatly increase the load on that server. However, in the system provided in this embodiment, the regional server 20, the pig farm server 30, the pig farm server 40, and the main server 50 together constitute a multi-level data processing architecture. Each level of server can preprocess the data it collects, that is, perform preliminary data analysis, and send the processing results to the next level to reduce the amount of data transmission in the entire system. Furthermore, by configuring the data request cycle of each server and the data processing tasks, the data requests and analysis of servers at each level can be decoupled. For example, if the main server 50 requests data from the pig farm server 40, it can be done after the pig farm server 40 requests and analyzes data from the pig house server 30. This avoids the pig farm server 40 being overloaded. In this way, the servers at each level can cooperate efficiently while avoiding a large number of tasks being concurrently processed on the same server at the same time, thus balancing processing efficiency and low performance requirements for the servers.
[0057] The sampling device 10 includes an ammonia sensor, a digital temperature and humidity sensor, a carbon dioxide detection sensor, a photosensor, a hydrogen sulfide sensor, and a sampling point controller STM32; each sensor is electrically connected to the sampling point controller STM32.
[0058] Environmental status data include: ambient ammonia concentration, ambient humidity, ambient temperature, ambient carbon dioxide concentration, ambient light intensity, and ambient hydrogen sulfide concentration.
[0059] The ammonia sensor is an MQ137 sensor, the digital temperature and humidity sensor is a DHT11 sensor, the carbon dioxide detection sensor is an MG-812 sensor, the photosensor is an LM3993 sensor, and the hydrogen sulfide sensor is an MQ136 sensor.
[0060] The DOUT and AOUT pins of the ammonia sensor are electrically connected to the STM32 sampling point controller, the VCC pin of the ammonia sensor is electrically connected to the power supply circuit, and the GND pin of the ammonia sensor is grounded.
[0061] The I / O pins of the digital temperature and humidity sensor are electrically connected to one end of a pull-up resistor R18, and the other end of the pull-up resistor R18 is electrically connected to the power supply circuit. The I / O pins of the digital temperature and humidity sensor are also electrically connected to the sampling point controller STM32. The VCC pin of the digital temperature and humidity sensor is electrically connected to the power supply circuit, and the GND pin of the digital temperature and humidity sensor is grounded.
[0062] The AOUT pin of the carbon dioxide detection sensor is electrically connected to the STM32 sampling point controller, the VCC pin of the carbon dioxide detection sensor is electrically connected to the power supply circuit, and the GND pin of the carbon dioxide detection sensor is grounded.
[0063] The OUT pin of the photosensitive sensor is electrically connected to the STM32 sampling point controller, the VCC pin of the photosensitive sensor is electrically connected to the power supply circuit, and the GND pin of the photosensitive sensor is grounded.
[0064] The DOUT pin of the hydrogen sulfide sensor is electrically connected to the STM32 sampling point controller, the VCC pin of the hydrogen sulfide sensor is electrically connected to the power supply circuit, and the GND pin of the hydrogen sulfide sensor is grounded.
[0065] The sampling device 10 for one sampling point specifically includes: two ammonia sensors MQ137, one digital temperature and humidity sensor DHT11, two carbon dioxide detection sensors, two photosensors LM3993, and two hydrogen sulfide sensors MQ136.
[0066] The effective range for detecting ammonia concentration is 5~500ppm for the two ammonia sensors U5 and U6. The heating power consumption is no more than 900mW. The operating voltage is 5V. The digital signal output pins DOUT of the ammonia sensors U5 and U6 are connected to the PA3 and PB0 pins of the sampling point controller STM32, respectively.
[0067] The calibration coefficients of the digital temperature and humidity sensor S1 are stored in the OTP of this module in the form of a program, so that the sensor can call these calibration coefficients during the processing of the detection signal. The single-wire serial interface of the digital temperature and humidity sensor S1 realizes data transmission by connecting to the I / O port of the sampling point controller STM32. The data transmission consists of 40 bits, with the most significant bit first and the least significant bit last. In this invention, the digital temperature and humidity sensor S1 is connected to a 5V operating voltage. The single data bus I / O port is connected to the PA1 and PB12 pins of the sampling point controller STM32. The sampling point controller STM32 extracts the high 20 bits of humidity data and the low 20 bits of temperature data from the two pins respectively.
[0068] The two carbon dioxide detection sensors M1 and M2 have a measurement range of 0~10000ppm, an input voltage of 5.0±0.1V, an operating temperature of -20~50℃, and a resolution of 0.1dB. The input voltage of carbon dioxide detection sensors M1 and M2 is 5V. The analog signal output interface AOUT pin of carbon dioxide detection sensors M1 and M2 is connected to the PA5 and PA6 pins of the sampling point controller STM32, respectively.
[0069] Two photosensitive sensors, H2 and H3, operate at a voltage of 5V±0.1V, have a normal operating temperature of -30~+70℃, and consume 100mW of power.
[0070] Two hydrogen sulfide sensors, U13 and U14, are used. The effective concentration detection range of the hydrogen sulfide sensors is 1~200ppm, the heating power consumption is no more than 900mW, and the resolution is 0.1ppm. The digital signal output interface DOUT pin of the hydrogen sulfide sensors U13 and U14 is connected to the PA7 and PA4 pins of the sampling point controller STM32, respectively.
[0071] Furthermore, the regional server includes a voltage conversion circuit, a reset circuit, a U29 clock circuit, a U21 wireless transceiver chip, a U15 protocol chip MAX485, and a U34 controller STM32.
[0072] The voltage conversion circuit includes a U10 current PWM converter and a U12 buck regulator, used to connect the power supply and the circuit to step down the voltage;
[0073] The reset circuit is electrically connected to the NRST pin of the STM32 U34 controller, and the clock circuit is electrically connected to the PD0 and PD1 pins of the STM32 U34 controller.
[0074] The STM32 U34 controller is connected to H5 and H6 headers. The PB10 and PB11 pins of the STM32 U34 controller are connected to the MAX485 protocol chip via the H5 headers 485B and 485A to the STM32 sampling point controller for receiving environmental data sent by the sampling points. The area server is powered and grounded by the sampling points via the H6 header. The CE, CSN, SCK, MOSI, MISO, and IRQ pins of the U21 wireless transceiver chip are electrically connected to the PB6, PB7, PB14, PB0, PB15, and PB2 pins of the STM32 U34 controller for data transmission and reception with the pig house server.
[0075] The sampling point transmits the collected data to the regional server, and the transmission method between the sampling point and the regional server is RS-485 protocol. The RS-485 protocol has the following advantages: (1) The interface level is lower than that of RS232, which can protect the components from being burned out. This level is compatible with TTL level and can be easily connected to TTL circuits. (2) RS-485 communication speed is fast, with a maximum data transmission rate of more than 10Mbps; it has a large anti-interference capability. (3) The communication transmission distance can be as far as 1,200 meters. (4) It can realize multi-machine communication and can connect up to 256 different devices.
[0076] Furthermore, the pig farm server includes a voltage conversion circuit, a reset circuit, a U30 clock circuit, a U22 wireless transceiver chip, a U41 wireless transceiver chip, and a U19 STM32 controller.
[0077] The voltage conversion circuit includes a U33 current PWM converter and a U31 buck regulator, used to connect the power supply and the circuit to step down the voltage;
[0078] The reset circuit is electrically connected to the NRST pin of the U19 controller STM32, and the U30 clock circuit is electrically connected to the PD0 and PD1 pins of the U19 controller STM32.
[0079] The CE, CSN, SCK, MOSI, MISO, and IRQ pins of the U22 wireless transceiver chip are electrically connected to the PB6, PB7, PB14, PB0, PB15, and PB2 pins of the U19 controller STM32, respectively, for data transmission and reception with the regional server. The CE, CSN, SCK, MOSI, MISO, and IRQ pins of the U41 wireless transceiver chip are electrically connected to the PA1, PA2, PA3, PA4, PA5, and PA6 pins of the U19 controller STM32, respectively, for data transmission and reception with the server in the pig farm.
[0080] Furthermore, the server in the pig farm includes a voltage conversion circuit, a reset circuit, a U39 clock circuit, four memory expansion chips, a U1 wireless transceiver chip, and a U24 STM32 controller.
[0081] The voltage conversion circuit includes a U36 current PWM converter and a U38 buck regulator, used to connect the power supply and the circuit to step down the voltage;
[0082] Four storage expansion chips are used to store data sent by multiple pig farm servers;
[0083] The reset circuit is electrically connected to the NRST pin of the U24 controller STM32, and the U39 clock circuit is electrically connected to the PD0 and PD1 pins of the U24 controller STM32.
[0084] The CE, CSN, SCK, MOSI, MISO, and IRQ pins of the U1 wireless transceiver chip are electrically connected to the PA1, PA2, PA3, PA4, PA5, and PA6 pins of the U24 controller STM32, respectively, for data transmission and reception with the pig farm server. The SCLK, MOSI, and MISO pins of the storage expansion chip are electrically connected to the PB0, PB1, and PB2 pins of the U24 controller STM32, respectively, for clock and control. The CS1, CS2, CS3, and CS4 pins of the storage expansion chip are electrically connected to the PB10, PB11, PB6, and PB5 pins of the U24 controller STM32, respectively, for chip selection of each chip. The IO2, IO3, and IO0 pins of the storage expansion chip are electrically connected to the PB4, PB3, and PB12 pins of the U24 controller STM32, respectively, for data input and output.
[0085] This solution utilizes a solar power supply system to achieve energy conservation, environmental protection, and resource saving. Two lead-acid batteries (12V-20AH) are connected in parallel to form a single (12V-40AH) lead-acid battery pack. Using a 50W monocrystalline silicon solar panel, the battery can be fully charged in just 14 hours under sufficient sunlight and can provide power continuously for 20 days. This solution requires three different operating voltages: 3.3V, 5V, and 12V. The STM32 controller requires 3.3V, the sensor requires 5V, the reset module operates at 3.3V, and the power supply output voltage is 12V. Therefore, the 12V voltage needs to be stepped down to 5V and 3.3V. Because the system components operate at different voltage values, a two-stage step-down approach is adopted: a TPS5450 current PWM converter steps down the 12V to 5V, and then an ASM1117-3.3 step-down regulator steps down the voltage to 3.3V.
[0086] The sampling device 10 is used to collect environmental status data of the corresponding sampling point. Specifically, the sampling device 10 preheats the different types of sensors it includes and collects environmental status data of the sampling point through the preheated sensors. The preheating time of each sensor is preset according to the type of sensor.
[0087] The ammonia sensor is preheated electrically for 5 minutes to collect the ammonia concentration in the environment. The collected analog signal is converted into a digital signal and transmitted to the sampling point controller STM32.
[0088] The carbon dioxide detection sensor is preheated electrically for 5 minutes, collects the carbon dioxide concentration in the environment, converts the collected analog signal into a digital signal and transmits it to the sampling point controller STM32.
[0089] The electrically preheated photosensitive sensor collects ambient light intensity for 20 seconds, converts the collected analog signal into a digital signal, and transmits it to the sampling point controller STM32.
[0090] The hydrogen sulfide sensor is electrically preheated for 10 minutes, the ambient hydrogen sulfide concentration is collected, the collected analog signal is converted into a digital signal and transmitted to the sampling point controller STM32.
[0091] The regional server 20 is used to acquire environmental status data of sampling points collected by multiple sampling devices 10, and to analyze the acquired environmental status data of sampling points to obtain the working status data A of multiple sampling devices 10 and the regional characteristic environmental data of the area where multiple sampling devices 10 are located. Specifically, the regional server 20 sends address signals to multiple sampling devices 10 in the area in a loop, and receives and verifies the environmental status data of sampling points collected by multiple sampling devices 10. The environmental status data of sampling points is sent to the regional server 20 by the sampling device 10 after the address signal is successfully verified.
[0092] Initialize the configuration and send address signals to multiple sampling devices 10 in the area in a loop. Receive and verify the environmental status data of the sampling points collected by multiple sampling devices 10. Calculate the mean square error, maximum and minimum values and the average value of the environmental status data of the sampling points. Determine whether the sampling device 10 is malfunctioning based on the mean square error, maximum and minimum values and the average value. Mark the sampling devices that are malfunctioning and obtain the working status data A of the sampling devices 10 in the area.
[0093] The average value, maximum value, and standard deviation are compared with the preset expected value in the regional server 20 to obtain regional environmental characteristic data, and the environmental status data of the sampling points, the working status data A, and the regional characteristic environmental data are saved.
[0094] When a data request is received from the corresponding pig house server 30, the sampling point environmental status data, working status data A, and regional characteristic environmental data are sent to the corresponding pig house server 30 via the SPI protocol.
[0095] The sampling device 10 communicates with the regional server 20 via a wired connection using the RS485 protocol. It extracts environmental status data of the area corresponding to the sampling point and analyzes whether each sensor at the sampling point is working properly by using the mean square error, maximum and minimum values, and average values of a set of data. It marks sampling points with abnormal data and obtains the working status data A of the sampling device 10 in the area. All data is then sent to the pig house server 30. The regional server 20 and the pig house server 30 communicate wirelessly via radio frequency signals using the SPI protocol.
[0096] The pigsty server 30 is used to acquire working status data A and regional characteristic environmental data obtained from multiple regional servers 20 within the pigsty, and analyzes the working status data A and regional characteristic environmental data to obtain pigsty environmental status data and working status data B of all sampling devices 10 within the pigsty, specifically:
[0097] Initialize the configuration, send a data request to multiple regional servers 20 in the pigsty every 30 seconds, receive and verify the working status data A and regional characteristic environmental data returned by multiple regional servers 20, obtain the pigsty environmental status data, mark the regional servers 20 with abnormal sampling devices 10, and obtain the working status data B of the sampling devices 10 in the pigsty.
[0098] When a data request is received from the corresponding pig farm server 40, the pig farm environment status data and working status data B are sent to the pig farm server 40.
[0099] The regional server 20 and the pig house server 30 communicate wirelessly via radio frequency signals using the SPI protocol. The pig house server 30 collects the environmental status and sensor working status of each area in the pig house, analyzes the environmental status and sensor working status of the pig house, marks areas with abnormal data, and packages all the data and sends it to the pig house server 40.
[0100] In radio frequency (RF) communication, the reader first transmits a specific frequency signal via its transmitting antenna. When the electronic tag enters the working area, it generates an induced current. The energy generated by this induced current activates the tag, and it then transmits its encoded information through the RF antenna. The reader's receiving antenna receives the signal transmitted from the electronic tag, which is then processed by a modulator and sent to the signal processing module. Finally, it undergoes decoding and other processing.
[0101] The pig farm server 40 is used to acquire data from multiple pig house servers 30 within the pig farm. Specifically, the pig farm server 40 sends data requests to the multiple pig house servers 30 according to a preset period to obtain pig house environmental status data and working status data B from the multiple pig house servers 30. It then calculates the pig farm environmental characteristic parameters based on the pig house environmental status data and working status data B, and sends the pig farm environmental characteristic parameters and working status data B to the main server 50.
[0102] The initial configuration involves sending a data request to multiple pig house servers 30 within the pig farm every 30 seconds. It receives and verifies the pig farm environment status data and working status data B returned by the multiple pig house servers 30. After successful verification, it saves the pig farm environment status data and working status data B, calculates the pig farm environment characteristic parameters based on the pig farm environment status data and working status data B, and sends the pig farm environment characteristic parameters and working status data B to the main server 50 via the SPI protocol.
[0103] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Terms such as "first," "second," etc., are used to denote names and do not indicate any specific order. The present invention and its embodiments have been described above illustratively, and this description is not restrictive. The present invention can be implemented in other specific forms without departing from its spirit or essential characteristics. The accompanying drawings are only one embodiment of the present invention, and the actual structure is not limited thereto. Any reference numerals in the claims should not limit the scope of the claims. Therefore, if a person skilled in the art, inspired by this description, designs a similar structure and embodiment without departing from the spirit of the invention, such design should fall within the scope of protection of this application.
Claims
1. A pig house environment data analysis and transmission system based on embedded technology, characterized in that, The system is applied to multiple pig raising rooms, wherein one of the pig raising rooms comprises multiple pig houses, and the system comprises: multiple sampling devices, wherein one of the pig houses is provided with multiple sampling points, and one of the sampling points is provided with multiple sampling devices, and the sampling devices are used to collect sampling point environment state data corresponding to the sampling points; multiple regional servers, wherein one of the pig houses is provided with multiple regional servers, one of the regional servers corresponds to multiple sampling devices at multiple sampling point positions, and the regional servers are used to obtain working state data A of the corresponding multiple sampling devices and regional characteristic environment data of regions where the corresponding multiple sampling devices are located; multiple pig house servers, wherein one of the pig houses is provided with one pig house server, and the pig house server is used to obtain pig house environment state data and working state data B of all sampling devices in the pig house; multiple pig raising room servers, wherein one of the pig raising rooms is provided with one pig raising room server, and the pig raising room server is used to obtain data of the multiple pig house servers in the pig raising room; a total server, which is used to obtain data sent by the multiple pig raising room servers.
2. The pig house environment data analysis and transmission system based on embedded technology according to claim 1, characterized in that, The sampling devices comprise an ammonia sensor, a digital temperature and humidity sensor, a carbon dioxide detection sensor, a photosensitive sensor, a hydrogen sulfide sensor and a sampling point controller STM32; each of the sensors is electrically connected to the sampling point controller STM32; The environment state data comprises environmental ammonia concentration, environmental humidity, environmental temperature, environmental carbon dioxide concentration, environmental light intensity and environmental hydrogen sulfide concentration. The ammonia sensor is an MQ137 sensor, the digital temperature and humidity sensor is a DHT11 sensor, the carbon dioxide detection sensor is an MG-812 sensor, the photosensitive sensor is an LM3993 sensor and the hydrogen sulfide sensor is an MQ136 sensor.
3. The pig house environment data analysis and transmission system based on embedded technology according to claim 2, characterized in that, A DOUT pin and an AOUT pin of the ammonia sensor are electrically connected to the sampling point controller STM32, a VCC pin of the ammonia sensor is electrically connected to a power supply circuit, and a GND pin of the ammonia sensor is grounded. An I / O pin of the digital temperature and humidity sensor is electrically connected to one end of a pull-up resistor R18, the other end of the pull-up resistor R18 is electrically connected to the power supply circuit, the I / O pin of the digital temperature and humidity sensor is also electrically connected to the sampling point controller STM32, a VCC pin of the digital temperature and humidity sensor is electrically connected to the power supply circuit, and a GND pin of the digital temperature and humidity sensor is grounded. An AOUT pin of the carbon dioxide detection sensor is electrically connected to the sampling point controller STM32, a VCC pin of the carbon dioxide detection sensor is electrically connected to the power supply circuit, and a GND pin of the carbon dioxide detection sensor is grounded. An OUT pin of the photosensitive sensor is electrically connected to the sampling point controller STM32, a VCC pin of the photosensitive sensor is electrically connected to the power supply circuit, and a GND pin of the photosensitive sensor is grounded. The DOUT pin of the hydrogen sulfide sensor is electrically connected with the sampling point controller STM32, the VCC pin of the hydrogen sulfide sensor is electrically connected with a power supply circuit, and the GND pin of the hydrogen sulfide sensor is grounded.
4. The pig house environment data analysis and transmission system based on embedded technology according to claim 2, characterized in that, The area server comprises a voltage conversion circuit, a reset circuit, a U29 clock circuit, a U21 wireless transceiver chip, a U15 protocol chip MAX485 and a U34 controller STM32. The voltage conversion circuit comprises a U10 current PWM converter and a U12 voltage stabilizer, and is used for connecting a power supply and voltage reduction of a circuit; The reset circuit is electrically connected with an NRST pin of the U34 controller STM32, and the clock circuit is electrically connected with PD0 and PD1 pins of the U34 controller STM32; The U34 controller STM32 is connected with an H5 pin and an H6 pin, PB10 and PB11 pins of the U34 controller STM32 are connected with the protocol chip MAX485 through 485B and 485A of the H5 pin, and are used for receiving environmental data sent by the sampling point, and the area server is provided with a power supply and a grounding wire by the sampling point through the H6 pin; CE, CSN, SCK, MOSI, MISO and IRQ pins of the U21 wireless transceiver chip are respectively electrically connected with PB6, PB7, PB14, PB0, PB15 and PB2 pins of the U34 controller STM32, and are used for data transceiving with the pig house server.
5. The pig house environment data analysis and transmission system based on embedded technology according to claim 4, characterized in that, The pig house server comprises a voltage conversion circuit, a reset circuit, a U30 clock circuit, a U22 wireless transceiver chip, a U41 wireless transceiver chip and a U19 controller STM32. The voltage conversion circuit comprises a U33 current PWM converter and a U31 voltage stabilizer, and is used for connecting a power supply and voltage reduction of a circuit; The reset circuit is electrically connected with an NRST pin of the U19 controller STM32, and the U30 clock circuit is electrically connected with PD0 and PD1 pins of the U19 controller STM32; CE, CSN, SCK, MOSI, MISO and IRQ pins of the U22 wireless transceiver chip are respectively electrically connected with PB6, PB7, PB14, PB0, PB15 and PB2 pins of the U19 controller STM32, and are used for data transceiving with the area server, CE, CSN, SCK, MOSI, MISO and IRQ pins of the U41 wireless transceiver chip are respectively electrically connected with PA1, PA2, PA3, PA4, PA5 and PA6 pins of the U19 controller STM32, and are used for data transceiving with the pig raising room server.
6. The pig house environment data analysis and transmission system based on embedded technology according to claim 5, characterized in that, The pig raising room server comprises a voltage conversion circuit, a reset circuit, a U39 clock circuit, four storage expansion chips, a U1 wireless transceiver chip and a U24 controller STM32. The voltage conversion circuit comprises a U36 current PWM converter and a U38 voltage stabilizer, and is used for connecting a power supply and voltage reduction of a circuit; The four storage expansion chips are used for storing data sent by the pig house server; The reset circuit is electrically connected with the NRST pin of the U24 controller STM32, and the U39 clock circuit is electrically connected with the PD0 and PD1 pins of the U24 controller STM32; The CE, CSN, SCK, MOSI, MISO and IRQ pins of the U1 wireless transceiver chip are respectively electrically connected with the PA1, PA2, PA3, PA4, PA5 and PA6 pins of the U24 controller STM32, and are used for data transceiving with the pig house server; the SCLK, MOSI and MISO pins of the storage expansion chip are respectively electrically connected with the PB0, PB1 and PB2 pins of the U24 controller STM32, and are used for clock and control; the CS1, CS2, CS3 and CS4 pins of the storage expansion chip are respectively electrically connected with the PB10, PB11, PB6 and PB5 pins of the U24 controller STM32, and are used for selecting each chip; and the IO2, IO3 and IO0 pins of the storage expansion chip are respectively electrically connected with the PB4, PB3 and PB12 pins of the U24 controller STM32, and are used for inputting and outputting data.