Skip to content

Commit

Permalink
added project: running wheel tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
mtln committed Nov 16, 2024
1 parent fa2cd3d commit 3008f3b
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 0 deletions.
Binary file added nbs/DeguFerien.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added nbs/Degu_24h.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added nbs/Degu_Beschallt_d1-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions nbs/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"source": [
"As a kid, whenever someone asked what I wanted to be when I grew up, I’d always say, 'an inventor.' Starting October 23, 2024, I'll be documenting my projects. So stay tuned and follow me as the website grows! \n",
"\n",
"* 2024-11-16: [Running Wheel Tracker](/10_andri.ipynb#running-wheel-tracker) Pet cage upgraded for the IoT era\n",
"* 2024-11-14: [Andri's CV](/11_andri_cv.ipynb) Joyfully bound to the endless journey of learning\n",
"* 2024-11-10: [Anelec, 1985-1990](/10_andri.ipynb#anelec) My first company at the age of 12\n",
"* 2024-11-08: [WhatsAppChatConverter, 2024-](/10_andri.ipynb#whatsappchatconverter) My father asked me how he could print his WhatsApp chat history with my late brother. I had to realize that this was not possible, and there was no useful free tool to archive or print a chat in a nice format. So, I wrote one.\n",
Expand Down
7 changes: 7 additions & 0 deletions nbs/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@
"year_end": 1990,
"quote": "My first company at the age of 12",
"description": "A funny memory I found at my brother's place in 2024: A catalog from 1986, when I was 13 years old. I already had a 'company' named 'Anelec' (derived from Andri Electronics). I etched circuit boards at home in the laundry room and sold kits and electronic circuits at school. I remember that the mother of a classmate was quite shocked when I sold her son a light organ with the note '220 volts! Danger of death!' and some drawn skulls on the circuit board 😀.\n\n ![A page from 'Anelec Catalog 1986'](Anelec.jpg)"
},
{
"title": "Running Wheel Tracker",
"year_start": 2018,
"year_end": 2018,
"quote": "Pet cage upgraded for the IoT era",
"description": ""
}


Expand Down
34 changes: 34 additions & 0 deletions nbs/running-wheel-tracker.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
We have three [degus](https://en.wikipedia.org/wiki/Common_degu), and in their three-story cage, the animals have various climbing options as well as a running wheel and two spinning plates.
### Activity tracking
Are they really only active during the day? When and how much do they run? I wanted to know for sure, so I installed sensors in their running wheel and on their two spinning plates, where they run their laps daily. I connected the sensors to a microcontroller and programmed it to send rotation data to my server, which generates charts that I can view from anywhere. This way, I know when they run their laps—and how many laps they complete. Does that sound absurd? Kind of. Many people track their fitness with pedometers and similar devices, even though they should already have a pretty good sense of how far they've walked, considering they take the steps themselves. It's different with pets. What do they actually do during all the hours I spend at work or asleep? No idea. It could be interesting, right?
![Activity by time of day](Degu_24h.png)

The chart shows activity grouped by time of day. From 9 p.m. to 7 a.m., they actually sleep. During the day, and especially in the early evening, they run quite a lot. Over 30 days, the animals ran a total of 200,000 laps. Technical details: On the back of the running wheel, I attached a small magnet and on the stationary part, a Hall effect sensor. This is connected to an ESP-32 microcontroller, which tracks the laps and reports them to the server.
```{mermaid}
flowchart TD
A1[Running Wheel] -->|Hall Effect Sensor Signal| B(ESP32 Microcontroller)
A2[Spinning Plate 1] -->|Hall Effect Sensor Signal| B(ESP32 Microcontroller)
A3[Spinning Plate 2] -->|Hall Effect Sensor Signal| B(ESP32 Microcontroller)
B --> |WLAN --> Internet| C{Web Server}
C <--> D(Database)
C --> E[Statistics Dashboard]
```

### Behavior during vacation
During a fall break, the degus (apart from brief "feeding visits" from the neighbor) were alone at home. The following chart shows the number of laps per day. The animals were much less active during our absence, from October 7 to 12, than they were before. Was it because of the light, since it was darker in the apartment? We had the shutters partially closed. On the next occasion, I tried it with more light, but even then, the degus were much more passive when they were alone at home.
![Actvity during vacation](DeguFerien.png)


### Audio stories for degus

The next hypothesis was, therefore: the quieter it is in the apartment, the less active the degus are. To test this, an installation was needed that would play audio for the degus at a specific time during the second week of vacation. This required a device that would automatically start playing when powered by a timer.

The [Gschichtefritz](/10_andri.ipynb#gschichtefritz) audio stations I built for public libraries met this requirement. So, I quickly connected an audio station to an amplifier, linked both to a timer, and set it to play Blue Dino stories near the degu cage in the mornings from around 7–8 a.m. and in the evenings from about 6–7:30 p.m. There was also a reason why the degus could only listen to stories at these off-peak times: during the second vacation week, the building manager was supposed to visit the apartment at some point to repair a broken shutter. He probably would have thought we were completely nuts if children's stories about the Blue Dino started playing next to the degu cage while he was there...

### When the Blue Dino plays, they run
The following three charts show how many laps the degus ran at different times of the day in the days that followed.
![Actvity with audiobook](Degu_Beschallt_d1-3.png)

* Day one: Until the installation was activated at noon, the degus were passive. But when the Dino stories began playing in the evening around 6 p.m., the degus started running—and only for as long as the stories were playing.
* Day two: The animals were active precisely during the times the stories were playing.
* Day three: The same behavior pattern appeared again. Whether this was because they recognized my voice or if they would have run to Beethoven or The

0 comments on commit 3008f3b

Please sign in to comment.