Let's Make Robots!
tc  

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.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
amando96's picture

This gave me a brilliant idea...

 

 

Wait for it...

 

 

Hamster races via web, race any hamster anywhere in the world

 

 

 

ChuckCrunch's picture

you could compare stats , leader board, fastest and longest running, all kinds of cool stuff. LRH let's race hamsters, it would be fun, maybe other animals hummmm cool idea :D