A really simple inclinometer
December 10, 2011
After a comment from Gier Andersen got me thinking about the cheapest method of measuring inclination, I came up with the idea of using a potentiometer and some kind of rigid plumb line that would rotate the potentiometer according to the steepness of the hill that robot was on. I'm sure someone has though of this before, but just in case they haven't I'll post it anyway :)
This is just a very quick test of the idea so the measurements had an uncertainty of about ±5 degrees! But anyway, I recorded these values:
Then plotted them on a graph:
Then I figured out an approximate gradient, and from that the equation of the line. X is the angle measured and y is the analog reading.
x = 0, y = 166
x = 180 y = 856
gradient = 690/180 = 3.8
y = 3.8x + 166
x = (y - 166)/3.8
Then I tested it again, this time printing the angle to serial, and... it worked! Well, that is if you don't need much precision!
As you can see the initial test just consisted of a ruler with a potentiometer blue tacked on and a bit of weight dangling from a paper clip! I'll have to recalculate the equation for x when I make a more permanent version...
Now I just need to swap the SPD (cycling shoe) cleat for something smaller and heavier, reduce the length of the arm as much as possible and put it in a box!
I'll also have to solve the rest of the problem, that is the 'finding the top of the hill' issue. I'm thinking maybe an IR object detector positioned at an angle would do the trick, I've just got to try it first...