DONGLIN CONTROLSDONGLIN CONTROLSIndustrial Automation
AI vision precision spraying system in a commercial dairy barn
Agriculture & Livestock

Recognition Before Actuation

We upgraded sensor-activated dairy cooling into a vision-led decision system — so the control layer can tell a cow from a person before opening the corresponding spray valve.

Cow / person classificationZone-level controlAI + PLC closed loop
IndustryAgriculture & Livestock
99.9%
Daylight recognition accuracy
99.2%
Night accuracy at 35–40 lux
5 sec
Camera-fault response
8 sec
Image sampling interval
01 · Client request

Keep precision cooling. Remove the ambiguity.

The system should know whether the object in a spray position is actually a cow — and should not treat people and cattle as the same trigger.

Presence is not identityA sensing trigger can report activity or occupancy, but it cannot reliably tell a cow from a person.
Complex barn conditionsLight, dust, night operation and target orientation all affect the quality of the decision.
Limited decision traceabilityWithout visual evidence, operators have little context for reviewing a trigger, tuning a zone or explaining an event.
02 · Control transformation

From “something is there” to “a cow is in this zone.”

The upgrade changes the quality of the input — not the final actuator. Classification now happens before PLC logic issues the valve command.

Decision layerSensor-triggered logicAI vision decision
Input signalPresence state onlyClassified target inside a defined zone
Cow vs. personSame trigger for bothClassified before the valve command
Zone granularityOne sensing point per positionIndependent ROI mapped to each spray position
TraceabilityState bit in the controllerImage evidence, alarms and event history
03 · Field evidence · Night recognition view

Recognition zones and detected cattle, seen from the control layer.

Independent colored areas define the recognition zones. Cattle are detected by the model before the corresponding zone status enters the PLC decision layer.

Nighttime camera view with cattle recognition boxes and independent spray zones
01 · See → 02 · Classify → 03 · Verify zone → 04 · Actuate
04 · How the system works

A six-stage closed loop from camera to field equipment.

A thin data path links visual recognition, control decisions and real equipment status — without a single oversized step dominating the workflow.

01
Field-mounted camera capturing the feeding zone
CaptureCameras acquire live images from each feeding zone.
02
Nighttime camera view with cattle recognition boxes and independent spray zones
RecognizeThe AI model classifies cows and evaluates the defined ROI.
03
Edge AI computing unit transmitting recognition results
TransmitRecognition results are sent to the PLC and the cloud service.
04
PLC control cabinet evaluating zone and timing conditions
DecidePLC logic checks zone, timing, mode and operating conditions.
05
Solenoid valve actuating the corresponding spray position
ActuateOnly the corresponding valve and spray position are activated.
06
Equipment status returning to the operations layer
FeedbackEquipment status returns to the AI layer for review and tuning.
05 · Engineered system

Four layers designed to operate as one.

The project combines visual acquisition, edge intelligence, deterministic PLC control and operational visibility.

Field-mounted camera capturing the feeding zone
01 / Vision layer

Camera + Defined Recognition Zones

Live images cover the feeding line while independent ROIs map visual decisions to individual spray positions.

Edge AI computing unit transmitting recognition results
02 / AI computing

Day / Night Model Logic

The documented system uses an NVIDIA AI computer and switches datasets to match different lighting conditions.

PLC control cabinet evaluating zone and timing conditions
03 / Control layer

PLC + Independent Sub-Control

PLC logic performs secondary processing and commands field equipment; independent sub-control limits fault impact.

Smart spraying control system interface with zone and equipment status
04 / Operations layer

Cloud, Alarms and Historical Records

Operators can review device connectivity, zone status, alarms and system history from the visual control layer.

06 · Field validation

Recognition remained above 99% across the recorded light levels.

The source report documents intermittent image sampling at 8-second intervals between April 5 and April 27, using two online lux sensors installed at the same position and angle.

Illuminance > 500 lux

Daylight / overcast · 99.9%

Reported missed-detection rate 0.01%.

Illuminance 45–49 lux

Night · Level 1 · 99.5%

Reported missed-detection rate 0.03%.

Illuminance 35–40 lux

Night · Level 2 · 99.2%

Reported missed-detection rate 0.05%.

07 · Operational resilience

If vision goes offline, cooling does not simply disappear.

The documented configuration treats camera status as part of the control strategy and preserves a local fallback path.

01MonitorCamera connection is checked continuously.
02DetectFault or disconnection is identified.
03FallbackThe sub-controller switches to local conventional mode.
04ReportAlarm and event history notify operators.
5 sec

Camera fault response documented for the upgraded configuration, compared with 5 minutes in the preceding version.

08 · Delivery approach

Built around the actual barn — not a generic model.

Each stage is executed against this barn — its camera angles, its lighting and its existing control network.

01SurveyMap cameras, feeding positions, lighting and the existing control network.
02Define ROICreate independent visual recognition zones for each spray position.
03TrainBuild a dairy-specific dataset around environment, cattle and camera angle.
04IntegrateConnect AI inference, PLC sub-control, valves and cloud operations.
05ValidateCheck day/night recognition, timing, actuation and fault fallback.
06HandoverOpen visual review, parameters, alarms and history to the farm team.
09 · Project outcome

A smarter decision layer for every spray position.

The upgrade retained position-level control while adding target classification, visual review, day/night adaptation and operational fallback. Recognition performance depends on camera placement, lighting, the barn environment and the quality of the farm-specific training dataset. System configuration and field performance vary by barn, environment and operating requirements.

The project was not about finding a new way to open a valve. It was about making a better decision before the valve opens.

Products used in this project

Siemens S7-1200 PLC Control Cabinet (1)

Siemens S7-1200 PLC Control Cabinet

Custom-built control cabinets around the Siemens S7-1200 platform, wired, programmed and factory-tested to your process specification.

Request a Quote →
IIoT PLC Cloud Monitoring System (1)

IIoT PLC Cloud Monitoring System

Remote monitoring of PLC-controlled plant from phone or browser, with historical data and alarm push.

Request a Quote →
WinCC HMI & SCADA Programming Service (1)

WinCC HMI & SCADA Programming Service

HMI and SCADA screen design and programming on WinCC and TIA Portal, delivered with source files.

Request a Quote →
WeChat
WhatsApp