Introduction: Climbit

The idea for this bit of wearable tech was born out of a climb-a-thon that I do annually to benefit First Descents, an organization that gets young cancer survivors like myself living a life beyond cancer.

For the climb-a-thon, participants usually set a goal and climb to that goal to help raise donations. Many set that goal as their distance climbed, either setting a goal of say 500 ft or climbing a foot for every $1-5 raised.

I thought for the next climb-a-thon it would be great to have a piece of wearable tech to track the amount I climbed, like a fitness tracker. I would then be able to make another one as an incentive for others on my team to help spur donations.

From that I developed Climbit, an altimeter-enabled fitness tracker that tracks the amount you climb!

Step 1: Materials

For the Climbit build, I utilized the following components:

In total the build came to about $50 before 3D printing. I also looked into LED displays instead, but the form factor was too large and it didn't save that much money. There is also the SparkFun Micro OLED breakout, which looks like a nice little OLED breakout but logistically it was cheaper to stick with the display listed.

Step 2: Tools & Software

The list of tools for this build is pretty standard:

  • Soldering iron
  • Wire cutter/stripper
  • Flush diagonal cutter (recommended)
  • Screwdriver
  • Helping hands (recommended)

Software is also pretty standard

Step 3: Component Design

Since I wanted this item to be clipped to a standard climbing harness or belt loop without being obtrusive I tried to get the smallest components that would work together without too many wires requiring a larger enclosure. Initially I was hoping to use the standard Trinket for this, however the buffering of the OLED display required a microcontroller with a bit more RAM.

I2C was a simple choice for reducing the number of wires though. Even though now, with using the Trinket Pro, there were enough pins to use SPI I wanted to minimize the number of wires inside the enclosure. I didn't see much of an issue with this since we don't need a quick refresh rate.

Ultimately, the idea is that the climber would turn the Climbit on or reset the counter (using a 5 second long hard press) before climbing. Then, after that, they would be able to press the button to see how far they have climbed (quick press <5 seconds) and to check the temperature.

When the battery gets low the climber would be able to just plug it into a microUSB plug and charge it without opening the enclosure.

Step 4: 3D Design

Using a combination of PCB layouts and actual measurements from the components using my digital calipers I made a three-part enclosure to house the electronics and the carabiner. I was looking for the smallest form factor possible, so measurements needed to be pretty exact.

Using the free software at Autodesk's 123D Design, I made digital mock-ups of the electronic components then I designed the printed parts. The enclosure has a top and bottom that fits around the carabiner with a central piece to hold the battery and provide a surface to mount the button.

All three parts were then printed using a standard extrusion-type printer at my local hobby store (3DX Hobbies), though you can use a service like 3D Hubs or Shapeways.

As an aside, the battery holder needs to be modified slightly. I may fix this in a future release, but for now you'll have to cut the holder in half and countersink the screw holes by ⅛" (3mm). This is so that the listed screws fit the entire length and that the holder doesn't trigger the reset button on the Trinket.

Step 5: Wiring

Using I2C really simplified my wiring schema. Like I said in the Component Design section, SPI could be used but I don't see much of a point.

I first prototyped everything out on a breadboard with an Arduino Uno R3 (see Component Design step). It was this way that I was able to use the Serial output to better model the algorithm. In conjunction with that, I just followed the wiring diagrams and pinouts in the Trinket Pro, OLED Display, LiPoly Backpack, and BMP280 Sensor tutorials. To simplify things, the pinouts are as follows:

  • Trinket Pro A4 (SDA) to Sensor SDI and Display SDA
  • Trinket Pro A5 (SCL) to Sensor SCK and Display SCL
  • Trinket Pro A2 to Display RST
  • Trinket Pro A1 to Button pin1 (a pulldown resistor will also connect to this pin)
  • Trinket Pro 3V to Button pin3, Sensor VIN and Display VIN
  • Trinket Pro GND (G, same as BATT G) to Sensor GND, Display GND, Pulldown Resistor on Button pin1/A1,and Backpack G
  • Trinket Pro BAT+ to Backpack BAT
  • Trinket Pro BUS to Backpack 5V

