DONGLIN CONTROLSDONGLIN CONTROLSIndustrial Automation
AI camera directing targeted spray cooling to an occupied cow position in a dairy barn
Agriculture & Livestock

AI Vision SprayingSystem for Dairy Farms

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.

The client’s core requirement01 / Classify before spraying
01

Presence is not identity

A sensing trigger can report activity or occupancy, but it cannot reliably tell a cow from a person.

02

Complex barn conditions

Light, dust, night operation and target orientation all affect the quality of the decision.

03

Limited decision traceability

Without 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.

BeforeSensor-triggered logic
AI vision interface identifying cows inside configured recognition zonesCOW

Cow enters positionPresence signal detected

Trigger
PERSON

Person enters positionPresence signal detected

Trigger
Same input stateNo target classification
AfterAI vision decision
AI vision interface identifying cows inside configured recognition zonesCOW · 0.99ROI · ACTIVE
ClassificationCow
Zone statusOccupied
PLC outputAllow spray
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

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 zoneCapture
CaptureCameras acquire live images from each feeding zone.
02
AIVISIONRecognize
RecognizeThe AI model classifies cows and evaluates the defined ROI.
03
Transmit
TransmitRecognition results are sent to the PLC and the cloud service.
04
PLC control cabinet evaluating zone and timing conditionsDecide
DecidePLC logic checks zone, timing, mode and operating conditions.
05
Solenoid valve actuating the corresponding spray positionActuate
ActuateOnly the corresponding valve and spray position are activated.
06
Equipment status returning to the operations layerFeedback
FeedbackEquipment status returns to the AI layer for review and tuning.
AI vision interface identifying cows inside configured recognition zones
Field evidence · Night recognition viewRecognition 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.

01 · See → 02 · Classify → 03 · Verify zone → 04 · Actuate
AI vision precision spraying system in a commercial dairy barn
04

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 hardware installed for the upgrade
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.

05

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.

Daylight / overcastIlluminance > 500 lux
99.9%

Reported missed-detection rate 0.01%.

Night · Level 1Illuminance 45–49 lux
99.5%

Reported missed-detection rate 0.03%.

Night · Level 2Illuminance 35–40 lux
99.2%

Reported missed-detection rate 0.05%.

AI vision interface identifying cows inside configured recognition zones
Low-light test35–40 lux
04.05–04.27Recorded test window
8 secIntermittent capture interval
2 unitsOnline lux sensors

Project-specific results. Recognition performance depends on camera placement, lighting, the barn environment and the quality of the farm-specific training dataset.

06

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.

01
Monitor

Camera connection is checked continuously.

02
Detect

Fault or disconnection is identified.

03
Fallback

The sub-controller switches to local conventional mode.

04
Report

Alarm and event history notify operators.

5 sec

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

07

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.

01

Survey

Map cameras, feeding positions, lighting and the existing control network.

02

Define ROI

Create independent visual recognition zones for each spray position.

03

Train

Build a dairy-specific dataset around environment, cattle and camera angle.

04

Integrate

Connect AI inference, PLC sub-control, valves and cloud operations.

05

Validate

Check day/night recognition, timing, actuation and fault fallback.

06

Handover

Open visual review, parameters, alarms and history to the farm team.

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