Built to order

Wireless Cattle Health Tracking Collar with Temperature and Activity Sensing (ESP32)

A wearable ESP32 collar tracks cattle body temperature and activity, streaming both to a cloud dashboard. A waterproof DS18B20 probe against the skin catches fever early; an MPU6050 counts steps and classifies grazing versus resting with on-device threshold logic. The dashboard shows per-animal temperature trends, activity timelines and alerts when readings cross safe limits, so sick animals are spotted earlier than manual checks. Suitable for B.E./B.Tech final-year projects in Electronics, Electrical and Computer Science.

IoT & Embedded MPU6050 accelerometerHTML · CSS · JavaScript dashboardESP32 · Wi-Fi3D-printed enclosureDS18B20 temperature sensorArduino IDE · C++ firmwareMQTT · HTTP uplinkTP4056 · 18650 batteryHybrid
Wireless Cattle Health Tracking Collar with Temperature and Activity Sensing (ESP32) — project thumbnail preview
More project photos (2)

The problem

Small dairy and cattle farms lose animals to illness that is noticed too late — a cow with rising fever is often spotted only when it stops eating, by which time treatment is harder and more expensive. Commercial livestock monitoring collars exist but are priced far beyond what a small Indian farm can afford, and they hide their workings from the student who wants to learn. This project builds an affordable collar from first principles: an ESP32 reads a waterproof DS18B20 temperature probe pressed against the skin and an MPU6050 accelerometer that tracks movement, then pushes compact readings to a cloud dashboard over Wi-Fi every ten minutes. The dashboard plots each animal's temperature curve and activity timeline, and raises alerts when temperature crosses the fever threshold or activity drops sharply. Every part — firmware, wiring, enclosure, dashboard code — is built in the open, so the student can genuinely explain and defend the design.

SYSTEM FLOW

7 components 6 connections

Live flow
Drag to explore
100%
sensorTemp probe

DS18B20 capsule pressed against the neck skin; reads every 10 min.

Follow the working sequence

How it works

  1. The DS18B20 probe is mounted on the inside of the nylon collar strap so its steel capsule presses lightly against the animal's neck skin.
  2. Every 10 minutes the ESP32 wakes from deep sleep, reads the temperature at 12-bit resolution (0.0625°C steps) and samples the MPU6050 accelerometer.
  3. A step-detection routine counts movement peaks; a threshold on step count classifies the last 15 minutes as grazing/walking or resting/ruminating.
  4. The readings are packed into a compact JSON payload and sent over Wi-Fi (HTTP/MQTT) to the cloud backend with the collar ID.
  5. The backend stores the data and the dashboard renders per-animal temperature trend lines with the 39.5°C fever threshold overlaid, plus a grazing-vs-resting bar timeline.
  6. Threshold rules run on each new sample: three consecutive readings above 39.5°C raise a fever alert; a 6-hour step count 40% below the animal's average raises a low-activity alert.
  7. The ESP32 returns to deep sleep, waking only for the next reading cycle to keep battery drain minimal.

Tech stack:

  • ESP32 (dual-core 240 MHz, Wi-Fi 802.11 b/g/n)
  • DS18B20 digital temperature sensor (OneWire)
  • MPU6050 accelerometer + gyroscope (I2C)
  • Arduino IDE (C++ firmware)
  • TP4056 Li-ion charging module, 18650 cell
  • HTTP/MQTT uplink to cloud backend
  • HTML/CSS/JavaScript dashboard
  • 3D-printed enclosure + nylon collar strap
Parameter Value
Temperature sensor DS18B20, −55 to +125°C range (datasheet value)
Temperature accuracy ±0.5°C from −10 to +85°C (datasheet value)
Accelerometer MPU6050, ±2g/±4g/±8g/±16g selectable ranges (datasheet value)
Sampling Temperature every 10 min; activity classified in 15-min windows (design)
Fever threshold 39.5°C, 3 consecutive readings (configurable)
Battery 18650 Li-ion, TP4056 charging (typical 2600 mAh cell)
Battery life Approximately 5–7 days per charge (design target, 10-min uplink interval)
Collar weight Approximately 180–220 g including battery (design target)
Wireless Wi-Fi 802.11 b/g/n; farm-Wi-Fi dependent (expected)
Strap Nylon, adjustable (approximate fit for adult cattle)