I also had to take some liberties with the components in Fritzing, since the latest Adafruit library doesn't have Fritzing components for all of the physical components and I didn't want to take the time to make all of them. The Fritzing diagram is just for illustration anyway, so no big deal, but you will notice that the image doesn't align with the actual parts in all regards but it comes very.

Step 6: The Algorithm

I broke the algorithm for this out from the code section because it warranted its own explanation.

In a perfect world with perfect sensors and perfect weather (Ideal Gas Law anyone?) we wouldn't need a special algorithm to handle the data from the sensor. Ideally we would just add up all the positive changes in altitude (distance climbed vertically) and that would be it. Since we're not that lucky, we need an a way to smooth out the data coming from the sensor to get an accurate estimation of the distance climbed.

This is illustrated in the attached graphs of the test data I produced in R v3.1.1 to model the algorithm. This is very simplistic, but it illustrates what we will encounter with real world data without being too simplistic.

  • The first graph (black line) is the actual "perfect world" data with the actual total vertical distance climbed.
  • The second graph (red line) is the simulated sensor data with the sum of the positive values as the vertical distance climbed.
  • The third graph (green line) is the smoothed simulated sensor data with its sum of the positive values as the total vertical distance climbed.
  • The fourth graph is a plot of all the lines on the same graph.

The second image is a larger version of the plot of all the lines on the same graph. In this one you can see the noise in the simulated sensor data (red line) and how the algorithm smooths it out (green line, take a look at the corners).

As you can see, just taking the positive changes in altitude from the sensor data as we would do in a perfect world ends up skewing the total distance climbed in the positive direction. This error is iterative with every sensor reading so over time the amount the total distance is skewed by will grow. Smoothing the data by taking an average of the past 10 readings avoids this.

Smoothing the data in this fashion comes with its own limitations, but it's better than not smoothing it. Here we can see it rounds off the corners, subtracting distance at ever acute angle and adding distance at every obtuse angle. Of course better algorithms will model the actual distance climbed better, however I'm not looking to get that complicated.

The third image is an actual plot of the altitude readings coming from the sensor after smoothing! In fact, I even added an extra layer of smoothing (three consecutive reads every 150ms averaged) to help tame the sensor data. You can see there is still a bunch of noise (blue line) however the total distance climbed (red line) is still at zero. This is due to another aspect of the code I inserted to control what I called the standing creep of accumulated noise at the base altitude.

Step 7: Code

Our application of the sensor data in one aspect makes handling the data somewhat easier and in another aspect complicates it. It's easier because we don't need to calibrate the sensor, therefore we can use a standard reference setting and just measure the difference. It's more complicated though because we want total amount climbed, not just a simple altitude reading.

In order to get the total amount climbed we want the program to just add up the positive change in altitude from the algorithm in the previous step. This was accomplished by setting the initial reset point as the lowest altitude, checking any positive change in increments, then adding that change. The timing is arbitrary, faster time increments add noise while slower time increments may not accrue the full distance before descending. If the climber goes below the aforementioned lowest altitude the program resets it.

As an added bonus the climber can also get the temperature. Why? Because the sensor also has the capability of sensing temperature so, why not!

Download the .ino file at Github!

Step 8: Assembly

I tried to include as many pictures as reasonable feasible during the assembly. In reality the process is more intuitive and a bit like Tetris, which doesn't really lend itself to concise step by step instructions. I will say, however, that the process involved repeated steps that I will sum up here:

  • Wires were initially cut long, sized up several times, then cut to size right before soldering
  • All leads were stripped to within ⅛" (3mm) from the end
  • Whenever possible, I soldered with the components laying flat on a piece of aluminum foil so that all solder points were flush with the bottom of the component (see the picture with the sensor)
  • Pieces where constantly removed and replaced while assembling, so don't over-tighten the screws
  • Actually, never over-tighten the screws

