Android Thing for Saving Money on Springs and Avoiding Math

by | Feb 5, 2013

So, my race car is slow, and I cannot afford a new motor because I spend all my money on race cars. Another way to make it faster is to throw in some springs (and shocks) that are a little bit harder than the stock ones.

I flip through the parts catalogue and find some springs that ought to do the trick.Then I look at the price and have a stroke, because they cost like 10 bajillion dollars. Might as well get the new motor – might as well get a new car!

Hmm, maybe there’s a better way. I’m gonna go to the junk yard, where there are tons of perfectly good springs just sitting there in rotten old cars, where I can haul them away for scrap metal money. Dope! Only how do I know which ones are going to be just a little bit harder than my current springs, and also maybe an inch or so lower?

Hey, what. There’s an app for that. Here you go, linky. It is free but feel free to mail me money or whatever, just out of love and sympathy for the fact that I’m broke, and don’t even have a race car.


Put in some numbers that you can find or measure – the modulus of rigidity has to do with the quality of the steel in your spring – if you don’t know it and can’t find it, 14,947,500 is a reasonable number for Moog springs. Get out your calipers and measure the diameter of the wire. Get out your ruler and measure the diameter of the spring. Count up the number of active coils, you don’t even need a tool for that (just the one in your…head). Whang all the numbers in, and the calculator will tell you the spring return rate. Compare those numbers against the ones for your buddy’s cool blue springs, and find out if the 3 coils in a Ford pickup are equivalent to the 6 coils in your Corolla. And if they are, get those springs, get low, and hold on to your money.

If you want to get super scientific, you can calculate any of the five values, calculating your modulos of rigidity for various springs, averaging them up and so on. I leave it to the nerds to figure that out. I may later add the ability to save spring specs for easier comparing, but this is an MVP. That’s Minimum Viable Product, cause holy cow, I am so new at this game.

Things I learned

First of all, I found an easier way of wiring up an OnClick listener. It turns out you can make one OnClick listener for several buttons that do similar things, rather than creating a new OnClick object for each one. Not that it was relevant in this project anyway, since there’s only the one button.

Another good lesson was How To Avoid Doing Math. I got the formula from a website for shed engineers, as directed by DiscoQuinn (my first customer, lol). I then had a couple of helpful friends (Serge)(Matt) do the basic algebra to convert the formula to solve for the other 4 variables. Then I fed the calculator on the shed engineer’s page 5’s for every value, noted the spring return rate, and used those numbers to write JUnit tests for all the variables. AssertTrue(k == 2.605) and assertTrue(n == 5) for everything else, like so:

I’m really pleased about that.

Overall, I’m happy cause I learned a little bit and made something kind of useful. My code this time around is much more beautiful than what I did in the CFM calculator. One con is that I got so wrapped up in coding this, and enjoyed it so thoroughly, that I let my school work slide a bit. Hopefully by posting this, feature-poor as it is, I can put it to bed and focus on my C homework!