AVR ISP Header for Breadboards

October 21st, 2007

Using an AVR in a breadboard can be a bit ugly because programmers like the AVRISP mkII and the USBtinyISP can’t easily be plugged into a breadboard.

You can simply stick wires in the programmer’s jack and plug them into a breadboard (like they do here) but if you want something a little cleaner you can solder up a simple header board like this:

You just need a small piece of perfboard, a 2×3 pin header block, a 6-pin header row, and a little bit of wire. I found it was easier to route the wires if I didn’t bother trying to get the output pins to be sequential. Solder it together and you can leave it in your breadboard, ready for whenever you need to reprogram your microcontroller.

Track your training using Google Spreadsheets

September 16th, 2007

I’ve been trying Google Spreadsheets for tracking exercise & training this summer and it has worked out really well. They are really simple, provide just enough charting ability, and can be shared. That last bit is really helpful if you’re training for an event with a friend. You can also embed your training graphs on your website. I’ll show you how I set up a couple different shared spreadsheets for different goals.

Biking to Work

First, a fairly simple one: Yana and I set a personal goal to ride our bikes to work 40 times this quarter. This works out to a little over 3 days per week, average. I wanted a simple chart of our progress, so I made a table with 6 columns: Mark, Yana, Date, Target, Mark’s Total, and Yana’s Total. The first two columns are for entering data, the last 4 columns calculate the data for the chart. I intentionally didn’t put the Date column first. Google Spreadsheet can only graph contiguous data, so I needed to keep the date column next to the target & totals.


The first two columns track how many days we each rode that week (1 row per week). Each day we rode, we would manually increase the count for the current week. I made their background yellow to make it more obvious where to enter new data.

The target column shows our goal on the chart so we can see how we are doing. The last two columns calculate running totals (simply a matter of adding this weeks values to last week’s totals). I charted the last 4 columns (C1:F14) using a line chart with dots, with both Row 1 and Column C as labels.

You can see that we started the quarter a little bit behind but we caught up 3 weeks ago. You can view the final spreadsheet here.

Training for a Long Hike

Last weekend, Yana and I hiked Half Dome with some friends. It’s a fairly strenuous hike: 18 miles round trip, 5000 feet of climbing at elevation. We’ve done this hike before, but this year we decided we try to semi-seriously train for it, to see if it made it easier. We started training 12 weeks before the hike with a pretty simple training plan: do a long hike on the weekends with 1 or 2 short hikes mid-week, increasing the total mileage by about 3 miles per week.


Again, I set the spreadsheet up with 1 row/week. I entered target mileages and set up an area where we could enter our actual mileages. I set up 2 charts this time: One showing our longest hike every week, and one showing our total mileage every week. Rather than trying to arrange the data I wanted to chart contiguously, I just made a 2nd sheet with formulas to rearrange the data into something more chart-friendly.


I shared this spreadsheet with our friends and updated it after every training hike (you can view it here). As you can see, we didn’t stick very closely to our training plan. It turns out hiking this much eats up a lot of time, and there were some weekends where we just couldn’t fit in a long hike. However, we still got quite a bit of training, and managed to fit a 16 mile hike in 3 weeks before Half Dome. Seeing our actual mileage so far below the target mileage provided good motivation to go for training hikes. The hike up Half Dome went really well: we were faster than last time, and had more energy at the end of the hike.

Mt. Hamilton by Moonlight

August 1st, 2007

Piaw, an avid bicyclist at work, led a moonlit bike ride up Mt. Hamilton last Sunday.

It was incredible. We started at 3 AM, so the first part of the climb offered views of the moon high over San Jose. The air was cool, a nice temperature for climbing. After gaining the ridge we left the lights of San Jose behind and rode on through the darkness, past grassy hills and scattered oaks. The road twists through two valleys, and as we dropped into each low spot, we sped through the icy cold air that had settled there, before reaching the warmer air on the other side. The black sky slowly gave way to a dark blue, the moon seemed to get larger as it set over the Santa Cruz mountains. Coming around the last corner before the top we could finally see out to the eastern horizon which was glowing the pre-dawn colors. As the sun came up we watched the light flow out over the sleeping hills below. After eating breakfast with Piaw’s friend (who graciously got up to serve us in her house) we rode back down through the bright sunlight and rapidly warming air.

The ride, in a few photos.

The ride, as a GPS track (.gpx format)

