A Simple Pet Activity Tracker
Made by Peng Dou, Maria Jose Fernandez and Sohail Shaikh
Made by Peng Dou, Maria Jose Fernandez and Sohail Shaikh
Device inspired from Migo- IOT PET DEVICE & The Discreet Window
Created: November 30th, 2022
There are several pet owners who are concerned about their pets’ activities but are unable to track it. Our product Pet Activity Tracker is a smart product that will track a pet’s activity by displaying how active is the pet on a discrete window (7 strings for 7 days). While the ultimate product will have 7 strings that will record fitness data on a day level, our initial prototype will include only one string whose length will be according to the pet’s activity. Along with tracking pets’ activity, we will also develop a feature that gives the owner the power of interacting with their pets through using vibration (tag) on their neck.
Many of the pet trackers in the market are mainly used for location purposes (GPS Tracker). Nevertheless, we found useful to have a tracker that measures the activity of your pet as it could prevent many diseases that derivate from sedentarism. Sedentarism can be especially harmful to dogs, and the main consequence is obesity. This in turn, leads to a number of problems such as heart and joint disease, increase in incidencee of malignant tumours and less resistance to infectious diseases. Additionally, having an ambient way of real-time feedback on pets activity would be interesting to pet owners, since they will feel more connected to their pets.
Besides that, with many people returning to the office, the pets can feel, even worse than before, the absence of their owners. For this, the interaction feature was also added.
One of the key readings that we took into account for developing the tracker and the case around it was "Chapter 5: Designing Meta Products,...". Network focus design was essential for us to start identifying the actors and the roles and interactions they all have within a specific experience. An important step in the process of design was to imagine how related actions happen at a time (Phase 2 NFD), define the criteria and the key touchpoints to then start testing the tracker.
At the same time, we took into account three main qualities for our design: usability, loveability and wearability. (The seven abilities of Enchantment).
We had initially planned for developing a device having 7 strings- One string/ servo motor for each day but later we decided to develop only one string for one day to be able to complete the entire design within the deadline.
We faced challenges with the step counter initially and to connect it with another argon device over the cloud. The Vibration of the servo motor as well was a lot higher in the initial version and later we had to work with many iterations to get a visible vibration according to the speed of the pet.
While designing for the demo, our initial plan was to hang it like the discrete window, but we decided to develop a stand to bee kept on the table.
Our overall product design was made with the cardboard. If we had more time we would laser cut and use some other material make the product more appealing to the user.
The overall product size turned out to be large, we would like to minimize it further. Also, the Servo motor has a limited life and as this device will use servo motor extensively, We would like to find an alternative for the servo motor. Also, We would like to do a market research to understand the demand for this product in the market.
Two argon devices will be connected over cloud. One device has a servo motor which is the output device and another device has an accelerometer connected to it. This accelerometer would be connected to the pet in their collar.
The pet Collar would detect steps and motion which will be communicated over cloud to the other device having a servo motor. The Servo motor has a string attached to it which will either vibrate (To show that the pet is in motion) or increase in length based on the number of steps.
We primarily referred to the below articles for idea and the coding part was done based on the work done in the labs as a part of the course structure:
IoT Pet Devices: https://www.yankodesign.com/2021/08/13/these-iot-pet-devices-uses-smart-technology-to-allow-owners-to-interact-with-their-dogs-while-away-from-home/
The Discreet Window: http://ishback.com/discreet-window/index.html
//Code for Servo Motor
int solPin = A3;
bool shouldActivate = false;
Servo myServo;
int servoPos = 0;
int vibration = 12;
bool vibrate_up = true;
int level = 0;
int step = 0;
void handleActivateMotor( const char *event, const char *data)
{
char raw[20];
strcpy(raw, data);
char *level_raw = strtok(raw, ",");
char *step_raw = strtok(NULL, ",");
level = atoi(level_raw);
step = atoi(step_raw);
Serial.print(level);
Serial.print(",");
Serial.println(step);
}
void setup()
{
myServo.attach(solPin);
// Particle.function("servo", servoControl);
Particle.variable( "servoPos" , &servoPos , INT );
Particle.subscribe( "blinkLED", handleActivateMotor );
}
void loop()
{
if(level == 0) {
if(step < 50) {
servoPos = constrain(step + vibration, 0, 130);
}
else {
servoPos = constrain(50 * 2 + vibration, 0, 130);
}
}
else {
if(vibrate_up) {
if(step < 100) {
servoPos = constrain(step + 2 * vibration, 0, 130);
}
else {
servoPos = constrain(50 * 2 + 2 * vibration, 0, 130);
}
vibrate_up = false;
}
else {
if(step < 100) {
servoPos = constrain(step, 0, 130);
}
else {
servoPos = constrain(50 * 2, 0, 130);
}
vibrate_up = true;
}
}
myServo.write(servoPos);
if(level != 0) {
delay(300 / level);
}
}
Click to Expand
// Code for Accelerometer
#include <Adafruit_Sensor.h>
#include "Adafruit_LIS3DH.h"
// Used for software SPI
#define LIS3DH_CLK 13
#define LIS3DH_MISO 12
#define LIS3DH_MOSI 11
// Used for hardware & software SPI
#define LIS3DH_CS 10
int buttonPin = D3;
float ax, ay, az;
int counter = 0;
int bufferCounter = 0;
int step = 0;
int step_prev = 0;
float tempL = 0;
float temp2L = 0;
int press_num = 0;
// Parameters
int frameSize = 200;
const int bufferSize = 10;
// int minGlitch = 6;
int minGlitch = 8;
int maxGlitch = 300;
float last_az = 0.0;
int glitch_count = 0;
int loop_count = 0;
int level = 0;
float t;
float buffer[bufferSize];
Adafruit_LIS3DH lis = Adafruit_LIS3DH();
void setup(void) {
Serial.begin(9600);
Serial.println("LIS3DH test!");
if (! lis.begin(0x19)) {
Serial.println("Couldnt start");
while (1);
}
Serial.println("LIS3DH found!");
lis.setRange(LIS3DH_RANGE_4_G);
Serial.print("Range = "); Serial.print(2 << lis.getRange());
Serial.println("G");
pinMode( buttonPin , INPUT_PULLUP);
}
void loop() {
int buttonState = digitalRead( buttonPin );
if( buttonState == LOW )
{
step = 0;
}
lis.read();
sensors_event_t event;
lis.getEvent(&event);
ax = event.acceleration.x * 9.8;
ay = event.acceleration.y * 9.8;
az = event.acceleration.z * 9.8;
bufferCounter++;
if (bufferCounter <= bufferSize) {
float value = (ax * ax + ay * ay + az * az - 96.04);
buffer[bufferCounter - 1] = value;
}
else {
float processed_data = 0;
// Mid Filter
processed_data = buffer[bufferSize/2];
counter++;
if (temp2L < tempL && tempL > processed_data && tempL > minGlitch && tempL < maxGlitch) {
step++;
}
temp2L = tempL;
tempL = processed_data;
memset(buffer, 0, sizeof(buffer));
bufferCounter = 0;
}
if(abs(event.acceleration.z - 1.0) > 0.3) glitch_count++;
int val = abs(last_az - event.acceleration.z) > 0.5 ? 30 : 60;
int threshold = 192;
if(loop_count > threshold) {
if(glitch_count > threshold / 2) {
level = 5;
}
else if(glitch_count > threshold / 8) {
level = 3;
}
else if(glitch_count > 1) {
level = 1;
}
else {
level = 0;
}
if(step - step_prev > 0 && level == 0) {
level = 1;
step_prev = step;
}
loop_count = 0;
glitch_count = 0;
Particle.publish( "doPairedPublish", String::format("%d,%d", level, step));
}
Serial.print(step);
Serial.println();
last_az = event.acceleration.z;
delay(5);
loop_count++;
}
Click to Expand