A collar tracker that shows your pet’s location and whether it is resting, walking or running.
Built and tested by Drisya K S · Industrial Robotics Institute

A small IoT tracker for a pet’s collar. A Neo-6M GPS module finds where the pet is, and an MPU6050 accelerometer measures how much it is moving. The ESP32 sends the latitude, longitude and activity (Resting, Walking or Running) to the Blynk app every second.
| Component | Qty |
|---|---|
| ESP32 Dev Board | 1 |
| GPS Module (Neo-6M) | 1 |
| Accelerometer (MPU6050) | 1 |
| Rechargeable Li-ion Battery | 1 |
| Jumper Wires / Breadboard | As needed |
| From | Connect to |
|---|---|
| GPS VCC | 3.3V |
| GPS GND | GND |
| GPS TX | GPIO 16 (RX) |
| GPS RX | GPIO 17 (TX) |
| MPU6050 VCC | 3.3V |
| MPU6050 GND | GND |
| MPU6050 SDA | GPIO 21 |
| MPU6050 SCL | GPIO 22 |
| Li-ion battery | ESP32 power input |
Complete, tested Arduino C++ code for this project. Copy it into Arduino IDE and upload it to the ESP32.
#define BLYNK_TEMPLATE_ID "YourTemplateID"
#define BLYNK_TEMPLATE_NAME "Pet Tracker"
#define BLYNK_AUTH_TOKEN "YourAuthToken"
#include <Wire.h>
#include <WiFi.h>
#include <MPU6050.h>
#include <TinyGPS++.h>
#include <HardwareSerial.h>
#include <BlynkSimpleEsp32.h>
TinyGPSPlus gps;
HardwareSerial gpsSerial(1); // RX = 16, TX = 17
MPU6050 mpu;
char ssid[] = "YourWiFiName";
char pass[] = "YourWiFiPassword";
void setup() {
Serial.begin(115200);
Wire.begin();
mpu.initialize();
gpsSerial.begin(9600, SERIAL_8N1, 16, 17);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
}
void loop() {
// Read GPS
while (gpsSerial.available() > 0) gps.encode(gpsSerial.read());
Blynk.virtualWrite(V1, gps.location.lat());
Blynk.virtualWrite(V2, gps.location.lng());
// Read accelerometer
int16_t ax, ay, az;
mpu.getAcceleration(&ax, &ay, &az);
long movement = abs(ax) + abs(ay) + abs(az);
String activity;
if (movement < 10000) activity = "Resting";
else if (movement < 30000) activity = "Walking";
else activity = "Running";
Blynk.virtualWrite(V3, activity);
Blynk.run();
delay(1000);
}A small IoT tracker for a pet’s collar. A Neo-6M GPS module finds where the pet is, and an MPU6050 accelerometer measures how much it is moving.
You need: ESP32 Dev Board (1), GPS Module (Neo-6M) (1), Accelerometer (MPU6050) (1), Rechargeable Li-ion Battery (1), Jumper Wires / Breadboard. Software: Arduino IDE, Blynk IoT app, TinyGPSPlus library, MPU6050 library.
It is rated advanced and takes about 3–4 hours to build, using the ESP32. The guide on this page explains every connection and step.
The complete, tested Arduino C++ code is free on this page. Copy it into Arduino IDE and upload it to the board.
Yes. IRI sells a kit with the parts for this project (PRJ-106). Message IRI on WhatsApp at +91 86060 82634 for the kit price and delivery details.