An animal tracking application looks simple from the outside: receive GPS coordinates and place a marker on a map.
In production, the difficult questions appear quickly. What happens when the collar is reassigned? How should the system handle delayed data? Can an alert run while the gateway is offline? How do you prevent one inaccurate GNSS point from creating a false escape incident?
This guide breaks the system into the components developers need to design: identity, device connectivity, edge processing, normalized telemetry, event-time handling, rules, and operational monitoring.
1. Model Animals and Devices Separately
Do not use a collar ID as the permanent animal ID.
Tracking hardware can be removed, repaired, replaced, or assigned to another animal. The application should preserve the animal’s history independently of the hardware that produced each reading.
A minimal domain model should contain:
Animal
Device
DeviceAssignment
HerdOrGroup
Site
Tenant
DeviceAssignment links a device to an animal for a defined period. When the collar changes, the assignment closes and a new one begins. Historical telemetry can then be resolved against the correct animal without rewriting old records.
In a multi-farm system, every entity and event also needs an organization or tenant context. Enforce this context in backend authorization, not only through UI filters.
2. Treat Connectivity as a Design Constraint
GPS or GNSS determines a position but does not transmit it. The collar still requires a communication channel.
Common options include:
- LoRaWAN or another LPWAN technology for low-power private coverage
- Cellular connectivity for wide-area transmission where service is available
- BLE for proximity events or short-range synchronization
- RFID for identification at gates, barns, feeding stations, or handheld readers
The correct choice depends on coverage, terrain, reporting frequency, payload size, battery requirements, and infrastructure cost.
A hybrid pattern often works best. A device can store detailed readings locally, send small exception events through a low-power network, and upload its complete history when it reconnects to a gateway.
3. Give the Edge Gateway Real Responsibilities
In remote deployments, the gateway should do more than forward packets. It can provide a resilient processing layer between field devices and the central platform.
Typical gateway tasks include:
- Validating device identity and message structure
- Decoding proprietary binary payloads
- Converting units into a standard format
- Attaching reception time and gateway metadata
- Removing duplicate packets
- Buffering events during network outages
- Filtering insignificant changes
- Evaluating urgent rules locally
- Synchronizing stored events after reconnection
For high-frequency sensors, transmit features rather than every raw sample. An edge process might turn thousands of accelerometer values into an activity score, resting duration, or anomaly event.
This reduces bandwidth use and allows the system to react locally when the upstream connection is unavailable.
4. Normalize Telemetry Before Applying Business Rules
Different device vendors use different payload structures, field names, units, and timestamps. Dashboards and rules should not depend directly on those formats.
Convert incoming messages into a stable internal event model:
{
"tenantId": "farm-group-12",
"animalId": "cow-1048",
"deviceId": "collar-7721",
"eventTime": "2026-09-22T07:15:12Z",
"ingestionTime": "2026-09-22T07:15:19Z",
"sequence": 88142,
"location": {
"latitude": 40.2147,
"longitude": 44.5432,
"accuracyMeters": 12
},
"activityIndex": 18,
"batteryPercent": 67,
"sourceGateway": "gateway-03"
}
With normalization in place, the same alert and visualization logic can operate across multiple collar brands.
For projects that need to connect tracking devices, sensors, gateways, maps, analytics, and workflows, the Iotellect IoT platform for animal tracking provides a low-code environment for building this type of unified application.
5. Preserve Event Time and Ingestion Time
Animal tracking systems frequently receive late and out-of-order data. A device may store readings for several hours before reaching a gateway.
Preserve at least:
- Device event time
- Gateway reception time
- Platform ingestion time
- Device sequence number, if available
Using only ingestion time causes subtle errors. A delayed position could be displayed as the animal’s current location or trigger an alert for an event that ended hours earlier.
Processing should distinguish between live events and historical synchronization. Late readings may update route history and aggregates without reopening obsolete incidents.
Sequence numbers are also useful for detecting duplicates and missing packets.
6. Build Geofence Rules for Noisy Coordinates
The naive version of a geofence rule is:
if point is outside polygon:
create alert
That rule will produce false alarms. GNSS accuracy changes with vegetation, terrain, antenna position, weather, and satellite visibility.
A production rule should consider accuracy, persistence, consecutive readings, and physical plausibility:
outside = !geofence.contains(position)
accurate = position.accuracyMeters <= allowedAccuracy
persistent = outsideSamples >= requiredSamples
plausible = calculatedSpeed <= maximumPlausibleSpeed
newIncident = !incidentRepository.hasOpenIncident(animalId, "GEOFENCE_EXIT")
if outside && accurate && persistent && plausible && newIncident:
createIncident(animalId, "GEOFENCE_EXIT")
The recovery condition should have its own persistence window. Requiring the animal to remain inside the boundary before closing the incident introduces hysteresis and prevents repeated state changes near the geofence edge.
7. Convert Sensor Streams Into Behavioral Features
Raw accelerometer and biometric values are rarely useful to end users. Convert them into time-windowed features such as:
- Distance traveled per hour
- Resting duration
- Activity variance
- Feeding-station visits
- Rumination time
- Temperature deviation
- Change from the animal’s normal pattern
Avoid relying only on universal thresholds. Normal activity varies by animal, breed, age, production stage, season, and time of day.
A stronger anomaly pipeline is:
- Establish a baseline for the animal or peer group.
- Extract features over consistent time windows.
- Compare current features with individual and herd-level patterns.
- Combine related weak signals.
- Create a review event with supporting measurements.
The software should present health-related outputs as indicators requiring evaluation, not automatic diagnoses.
8. Make Alerts Stateful
An alert should be an incident with a lifecycle, not a new notification for every matching measurement.
Useful states might include:
OPEN -> ACKNOWLEDGED -> RESOLVED
The incident should record:
- Animal and device context
- Rule and severity
- First and most recent event time
- Supporting measurements
- Assigned user or team
- Acknowledgement and resolution history
Deduplication keys and cooldown periods help prevent notification storms. Escalation rules can notify another person when a high-severity incident remains unacknowledged.
9. Secure Both Telemetry and Commands
Animal tracking data may expose farm activity, physical locations, and valuable assets. Protect the entire path from the collar to the dashboard.
Important controls include:
- Unique device credentials
- Encrypted transport
- Credential rotation
- Signed firmware
- Role-based access control
- Tenant-level isolation
- Audit logging
Apply stricter authorization to device commands than to telemetry reads. A malicious or accidental configuration change could disable reporting, change thresholds, or drain a device’s battery.
10. Monitor the Monitoring System
Missing telemetry does not necessarily mean an animal is inactive. The device, gateway, or network may have failed.
Track system-health metrics such as:
- Devices reporting within the expected interval
- Message delay and sequence gaps
- Gateway availability
- Battery-discharge rate
- GNSS accuracy distribution
- Duplicate-event rate
- Firmware versions
- Alert acknowledgement time
Expose device-health status alongside animal information so operators can distinguish a behavioral anomaly from an infrastructure problem.
Deployment Checklist
Before scaling the system:
- Separate animal and device identities.
- Maintain time-bounded device assignments.
- Test coverage across the actual terrain.
- Measure battery life using the planned reporting interval.
- Define offline storage and synchronization behavior.
- Normalize all vendor payloads.
- Preserve event, reception, and ingestion timestamps.
- Test duplicate, missing, delayed, and out-of-order events.
- Add accuracy and persistence checks to geofences.
- Pilot thresholds with real users before enabling wide deployment.
Conclusion
An animal tracking application is a distributed event-processing system. Its reliability depends less on displaying coordinates and more on how it handles identity, intermittent connectivity, noisy measurements, late events, stateful alerts, and device health.
Design those concerns explicitly from the beginning. The result will be a system that can grow from a small GPS pilot into a dependable livestock or wildlife monitoring application without tying its business logic to one device vendor or one network.
Top comments (0)