The ride, by the numbers:

  • Start time: 3 AM
  • Number of riders: 5 to 9 (some started later)
  • Total Distance: 34.8 miles
  • Total climbing: 3814 feet
  • Time to the top: 3 hours
  • Total time (including breakfast): 6 hours
  • Number of flat tires: 4

That’s right: 4 flats between the different riders. After about 15 minutes of climbing I stopped to take a picture and when I got back on my bike to catch up to the group, I had a flat tire. This was rather demoralizing, so early in the ride, in the dark, alone. When I finally caught up with them, they were stopped changing another flat, so I didn’t feel so bad. When a third rider got a flat 10 minutes down the road, it started being ridiculous, and by the fourth flat we were counting our spare tubes. We finally got caught by some riders who started later, and they told us that the side of the road where we had parked was covered with goathead thorns. We carefully checked our tires (found 1 thorn in Yana’s tire that hadn’t punctured it yet) and that was the end of the flats.

This ride was easier than we expected. The weekend before the ride, Yana and I weren’t sure we could do it, so we went out and rode Moody/Page Mill. Surprisingly, the longer Mt. Hamilton turned out to be easier. I think this was primarily because Mt. Hamilton has a shallower grade. Page Mill is steep enough that I really had to push to keep moving, while on Mt. Hamilton I was able to keep a comfortable cadence (and lower heart rate).

Lessons learned:

  • It is easy to miss thorns in the dark. Double-check your tires before you start, and stay on the pavement.
  • Patches don’t take much space, make sure you have lots (in case you miss the thorns in the dark…).
  • Helmet-mounted headlamps are very helpful for changing flats in the dark.
  • Don’t push on the last mile of climb when there’s still some climbing on the ride back.
  • Slope is more important than distance in determining how hard a ride is.
  • My eTrex GPS doesn’t save tracks at full resolution, it simplifies them first. I will get a better track by pulling the active log rather than a saved track.

Camping Near Lake Alpine

July 18th, 2007


We went camping last weekend, up near Lake Alpine. We went up Saturday and got a campsite at Pacific Valley campground. I had wanted to drive out to Highland Lakes but the road was closed for the Death Ride. We set up camp, ate lunch, and then everyone laid around for an hour or two. Around 4 we decided to hike to Kinney lakes to go swimming. I think it is about 2 miles from Ebbetts Pass to the lakes, on a fairly level trail.


It was a little windy but the water wasn’t very cold (64° F). We hiked around the lake looking for the best possible swimming spot and right where we had started, on the southwest side. As we were getting ready to leave, we noticed some kind of large bird in a dead tree on the other side of the lake. It looks like a Bald Eagle to me, although perhaps it was just an Osprey. The lighting made it really hard to see (not having a zoom lens doesn’t help anything either).

On Sunday we broke camp and drove up to Mosquito Lake so that we could hike into Bull Run Lake. The sign said it was only 3.5 miles to the lake, but neglected to mention that there is a lot of gratuitous climbing. It was well worth it though, because the lake is gorgeous. The water is extremely clear and there is a small island in the middle of the lake. We swam out to the island and back, then ate lunch and hiked out.

More Photos

Element Explorer

June 29th, 2007


Think the periodic table is just a boring collection of numbers? I suppose the one in your chemistry textbook might be. But it doesn’t need to be this way. Each element is interesting on its own, with a unique appearance, a history of how it was discovered, and different practical uses. Together as a collection, the elements show all kinds of interesting patterns that just beg to be explored.

Element Explorer is my attempt at making the periodic table an interesting toy instead of a dry, dusty pile of numbers. You can click on any element to view more details about it. There are links to take you to Wikipedia or the Wooden Periodic Table to see pictures and read about the element.

If you’ve got Javascript enabled, the menu in the lower left lets you color the elements differently to highlight different patterns. Coloring by mass, for example, shows that atomic mass increases smoothly with atomic number (as expected). Color by discovery date and you’ll notice that Technitium (43) was discovered almost 100 years after its neighbors. Scientists knew it must exist from the gap in the table, but it proved elusive because, unlike its neighbors, it isn’t stable.

Now go have fun exploring.

Some technical details: The raw data (atomic weights, date of discovery, etc.) was originally retrieved from Wikipedia. I then used Python, JSON, and Django templates to generate the HTML. The zooming & other visual effects are powered by a mixture of Prototype and Scriptaculous.