Project tutorial
If This Then Cat

If This Then Cat

Wondering if your cat is sleeping all day or running around the hood? Check it out with this tracker!

  • 10,967 views
  • 4 comments
  • 17 respects

Components and supplies

Necessary tools and machines

3drag
3D Printer (generic)

Apps and online services

About this project

This little device allows you to track the physical activity of your cat (or your dog, but not your goldfish) and to store those data on a Google Spreadsheet using IFTTT, a well-known website for connecting various apps and services together.

Introducing IFTTT

First thing to do is to set up our IFTTT recipe.   

You can register here, make sure to use your Google email and you familiar with the IFTTT website. 

Ok, now we have to configure our recipe. The first step is to choose the Trigger (or the This), in this case is the Maker Channel, which allows IFTTT to respond to arbitrary webhooks.

The only configurable part of a "Maker Channel" trigger is the event name, which is how IFTTT will know to trigger this particular recipe.

Next we have to configure the Action (or the That) portion of the recipe, which in this case is the Google Drive channel. There are a number of possible actions that can be done with the Google Drive channel, but for our purpose we only need the "Add Row To Spreadsheet" action.

You can name and place your spreadsheet as you please. The important part, though, is the row formatting. The IFTTT Maker trigger has very specific naming conventions, which is where these field names come from.

Note that 'OccurredAt' is the name of the cell that will be filled with the data that the IFTTT trigger fired. The second cell will be filled with the data we decide to store. 

Accelerometer

For this project we used a 3-axis accelerometer and its library.

In the library there are already included two useful functions: Activity and Inactivity. We basically start a timer when the Activity function is triggered and stop it when an Inactivity is detected.

  int Status = ReadAccelerometer();

  if ( Status == 1 && LastStatus != 1) {
    Serial.println("Timer started");
    LastStatus = 1;
    ActivityTimer = millis();
  }

  else if ( Status == 0 && LastStatus != 0) {
    Serial.println("Timer stopped");
    LastStatus = 0;
    Counter = Counter + (millis() - ActivityTimer) / 1000; // Transform                        millis in seconds
  }

Code

Arduino

Custom parts and enclosures

Collar White
Collar Orange

Schematics

IFTTCat Schematics
Ifttcat

Comments

Similar projects you might like

Pavlov's Cat

Project tutorial by Team Arduino

  • 20,345 views
  • 2 comments
  • 36 respects

IoT Gauge with Arduino, Yaler & IFTTT

Project tutorial by Thomas Amberg

  • 5,499 views
  • 8 comments
  • 25 respects

How to Make a Cat Laser Pointer

Project tutorial by circuito.io team

  • 2,650 views
  • 3 comments
  • 8 respects

Issue Printer

Project tutorial by Arduino_Genuino

  • 7,467 views
  • 0 comments
  • 23 respects

Smart Thermostat

Project tutorial by Arduino_Genuino

  • 69,289 views
  • 10 comments
  • 83 respects

LazerDazer: Arduino Laser Cat Toy

Project tutorial by RobotGeek Projects Team

  • 6,631 views
  • 0 comments
  • 15 respects
Add projectSign up / Login