Industry Cases

A small module that easily handles wireless monitoring of pigsty environments

Published :2024-07-25 Views :3349

A small module that easily handles wireless monitoring of pigsty environments

Core equipment: RS232/485-WIFI M01



 

Recently, a customer who raised pigs complained to me roast, but he found that the temperature and humidity sensors and ammonia detectors in the pig house were all old devices with RS485 serial ports. The cost of rewiring was too high. The old pig house could not be changed, and the data could not be monitored in real time, so he could not sleep.

 

I laughed as soon as I heard it: this job can be solved with a small serial port to Wi Fi module.

 

Today, I will share with you a mature solution: using AMSAMOTIONWIFI serial server (RS232/485-WIFI M01), temperature and humidity, ammonia, carbon dioxide, hydrogen sulfide and other sensors in the pigsty can be directly uploaded to the cloud through MQTT protocol, without wiring, and can be installed and used immediately, truly realizing cloud edge collaboration, remote monitoring, and automatic control.

 



I The real pain points of pigsty environment monitoring

1. The old pigsty cannot be wired: the walls are old, there are no cable trays, and holes cannot be drilled. The wired solution can be passed directly.

2. High construction costs: Hundreds of meters of cables, labor, pipelines, and the cost of renovating a pigsty is astonishing.

3. Data is not real-time: manual recording lags behind, making it difficult to timely grasp environmental changes at night and on rainy days.

4. Equipment dispersion is difficult to manage: multiple pigsties and measurement points make it impossible to centralize data on the cloud.

5. Maintenance trouble: aging of the circuit, rodent bites, short circuits, and troubleshooting takes half a day.

6. Difficulty in platform integration: The sensor only supports 485/232 and does not support integration with cloud platforms or MQTT.

 

II Solution: 485 sensor+WIFI gateway+MQTT cloud deployment

The core is to equip each serial device with a "wireless gateway" - WIFI serial server (RS232/485-WIFI M01). What it does is very simple:

 



1. Serial port to WiFi: Convert RS232 or RS485 signals into wireless Wi Fi signals.

2. Protocol conversion: Built in Modbus gateway, automatically converts Modbus RTU to Modbus TCP.

3. MQTT on the cloud: The most crucial thing is that it supports direct connection to MQTT servers such as Alibaba Cloud, and directly packages the collected temperature, humidity, and ammonia values into JSON format and pushes them to the cloud.

 

In this way, there is no need for any new wiring in the pigsty, sensors remain in place, modules are plugged in, Wi Fi and MQTT parameters are set, and data is "flown" to the cloud on its own.

 

III Working principle:

 

Let's break down the data flow:

1. Sensor collection: Connect temperature, humidity, ammonia, CO and other sensors in the pigsty to a WIFI serial server through a 485 cable.

2. Gateway protocol conversion: The WIFI serial server automatically packages the data into JSON format.

3. MQTT push: Through WIFI networking, report to the cloud platform using MQTT protocol.

4. Cloud edge collaboration: cloud storage, display, and alerting; Local linkage of fans, water curtains, lighting, water pumps, and material lines at the edge end.

5. Remote access: Watch data, check curves, and receive alarms anytime, anywhere on mobile phones or computers.

The entire chain: sensors RS485 line module acquisition+protocol conversion MQTT cloud platform mobile phone/large screen. The entire process is wireless, with one module handling both data collection and networking.

 

 

IV Two real implementation cases

 

Case 1: A 500 head sow farm in Guangxi

 

Pain point: The delivery room temperature is required to be controlled at 18-22 , but old-fashioned thermometers can only be manually inspected, and temperature fluctuations at night are not detected in a timely manner, resulting in a piglet diarrhea rate of up to 15%.

 

Solution: Install an RS485 temperature and humidity sensor in each delivery room, equipped with a WIFI serial server. Set the module to STA mode, connect to the router in the pig farm office, and enable MQTT function to push data to Alibaba Cloud. The field manager installs a monitoring app on their mobile phone, which automatically alerts when the temperature exceeds the limit.

 

Effect: The diarrhea rate of piglets has been reduced to less than 5%, and the annual loss has been recovered by about 200000 yuan.

 

Case 2: A broiler farming cooperative in Shandong Province

 

Pain point: The ammonia concentration in 8 chicken coops often exceeds the standard, but handheld detectors require people to enter and test, which is both troublesome and harmful to the body. The distance between chicken coops is far, and it is not realistic to draw a line.

 

Solution: Install an ammonia detector (RS485 output) and a WIFI serial server in each chicken coop. The module is connected to the local area network of the cooperative through a wireless bridge, and then the data is aggregated and uploaded to the cloud through an edge gateway. The WIFI serial server here mainly uses the "Server transparent transmission" mode, and the central server periodically polls the data of each chicken coop.

 

Effect: The manual detection frequency has been reduced from 3 times a day to 1 time a week (for calibration only), and the exhaust fan automatically starts when the ammonia exceeds the standard, resulting in a 3% increase in the survival rate of broiler chickens.

 

 


V Actual value

 

1. Save money: No wiring, no need to replace sensors. The cost of a single module is less than 200 yuan, saving enough construction costs to buy dozens of them.

2. Worry free: automatic collection 24/7, automatic alarm for abnormalities, reducing manual inspections.

3. Reduce losses: The response to environmental abnormalities has been shortened from "a few hours later" to "a few seconds later", directly reducing growth retardation and death caused by excessive temperature and ammonia.

4. Traceability: Environmental data from entry to exit is recorded throughout the entire process, meeting the dual needs of food safety traceability and aquaculture insurance.

5. Scalable: Monitor temperature and humidity today, add an ammonia sensor tomorrow, and add illuminance the day after tomorrow. The number of modules can be increased as needed, and you can subscribe to the cloud topic as soon as possible.

 

VI. Summary

 

Smart farming does not necessarily require high-end fully automated equipment. Many times, a 'WiFi serial server' can rejuvenate old devices. Its core value can be summarized in two sentences:

 

Connection: Allow non-verbal serial devices to speak through Wi Fi.

Conversion: Translate Modbus, an industrial "dialect", into MQTT, an Internet "Mandarin".

 

If you are also working on monitoring the environment of a breeding farm and are troubled by problems such as difficult wiring, outdated equipment, and cloud migration, you may want to try this idea. Starting from a small module, your pigsty can also instantly become a 'cloud farm'.