A general overview of the steps are as follows:

  1. Clip the JST connector from the backpack at each side of the base.
  2. Solder all wires onto the sensor and display, follow the pin diagrams in the Wiring section of this instructable.
  3. Clip one leg of your pulldown resistor to about ½" (13mm) and solder it and a wire to Trinket A1.
  4. Test fit the Trinket and sensor into the bottom of the enclosure, trim the sensor wires to length.
  5. Test fit the battery holder and LiPoly backpack on top of the Trinket and sensor, trim battery leads to length separately, do not let the leads touch during or after cutting.
  6. Remove the battery and holder, making sure the leads remain separated (tape them off).
  7. Test fit the display and button in the front of the enclosure, trim display wires to length.
  8. Solder the free end of the wire at A1 to pin1 of the button (you will have to flatten the button pins).
  9. Solder a wire to pin3 of the button.
  10. Solder the wire at pin3 of the button, display Vin and Sensor Vin to the Trinket 3V (next to BUS).
  11. Position the LiPoly backpack on the Trinket, flattening out the wires going to 3V, you will probably have to take the Trinket out of the enclosure for the next steps.
  12. Trim all ground wires and the remaining resistor pole to length then allow ½" (13mm), wrap the exposed portion of resistor in shrink wrap tubing.
  13. In through the G pins of both the backpack and Trinket put the resistor pole, Display GND, and Sensor GND.
  14. Solder the G pins to the pole/wires placed through the Trinket and backpack.
  15. Solder a short length of wire between the BAT+ pin on the Trinket and the BAT pin on the backpack.
  16. Solder a short length of wire between the BUS pin on the Trinket and the 5V pin on the backpack.
  17. Solder the wire from the display RST pin to the Trinket A2 pin.
  18. Trim and solder the wires from the display SDA and the sensor SDI to the Trinket A4 pin.
  19. Trim and solder the wires from the display SCL and the sensor SCK to the Trinket A5 pin.
  20. Break the trace on the backpack as outlined in the Adafruit tutorial and solder wires connecting the slide switch as instructed, ensuring the are just long enough to fit the switch in it's socket (see pictures).
  21. Carefully solder each battery lead to the corresponding pad from the JST connector on the backpack (see the pictures, make sure the switch is off).
  22. Screw the Trinket into the bottom of the enclosure.
  23. Screw the sensor and battery holder (with battery inside) into the bottom of the enclosure by placing the screws through the holder and the sensor screw holes.
  24. Screw the display into the top of the enclosure and place the momentary button into the top of the enclosure.
  25. Make sure all wires fit within the enclosure and screw the top and bottom together with the carabiner inside the channel.

Step 9: Finished

The Climbit is now ready for prime time!

The build was a relative success and it even saw some time on the wall for it's first round of ascensions. Both me and my belay partner were able to get precise readings with it however it's difficult to determine how accurate they were without plotting the data and matching it up with a video (acquiring our own "beta" in climbing lingo). This is because any vertical ascension is summed up into the total, since we did the same route it's reasonable that we should have similar (hence precise) results, but we can't use the height of the wall to determine how accurate it is. I'm thinking of making a prototyping backpack (the literal backpack, not a microcontroller backpack!) so that I can incorporate a datalogger to visualize the sensor data on an actual climb, but that's in the future.

Step 10: Limitations

The current version has some limitations that I feel I would be remiss for not saying:

  • Current sensor/code combinations only allow for vertical calculations, lateral traverses won't be included.
  • Inclines will only be totaled for their vertical component.
  • The smoothing algorithm still accommodates too much noise (in my opinion) because it is constantly using the previously acquired altitude value. This can be mitigated by instead using the "base" value as the comparator, however additional algorithms would need to be incorporated to account for intermittent vertical ascensions (see image).
  • The current enclosure probably needs another screw and perhaps some rubberization to be sturdy for prolonged climbs.