Project features

  • [Skin-contact temperature sensing] A waterproof DS18B20 probe on the strap reads skin-adjacent temperature on a fixed 10-minute schedule, with the dashboard flagging readings above the 39.5°C fever threshold.
  • [Activity and step tracking] The MPU6050's accelerometer feeds a step-counting routine; on-device thresholds classify each 15-minute window as grazing/walking or resting/ruminating — simple, transparent threshold logic, no ML black box.
  • [Cloud dashboard per animal] The web dashboard shows each animal's 24-hour temperature trend chart, a grazing-versus-resting activity timeline, device battery levels and an alert feed.
  • [Automatic health alerts] Fever-risk, low-activity and low-battery alerts are generated by threshold rules and pushed to the farmer's phone, with each alert listing the animal, the reading and the time.
  • [Low-power collar design] The ESP32 spends most of its time in deep sleep between sensor reads and uploads, running for days on a single 18650 cell with TP4056 charging.
  • [Calibratable thresholds] Fever and activity thresholds are stored as configuration values with a calibration guide, so they can be tuned per breed and age rather than hard-coded.
  • [Multi-collar farm view] The dashboard is built around a collar ID registry, so additional collars can be added without changing the firmware design. (Implemented in the dashboard and data schema; extra collar hardware is a separate order.)

What is included

  • Complete ESP32 firmware (sensor drivers, step counting, deep-sleep scheduling, Wi-Fi uplink)
  • Cloud dashboard source code (per-animal trends, activity timeline, alert feed)
  • Wiring diagram and 3D-printed enclosure design files
  • Threshold calibration guide (fever and activity tuning per breed/age)
  • Assembled collar prototype (ESP32, DS18B20 probe, MPU6050, battery, strap)
  • Project report PDF (background, system design, firmware logic, testing, limitations)
  • PPT presentation for final review
  • Viva Q&A preparation document (sensors, OneWire/I2C, deep sleep, threshold design, MQTT vs HTTP)

Limitations & prerequisites

  • Skin-contact temperature reads lower and noisier than core body temperature; the probe must sit snugly against the neck, and readings drift if the strap loosens — calibration against a veterinary thermometer is covered in the calibration guide.
  • The ESP32 uses Wi-Fi, so collars only work within farm Wi-Fi range (typically tens of metres); a LoRa variant for larger pastures is future scope, not part of this build.
  • Battery life is a design target of 5–7 days; weak Wi-Fi signal or frequent retransmissions shorten it, and the collar must be removed for charging via the TP4056 USB port.
  • Activity classification is threshold-based step counting, not machine learning — it distinguishes active from resting periods but cannot identify specific behaviours like rumination or lameness.
  • This is an early-warning aid, not a veterinary device: alerts flag anomalies for the farmer to check; no diagnosis or treatment claim is made.
  • The enclosure is splash-resistant from the 3D print, not IP-rated; prolonged submersion or heavy monsoon exposure without a sealed case will damage the electronics.

Frequently Asked Questions

How does the collar detect fever?

The DS18B20 probe presses against the neck skin and samples temperature every 10 minutes. Three consecutive readings above the 39.5°C threshold raise a fever-risk alert with the animal's ID, the readings and the time — the dashboard also draws the animal's trend line against the threshold.

Is any machine learning used?

No — the activity classification is honest threshold logic: a step-detection routine on the MPU6050 counts movement peaks, and a threshold on the count classifies each 15-minute window as grazing/walking or resting. This keeps the build explainable and debuggable in a viva.

How accurate is the skin-contact temperature?

The DS18B20 itself is ±0.5°C accurate (datasheet), but skin readings run below core temperature and depend on strap fit. The build includes a calibration procedure: compare the first readings against a veterinary thermometer and set per-animal offsets and thresholds.

What happens when the collar is out of Wi-Fi range?

Readings from that window are lost — the build has no local storage buffer. The dashboard shows the collar's last sync time so gaps are visible. A LoRa version for larger pastures is listed as future scope.

How long does the battery last?

The design target is 5–7 days per charge with the 10-minute uplink interval, using deep sleep between reads. The collar is removed for USB charging through the TP4056 module, and the dashboard shows each collar's battery level.

Is this project suitable for a final-year project?

Yes — for Electronics, Electrical and Computer Science programs. It covers sensor interfacing (OneWire, I2C), embedded C++ firmware, low-power design, and a real IoT data pipeline with a working dashboard, all of which make strong viva material.

Components & software requirements
  • ESP32 (dual-core 240 MHz, Wi-Fi 802.11 b/g/n)
  • DS18B20 digital temperature sensor (OneWire)
  • MPU6050 accelerometer + gyroscope (I2C)
  • Arduino IDE (C++ firmware)
  • TP4056 Li-ion charging module, 18650 cell
  • HTTP/MQTT uplink to cloud backend
  • HTML/CSS/JavaScript dashboard
  • 3D-printed enclosure + nylon collar strap
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and email — the synopsis PDF downloads immediately. We may send occasional project updates; no spam, unsubscribe anytime.

Get a quotation