PDA

View Full Version : How to measure an angle and send the result to micocontroller

abcd1234!@#\$
02-08-2013, 09:01 PM
I am using a PICAXE tutorial board. In my project there is a part where I have to measure an angle between two rods and send the results to the microcontroller. I think it will be good to use inclinometer in this case (one rod will be parallel to the ground, the other rod will be at some angle to the first rod; the inclinometer will be attached to the rod which is not parallel to ground). Can anyone give me some guidance please? How can I connect the inclinometer to the microcontroller? Should the 'readadc' code work here? How can I calculate the angle given the output from the inclinometer? Can anybody please tell me where can I get an inclinometer in India (Kolkata preferably)?

lolman_returns
02-09-2013, 03:37 AM
What would be the maximum range of motion of the other rod? If it is less than 360 degrees, and the required angular resolution is not too high, you can use a potentiometer. Connect the body of the potentiometer to the stationary rod and the shaft of the potentiometer to the rotating rod's axis. You can calibrate the potentiometer by finding the slope of the line between angle and voltage, which you can use to measure angle. Luckily, potentiometers will double up as absolute encoders in your case.

abcd1234!@#\$
02-09-2013, 09:19 AM
Yes the maximum range of motion of the movable rod is less than 90 degrees, and the angular resolution is quite low. Can you please tell if the 'readadc' code will work here? Thanks for the help.

lolman_returns
02-10-2013, 10:27 PM
Yes, with a potentiometer, you will have analog signal so the readadc should work. All you have to do is to calibrate the voltage signal to corresponding angle.