Track your cat’s activity with a homemade speedometer
Firstly, hamster wheels for cats are (still) a thing. Secondly, Bengal cats run far. And Shawn Nunley on reddit is the latest to hit on this solution for kitty exercise and bonus cat stats.
Here is the wheel itself. That part was shop-bought. (Apparently it’s a ZiggyDoo Ferris Cat Wheel.)
Shawn has created a speedometer that tracks distance and speed. Every time a magnet mounted on the wheel passes a fixed sensor, a Raspberry Pi Zero writes to a log file so he can see how far and fast his felines have travelled. The wheel has six sensors, which each record 2.095 ft of travel. This project revealed the cats do about 4-6 miles per night on their wheel, and they reach speeds of 14 miles an hour.
Here’s your shopping list:
Shawn soldered a 40-pin header to his Raspberry Pi Zero and used jumper wires to connect to the sensor. He mounted the sensor to the cat wheel using hot glue and a pill box cut in half, which provided the perfect offset so it could accurately detect the magnets passing by. The code is written in Python.
Upcoming improvements include adding RFID so the wheel can distinguish between the cats in this two-kitty household.
Shawn also plans to calculate how much energy the Bengals are expending, and he’ll soon be connecting the Raspberry Pi to their Google Cloud Platform account so you can all keep up with the cats’ stats.
And, get this – this was Shawn’s first ever time doing anything with Raspberry Pi or Python. OK, so as an ex-programmer he had a bit of a head start, but he assures us he hasn’t touched the stuff since the 1990s. He explains: “I was totally shocked at how easy it was once I figured out how to get the Raspberry Pi to read a sensor.” Start to finish, the project took him just one week.
Thanks for blogging this! I’ll make the python code available if anybody wants to use it or improve on it.
Raspberry Pi Staff Ashley Whittaker — post author
I found it easier to us hall sensors and a couple of magnets when I did a simular project with my bike
You have cats that can ride your bike? Vids, PLEASE!!!
shambhu dayal sharma
Thanks . i have a pet name lio . i like it very much
That is very cool!
Now hook up a generator and get your cat to charge your phone ;-)
Could you publish the wiring and code please. I tried working with a reed switch but get no signal
Very nice blog.