Maybe I'll address some of these limitations in a version 2 if there is enough interest, it would take adding another component however, which would increase the price and complicate the build. Not that adding a magnetometer and a little Cartesian geometry wouldn't be prohibitively expensive or hard, I'm more concerned about fitting everything into the enclosure.


emilydaub made it!(author)2016-01-05

This is awesome!

zymurgeneticist made it!(author)2016-01-06

Thanks Emily! I'm loving your swing skirt, it's making want to get back out and practice my East & West Coast Swing!

emilydaub made it!(author)2016-01-11

Thank you! You should, dance is so much fun, especially the energy in swing (:

SepeSy made it!(author)2016-01-05
EricL66 made it!(author)2016-01-02

What is the precision of the unit??

SepeSy made it!(author)2016-01-03

BMP820 has basic resolution of about 1 meter. For more accuracy (0.1 m) a sensor like MS5611 could be used. Check examples e.g. from my multiuser ascent tracker AsTra. As with any sensor, a longer integration time or filtering increases accuracy but hides quick changes.

zymurgeneticist: what a great design! I would definitely use Trinket and other modern components for the next revision of AsTra. Only Arduino Pro was available when I started on late 2013. I have logged 4500 meters of ascents with AsTra since it was completeted about 18 months ago.

There's a short demo video available it you are interested. I have added runtime statistics per climber to the code but I still have to document it before publishing it in GitHub.

zymurgeneticist made it!(author)2016-01-04

That's really great SepeSy! I really like what you've done with your AsTra tracker. Convergent evolution indeed, I wish I would have found your github page before!

I like that you used Kalman filtering, it's a much better way of modeling the incoming data than my recursive averaging. Which library did you use? I see one or two libraries out there with Kalman filter commands, but from reading your ino file I couldn't tell which library contained it. I went the averaging route to make things more straight forward, but it probably isn't the optimum way to model the climb.

To EricL66. The Adafruit product page has the sensor precision at 0.25m, I find it to be somewhere between that and what SepeSy stated (probably +/-0.35m). If you mean the precision of the device, however, I would need to create a sample set of "climbs" with the device to figure it out.

SepeSy made it!(author)2016-01-05

Arduino Pro has still so little memory that I had to extrude and inline some code from libraries and stuff. The Kalman filtering code is from openxvario (check AsTra hw page for other inspirations). The code has also moving average filtering for debugging but (I think) only Kalman is used.

AsTra is constrained by Arduino memory limits i.e. there is no room for all the functionality I would like it to have (e.g. Bluetooth data file transfer, local statistics etc).

Roof+Vents made it!(author)2015-12-31

Oh what a great idea. Market it now!

zymurgeneticist made it!(author)2016-01-04

Thanks Roof Vents!

sophatroph made it!(author)2016-01-03

Not just a great project, but a very well written, thoughtful and informative instructable. I love how you explained why you made the choices you made without getting too lengthy!

paul+the+maker made it!(author)2015-12-31

is Arduino more easy than rapberry pi i like the project

milcarlsandoval made it!(author)2016-01-01

I haven't done anything with a raspberry pi too...arduino is still the best choice for this type of project..raspberry pi has a lot of pins and requires great knowledge on programming.. you might want to check another arduino project..

milcarlsandoval made it!(author)2016-01-01

I haven't done anything with a raspberry pi too...arduino is still the best choice for this type of project..raspberry pi has a lot of pins and requires great knowledge on programming.. you might want to check another arduino project..

zymurgeneticist made it!(author)2015-12-31

Thanks Paul. I haven't really done anything with Pi, but as I understand the applications for both are a little different. The Raspberry Pi is just more processing power than I need for this project.

SepeSy made it!(author)2015-12-31

Clearly convergent evolution. :-) Check my AsTra for an alternative sensor and algorithms

Jonathanrjpereira made it!(author)2015-12-31

