STATSulator : Training Log




Introduction: STATSulator : Training Log

About: I like to tinker with just about anything, sometimes it works out in the end. Have fun looking at the projects, try tearing something open and let me know how it goes. cheers, -Joe

The STATSulator is a php/mysql app and bs2 lcd desktop display that keeps track of all your training. It allows you to see what your training buddies are also putting in, raw hours, not the details for your friends activity...

This STATulator was born around new years 07, I was talking with some bike riding buddies and they were looking at their end of year spreadsheets. How many miles they rode, how little they used their mountain bike... And the inner geek in me decided to write the STATSulator.

After a full year of use it has turned out really useful for me. It has shown me how much I rode my commuter bike, after that the mountain bike... But now I carried my craziness over to a new level and track my weight in it as well.

As a project I thought it would be neat ot also make a physical desktop display for it that at a glance would display my stats, to see if I could skip riding that day. :)

Step 1: Supplies

I used the following for this project, but you could use a ton of things for this.

- Plexiglass small sheet
- Allthread (I used #6/32)
- 16 nuts ( I used #6/32)
- 16 washers (I used #6)

- Basic Stamp 2
- Basic Stamp Board
- Parallax 4 x 20 LCD (I used the 4x20 backlit model)

- Wall Wart

-Linux box ( I use fedora core 8)
-- Have PHP/Apache/Mysql Installed
-- Install the BSTAMP Package from sourceforge to compile bs2 code
-- JPGraph

Step 2: Tools

To cut the plexi glass you will need:
- a utility knife or x-acto knife
- Straight Edge (sXe)
- Clamps

To make the case you will need:
- Dremel
- I used the Dremel Workstation and can't recommend it highly enough.

Step 3: App Walkthrough 1

This is the welcome page, this is all written in PHP and should be on sourceforge in the next few days.

Whats of note here is the table on the left I call the peer pressure module so you and your friends can motivate each other to ride.

Step 4: App Walkthrough 2 - Add Data

Adding data is done through the apps "Add" button. It will pre populate the fields where it can based on activity.

Also this page can take uploads from MotionBased exports. So you don't have to key in info twice if you are using a garmin. MotionBased if you are not paying will only allow you to view the last few activities.

Step 5: App Walkthrough 4 - View Time Reports

You can view data by week/month/year/month to date.

On these screens you can see your time, breakdown of activities, breakdown of weather and the details of each activity.

Step 6: App Walkthrough 4 - View Details

This detail view will show the fields for the time frame you are viewing. All of the activities can be selected for viewing more details and editting/updating.

Also this exports to a CSV file so you can do your own graphs in excel.

Step 7: App Walkthrough 6 - View Activity by Month

The page I use more than anything else is this one that shows me my activity by month in pie chart and bar graphs. there is a pie chart for each month, and then two that show just bike riding times. The bike one can be turned on and off if you are not a bike rider.

Step 8: App Walkthrough 7 - User Prefs

On the Preferences page you can turn on and off reports, maybe you don't track distance or heart rate, so you can disable those.

Also on this page you can choose to get monthly status reports and choose to make your info public or not. And by public it just show your total hours in the peer pressure chart on the left.

Step 9: App Walkthrough 8- Healthy Eating Disorder

On this page you can track your weight. It has two graphs that can display your weight and your weight with workout time. It throws in some info like you max/min/avg too.

WARNING: Remember this is a geeky little web page, don't give yourself an eating disorder... seriously.

Step 10: The Desktop Version

For the desktop version of this I used a Basic Stamp 2 from Parallax along with their Board of Education and 4x20 Backlit LCD. If you have never checked them out, they have a really nice website with tons of information making it easy to get in to programming your first microcontroller.

Step 11: Desktop Version - Plexi Glass 1

Lay the Board of Education on your sheet of plexiglass and figure out how big you want to make the plexiglass base and cover. I made it 1/2" longer than the board. Trace it out.

Clamp your straight edge (shout out to minor threat!) to the plexiglass and score it with your x-acto knife.

Step 12: Desktop Version - Plexi Glass 2

To get a nice good edge, score the plexiglass with your x-acto knife then clamp it to the edge of a surface right on the line your scored. Then push the plexiglass down and it will crack nice and straight.

Step 13: Desktop Version - Base 1 - Four Corners

You will need to have your four corners marked out to run the allthread through. I lined up the Board of Education and marked four spots.

Use the first one you make to template the bottom one.

Step 14: Desktop Version - Base 2 - Drilling

I used the Dremel Workstation to drill my holes. I find with plexiglass and a large 18v rechargeable drill *I* tend to crack the corners from the weight of the drill.

With the dremel, set the speed to high and slowly lower the bit through the plexi.

Step 15: Desktop Version - Base 3- Board of Education

Drop the board on the base and mark your four holes and drill. The same goes for the LCD on the top.

Step 16: Desktop Version - Base 4- Allthread

Attach the BoE with 4 screws and nuts, attach the LCD the same way.

Line them up on top of each other and see how much room you will need for the althread. I needed about 2 3/4".

Cut the allthread to length.

Step 17: Desktop Version - Base 5- Attach

I attached the allthread to the top first, run your nut out to the end of the allthread, use a washer on each side of the plexiglass and see if your holes line up.

If it does attach them, once again using a washer on each side of the plexi glass.

Step 18: Desktop Version - Base 6- Rubber Feet

I used rubber feet to keep the metal nuts off of the surface you lean lay this one.

Step 19: Desktop Version - Program

I used a linux box to do the programming of the bs2.

The nice people over at have created a suite to use.

The code has place holders for values that will get inserted when the PHP script runs to hit the database.

Step 20: Desktop Version - PHP

To get the data into the bs2 file I use a php script which queries the db, then replaces place holders in the bs2 template file using sed. Then it runs the bstamp package to load the data on to the bs2.

Step 21: Props

I'd like to give thanks to my buddy Craig S for the sweet logo. Mine was weak..

I totally tried to bite radiorental's style and use an analog gauge like his really cool analog network meter instructable.

I purchased a neat looking gauge off of ebay but it required more amps than the stamp could deliver so I grabbed the LCD and think it worked out ok. You can see the analog prototype below.

Thanks for looking at this.

The Instructables Book Contest

Participated in the
The Instructables Book Contest

Be the First to Share


    • New Year, New Skill Student Design Challenge

      New Year, New Skill Student Design Challenge
    • Photography Challenge

      Photography Challenge
    • One Board Contest

      One Board Contest



    13 years ago on Introduction

    I would really love to see the code/database that you used to put this app together. i myself am a web developer and this intrigues me. do you happen to have any php/mysql tuts. how about ubuntu, would it work on this thing. also can you use this for just about anything? like saving for something or clients or what not?


    13 years ago on Introduction

    I'm anxiously waiting to see the code. I can't wait to try this. This will be a great tool to get my buddies on their bikes this year!!! Is there anyway to be alerted when you post the code? Thanks, Sander


    13 years ago on Introduction

    So you gonna let us know when this goes up on source forge? I've been looking for something like this forever! Looks awesome.


    13 years ago on Introduction

    Your display shows average weight. How are you calculating the average?


    Reply 13 years ago on Introduction

    I am using my average weight, which is stored in a table.
    The table is called weights and has 4 columns
    mysql> desc weights;
    | Field | Type |
    | id | int(11)
    | uid | int(11)
    | weight | float
    | date | date

    Then I use a select the avg weight for the user I am looking for,
    select round(avg(weight),0) from weights where uid='$uid'



    Reply 13 years ago on Introduction

    Using an exponentially-weighted moving average would possibly provide a better indicator of what your true weight is, and would certainly have a higher buzzword coefficient.

    The Hacker's Diet


    13 years ago on Introduction


    No, I am not going to talk in Caps Lock for the rest of this comment.

    Wow, you did an excellent job, it looks really super duper coolio. Yeah. Coolio.
    But seriously Joe, this is just awesome. Great job.
    +1 rating.

    By the way, why did you feature it yourself?


    13 years ago on Introduction

    Joe I love this I am going to build one. Do you have to have a linux system or will windows work I have a extra hardrive I can use but did not want to go throught the trouble of that.


    Reply 13 years ago on Introduction

    Thanks!, You don't need linux for this, you could use windows. The stamp support for windows is even better.

    You can get a unix like environment on windows though, using cygwin. Cygwin is available at

    But regardless of that there is a really easy to install package from XAMPP that includes apache,mysql,php,perl for windows linux or os x. Check it out here: