Monday, January 11, 2010

How Far Does a Hamster Run?

About two years ago my housemates and I started wondering if our hamster, Lizzie, could run across the United States in her lifetime. I built a device to count revolutions of her wheel and a website to track her status. Recently Lizzie passed away making it almost 1000 miles (or about a third) of her journey. We were sad to see her go, but she left some interesting data.

How far does a hamster run?
Over her recorded life, Lizzie ran an average of 1.65 miles per day. In the first half of her life this average was higher at 2.27 miles per day. Later in her life, as she started getting old and sick, it dropped to 0.88 miles.

As one might expect, over time she ran less and less per month. Below is a graph of the distance she ran each month, the amount of time she spent running, and her average speed.
There are a couple interesting insights in this graph.
  • Lizzie ran a lot less in Dec-08 and Jan-09 (10 miles a month down from 40). We're not entirely sure what caused this but suspect it was some sort of pseudo hibernation. We know that we hadn't managed the heat well and there were a couple days when the temperature dropped inside the house which might have triggered this instinct. However she was still eating, drinking, and pooping fine.
  • In the precipitous decline at the end of her life, she both ran more slowly and ran less. This is in contrast to her pseudo hibernation where she just spent less time running. This might be a way to tell if a hamster is unhealthy (if you're not already being a diligent pet owner).

When does a hamster run?
Anyone who's owned a hamster and has been kept up by the pitter patter of little hamster feet running on the wheel knows that they're nocturnal. This was confirmed by our observations. As seen below, she runs almost exclusively at night.

I wish I had recorded light levels in her cage to see if the room lights and my roommate's sleep schedule) affected when she ran.


How fast does a hamster run?
Over her recorded lifetime she ran an average of 1.51 mph. This was higher when she was younger in 2008 at 1.62 mph and significantly lower as she got older in 2009 at 1.18 mph. Her top speed was about 2.5 mph.

This can also be graphed in interesting ways. Below shows how many miles he ran at each speed in 1/100th of a mph increments.
There's a spike at 0 mph which probably came from her starting and stopping, which she did a lot. In fact, if you were in the room watching her, she'd start and stop very often just to check if you were still there.

Looking rest of the graph, we see two peaks in the total (red line), almost as if she had two preferred speeds. It turns out that after whatever happened to her in the winter of '09, her preferred speed switched from 1.6 mph to 1.2 mph. Looking at the years by themselves (purple and green lines) we get something that looks a little closer to a bell curve (or some sort of distribution around a mean). Putting all three of these together we can see how 2008 and 2009 add to create the two peaks that we see in the total curve.

What's next?
Well the scientist in me would like to buy 5 more hamsters to see if these results are typical and measure more variables (like temperature, water consumption, and light levels). Realistically I think we're just going to get a new hamster to pick up where Lizzie left off. However, we are going to bury Lizzie's cremated remains where she stopped, in Carson National Forest in the Spring.

If you have more questions, check out the FAQ. Also, if you want to track your own hamster, I wrote an Instructable you can follow.

Technologies: PHP, Python, MySQL, Google Docs

Thursday, January 7, 2010

Singlespeed Handlebar Chop and Flip

About a year ago I bought a a $10 road bike off of Craigslist and converted it into a super hip single speed. While using it to commute to work, I started to get annoyed at the dropped handle bars. They were lower than my regular road bike making the brakes hard to reach. I decided to go even more hipster and convert them to bullhorn handlebars.

Overall the process was pretty simple. First I removed the handlebars from the bike as well as the brake cable (which was going to be replaced as well).


Next I chopped the handle bars to the correct length using a pipe cutter. If you do this yourself, I highly recommend this route as I've cut pipes with a Dremel before and this was significantly simpler. I sanded around the edge of the cut to clean it up a bit since the pipe cutter left it sharp.


Finally, I installed the handlebar again, hooked up the brake lever that I pulled from a defunct mountain bike, and wrapped the whole thing with some image appropriate bright orange handlebar tape. The mountain bike brake lever is really nice since its easier to pull a greater distance than the road lever that was on there. The picture below shows the the bike ready to ride (with my GPS and light).


Now please excuse me while I role up my skinny jeans, put on my Chrome messenger bag, and grab a can of PBR.

* Note: All hipster references are meant to be ironic. The writer of this blog does note condone or support the hipster lifestyle in any way.

Technologies: Pipe Cutter, Basic Tools

Wednesday, December 30, 2009

Tracking Commute Times

A couple years ago I rigged up some GPS tracking on my car. I have a Garmin GPS 18 OEM hooked up to a laptop which sends this data over my phone to a custom site I created. There's tons of interesting analysis that can be done with this data but the one that has the highest proportion of my mind share is analyzing my commute (since I do it every day).

One function that I implemented in this site is a "path search". Basically it lets you define two points and then finds all of the paths between those points with relevant statistics like how far you drove and for how long. I did this for my commute to get a graph of durations by when the commute started. Blue is to work and red is from work.

Its pretty obvious the effect of rush hour on both the outgoing and incoming routes. The discrepancy in the duration of the two directions is interesting and most likely caused by the 5 (count them ... 5) lights I have to go through in the 1/4 mile it takes to get onto the freeway from my house. The offramp on the way back skips most of these.

Another set of interesting conclusions that can be gained from this is information about when and how long I work. I rarely leave before 9 and this is good because traffic gets significantly better by then (like a 2x shorter commute according to this graph).

  • Average Arrival Time: 9:47 AM
  • Average Time at Work: 9.46 hours
  • Average Departure Time: 7:14 PM
Both the arrival and departure times make sense with what I'd say prior to this if asked. For some reason I never subtracted the two since the average time at work seemed higher than I would have guessed.

Technologies: PHP, Google Docs, MySQL

Using a Traffic Light as a Bike Light

The sun sets earlier in the winter meaning I've started spending more time riding in the dark. When riding in the dark, its important to stay safe by being visible to cars. Visibility in turn correlates with how big / obnoxious your lights are. As a result, I decided to make the "safest" bike light possible using a 9" traffic light I picked up at a local surplus warehouse.



The whole thing is powered by a $20 UPS that I picked up at Fry's. To get it to blink, I opened it up and put a solid state relay in line with the output from the battery. This is then controlled by a small blinker circuit. This should last about 6 - 8 hours of continuous usage. Pretty good for one a couple hours work.

Technologies: Arduino, C, A/C Electronics, Basic Electronics

Analyzing My Security System Data

I have our security system hooked up to a computer and log every event (window opened, door closed, motion sensor tripped). This lends itself well to some interesting end of year data analysis.

There's one motion sensor downstairs in the connected living room / dining room / kitchen that gives us a good idea of whether or not anything's going on at the house.

We're mostly doing stuff downstairs Saturday, Sunday and Monday. The weekends aren't surprising since all of us work but Monday is a little interesting. Why is it different than any other week day?

We run pretty late hours. If you want some quiet time to yourself downstairs, your best bet is "early" in the morning from 6am to 8am.

In the beginning of 2008 we switched one of the five house mates. Since the person that left ran pretty late hours, it seems like the curve shifted backwards a bit.

The security sensors are also on the doors and windows. Interestingly there are significant spikes in external door usage at 12pm and 10pm. Maybe this is the preferred time for people to leave and return.

We open windows more often than close them during the day. We tend to close windows all at once at night time.

PG&E tracks our electrical and gas consumption on an hourly basis using a SmartMeter. Our downstairs activity seems to correlate with the fluctuations in our energy consumption. This is possibly because of the lights, kitchen equipment and TV downstairs.

We don't use our air conditioner (super expensive in a 3600 sqf house). Instead we open the windows when it gets hot outside. The average temperature data is from the National Weather Service.

But we do use the heater and the gas fireplace when the temperature drops.

Technologies: Python, MySQL, Google Docs

Saturday, July 11, 2009

Making a Giant Pop Up Card

For her birthday, my girlfriend offhandedly requested a pop up card, preferably home made. Up for a challenge I decided to follow through with it.

Now my spatial reasoning is pretty horrible. I have trouble solving those 2x2 Rubik's cubes. So I was pretty worried about doing a good job coming up with a design myself. However, it was easy enough to find some instructions online. This site had a number of options with clear step by step instructions. After browsing a little, I ended up selecting the pig mainly because I liked how it looked and she was born in the year of the pig.

Now the fun part. I like to be obnoxious when giving presents so its important to me that the gift be as unnecessarily large as possible. As a result I wasn't able to print out the guides on card stock like the instructions suggested. Instead I stuck around at work and used the projector to trace the pig cuts on the pink card stock.


Once I had traced the cuts and folds, I cut out all the pieces to spec. In addition I took a piece of foam core and scored it down the middle so it became a foldable card. This was harder than it sounded since I didn't have a ruler to find the middle line. As a result, I had to cut pieces of paper using the paper cutter to 5" increments which when placed together on the foam core, indicated where to score.

Finally, it was time to assemble ... well almost. After test fitting some of the pieces, I was thoroughly confused how it was all supposed to fit together. There's that poor spatial reasoning again. Not wanting to ruin the pieces I had spent so much time tracing and cutting out, I printed out the guides on some printer paper and decided to make a quick mock up of the final thing.

With the mock up completed successfully, all that was left was to assemble the final thing. You can see how big it is compared to the mock up and tape in the foreground.
Overall this turned out very well. My girlfriend was surprised to say the least and I was happy with the way it all came together. In addition to the pop up center piece, I ended up adding a bit more decoration, wrapping the whole thing, and topping it off with an obnoxiously large bow. Here's a gallery of all of the pictures I took.

Technologies: Paper, Glue

Saturday, August 30, 2008

Fixing Netgear GS108 Network Switches

I woke up this morning and much to my dismay the internet appeared to be down on my desktop. Strangely the wireless still worked so I went into the network closet and noticed one of the network switches seemed unhappy. All of the port status LEDs were blinking in unison. Googling for the problem yielded this comment on a blog post which pointed blamed two of the capacitors. Sure enough, this was the problem.


Apparently Netgear had under estimated the voltage these should handle so a 6.3V 1000µF piece wasn't enough. Down to Halted I went and grabbed some 10V 1000µF capacitors. I grabbed my trusty desoldering wick, soldering iron, and solder and replaced the busted caps with the new ones I had purchased.


With that all together I plugged everything back in and to my delight it started working again! Now hours later (I wish Halted were closer) I can start my day.


Technologies: Basic Electronics, a soldering iron