Hamster tracker

Posted on 26/08/2012 by vendorf70
Modified on: 13/09/2018
Project
Press to mark as completed
Introduction
This is an automatic import from our previous community platform. Some things can look imperfect.

If you are the original author, please access your User Control Panel and update it.

Hamster tracker is a project that came from a hamster forum, my GF reads. A guy there had put a bike computer on his the hamster wheel to measure the speed. I thought that I could do that in a bit more complicated way. So I started to figure out, what we needed and the speed would just not do it for me. So I thought that the proper way to it, would be to store all the runs in a database, for later analysis. This would also make it possible to display some info on the internet. So the system ...


Hamster tracker

Hamster tracker is a project that came from a hamster forum, my GF reads. A guy there had put a bike computer on his the hamster wheel to measure the speed.

I thought that I could do that in a bit more complicated way. So I started to figure out, what we needed and the speed would just not do it for me. So I thought that the proper way to it, would be to store all the runs in a database, for later analysis. This would also make it possible to display some info on the internet.

So the system I based on a Arduino NANO to read the magnetic switch (I borrowed from a bike computer).

The inner circumference of the wheel is 60cm, so for each tick, the hamster have run 60cm. The Arduino just count ticks and every second sends then thru bluetooth to my server.

On the server I have a small C# program, that connects to the bluetooth port and recives the ticks from the Arduino. The ticks are calculated into cm and then stored in my MySql database with a time stamp for when they were recived.


Note: Firste field is if the program is connected to the bluetooth, second is just a number to se if its alive, third is the number recived via bluetooth.

In the database I have made a lot of different views for the stuff I want to show on my Web page. I believe that larger amount of data is better handled in the database, than in the web server. So my views only return a minimum of data.

I have then written some PHP for my web page, to display the data in a proper manner.

Visit the page here: http://hobby.vendorf.dk/viewpage.php?page_id=1

I hope this can bring some ideas up out there. Or at least follow the hamster running for life.

Trackes the running distance for a hamster wheel.

  • Control method: Magnetic
  • CPU: Arduino NANO (atmega328)
  • Operating system: windows XP
  • Power source: 5v power supply
  • Programming language: C++, C#, MySQL
  • Sensors / input devices: Magnetic switch from a bike computer.
  • Target environment: indoor
LikedLike this to see more

Spread the word

Flag this post

Thanks for helping to keep our community civil!


Notify staff privately
It's Spam
This post is an advertisement, or vandalism. It is not useful or relevant to the current topic.

You flagged this as spam. Undo flag.Flag Post