Cool Project. Interesting Algorithm.

zymurgeneticist made it!(author)2015-12-31

Thanks Jonathan. With more testing and familiarity with the sensor I bet the algorithm will get revised with time to better model the ascents!

Yonatan24 made it!(author)2015-12-31

That looks like a great project, But I was wondering something about the screen:

The screen you bought costs $17, Isn't that pretty expensive for a small screen like that?

I was wondering if you can hack this (cheaper) device, That comes with a small screen, And use its screen instead, Because it's a lot cheaper

I have no experience with using these kinds of screens, But I think it might not work because the one you used is O-LED and this one is LCD.

If this works, This might be a nice idea for an Instructable too

Yonatan24 made it!(author)2015-12-31

Voted too!

zymurgeneticist made it!(author)2015-12-31

Thanks for the comment yonatan24. Someone with the skill and wherewithal could definitely make this cheaper with different components but my knowledge is limited to the components I used.

Yonatan24 made it!(author)2015-12-31

Your limited knowledge >>>>>>> My knowledge about these!

Konstantin+Dimitrov made it!(author)2015-12-31

Awesome project I love it but I think its little bit expensive because of the OLED. I have ordered 2 OLEDs for 7$ from Alliexpress last week and again great project !

Voted !

zymurgeneticist made it!(author)2015-12-31

Thanks KonstantinDimitrov, you could almost absolutely source the components cheaper but for the product quality and support that companies like Adafruit and Sparkfun give, it was worth it to me. Anyway, I used the Adafruit libraries which are written especially for the components listed without needing modification. I'd love to see what you make if you end up using different components!

lakelandlocksmith made it!(author)2015-12-31

Really appreciate the work, its amazing !!

zymurgeneticist made it!(author)2015-12-31

Thanks lakelandlocksmith, I appreciate it!

Patrick+S made it!(author)2015-12-30

Great work! As a climber I really appreciate the spin on wearables. You've got me wondering how good a smartwatch/fitbit's IMU could estimate this.

zymurgeneticist made it!(author)2015-12-30

I hear you. I would love to see a feature like this in a smartwatch, which is obviously why I made this, but someday perhaps!

DylanD581 made it!(author)2015-12-30

Awesome Microcontroller and 3D Printing Project! I don't climb, but I love your nice, sleek design, so maybe I will change the code/electronics to fit another purpose!

zymurgeneticist made it!(author)2015-12-30

Cool DylanD581, I'd be interested to hear what you think up. I guess you could change it to just be an altimeter (for hiking) or swap out the current sensor for a magnetometer (for a compass)... or probably 100 other things.

stankybcn made it!(author)2015-12-30

Kudos for a climbing instructable! Far too few of those. One note. Please tell me this is just an accessory on one of your accessory loops. The biner you are using does not look like a legitimate load-rated biner.

zymurgeneticist made it!(author)2015-12-30

It is most definitely NOT for weight bearing and is meant to be clipped to the accessory loop (it is in the pics if not apparent). Thanks for pointing that out stankybcn.

Math+Logic+And+Nerd+Studios made it!(author)2015-12-30

The code appears to be in JavaScript!

zymurgeneticist made it!(author)2015-12-30

The two languages (JavaScript and the modified C that Arduino uses) sure do look similar!

CheesesOfNazereth made it!(author)2015-12-30

This is great. You found a application and made a non-trivial hardware and software to get the job done. Much more entertaining than another pot holder instructable. I may even build this one-

zymurgeneticist made it!(author)2015-12-30

Thanks CheesesOfNazareth (great name BTW). Let me know if you end up building it, any improvements I make on the design will be uploaded to here!

About This Instructable




Bio: Avid homebrewer, guerrilla geneticist and constant crafter. I am always elbow deep in at least three projects while dreaming up another. Currently I'm exploring ... More »
More by zymurgeneticist:Star VestVegan MeatballsClimbit
Add instructable to: