Determining Absolute Angular Displacement

Hi all,
I’m working on an Arduino project that requires me to know, at any time, the absolute position of a rotating shaft. The shafts rotation will be random and continuous and the device therefore needs to output a signal relative to a known (i.e. fixed) position of the shaft. I will determine the actual position of the shaft ie angular displacement) at any time by taking a reading from the sensor, comparing that reading with the value recorded at the fixed position when it was installed (likely to be the minimum or maximum sensor output). I’ll convert the output signal to a proportional reading, from 0 to 359 degrees, which will reflect the shafts angular displacement/position from the fixed position.
Can anyone recommend a device (or a configuration of devices) suitable for this task? I’m happy to consider a rotary encoder or a potentiometer that can handle continuous rotation in either direction, a maximum speed of 30 rpm, and provide an absolute position in its rotation and a resolution down to one degree.


Hi Tim, I would think an optical encoder would be worth trying. It cannot get “bound up” by wiring so can handle continuous rotation applications. The encoders would mount on the motors so you’d have a lot of resolution given you’ve got a 30 RPM output. The downside I see is that they output a waveform, not a counter, so you’d have to ensure your controller code can keep track of the encoder. Perhaps that’s a job for a separate microcontroller? Encoder -> Microcontroller -> Position Counter. You could then set the starting position count and never lose track.

  • Chris

Hi Chris,

Thanks for the response. I had looked at this type of device but discounted it as it only gave relative information i.e. the sensor only works when the shaft is moving. I could not see a way that I could determine its absolute position (in degrees) when it was stationary. Imagine a shaft or axle which needs to be rotated to another angle/position. Before I can determine how far to rotate the device and in which direction the shaft needs to rotate, I need to knows its current position. Between updates, the shaft can rotate of its own accord after I have moved it so, to move it the next time, I need to again determine its current position (which my be different from the last time it was moved).

My hope was to find a potentiometer which, over its 360 degree rotation, increases its resistance from minimum to maximum. Once it passes its original starting point, it falls back to minimum. With such a device, I could simply attached it to the end of the shaft, set my minimum voltage from the pot’ to align with the known fixed position on the shaft and I would have a unique reading for the whole 360 degree rotation. Even when it is stationary, I could simple take a value from the pot’ and know exactly its position before doing anything.

In any case, I’ll keep researching.

Thanks again


Hi Tim, here’s what I had in mind:

  1. Start the electronics
  2. Drive the shaft to the zero point
  3. Zero the encoder counter at the zero point
  4. Keep running the circuit so every time the shaft moves the encoder would detect it and update the position
  5. Then at any future time the circuit “knows” the position of the shaft

If you need to be able to power up a circuit and then detect the shaft position I think you’ll need an absolute encoder. I don’t see any in our catalogue, sorry.

  • Chris

Thanks again Chris,

Your closing remark is my very situation. I can’t rely on the system being on line before I need to make an adjustment.

I figured I’d need an absolute encoder which, it would appear, are not straight off the shelf in most places unless you want an industrial version which likely comes with an industrial price tag.

I do have a “home brew” design but I’ll need some specialist tooling for the hardware. If (when??) I manufacture the unit, I’ll be sure to post it on the forum in case there is another application that the team may utilise device.


“Absolute” is impossible, but the circle can be resolved into 256, 512 or 1024 steps using a binary encoder, or a Gray Scale encoder. At 1024 resolution, the Arduino would need to read positions every 2mS to keep up, among whatever else it has to contend with. However a grey scale with 10 bits requires 10 digital inputs to read the position code in 0.352 degree increments, not in degrees. So at the very least you would have to estimate the angle, or accept that there are ‘1024 binary degrees’. They are also likely to be expensive industrial instrumentation.
This may not help, as I don’t know your application, but at least you have another option.

1 Like

Hi Bob,
Thanks for taking the time to respond to my question. To be absolutely clear (pardon the pun) the “absolution” refers to the reading relative to an absolute positon (i.e. angular point of reference) on the shaft and not the accuracy/resolution of the reading. The shaft is freewheeling at times and as such, can be in any position, at any point in time; even stationary.

At all times, I will only be taking instantaneous readings and, with all things being equal, each reading will tell me directly the absolute positon of the shaft.

I concede that analogue to binary conversion presents some accuracy issues but I am confident that a higher resolution ADC will assist me in getting a reliable reading. This will be particularly so if I average readings over a relatively short period which will be possible as the maximum angular velocity of the shafts is about 30rpm. After all, I am only seeking to resolve to 360 degrees.

I can purchase absolute encoders (around 80- 100 $AU) and I also have my own design which requires some machining and engineering work which is more complex mechanically and delivers a pure analogue 4-20mA current (for which and ADC will have no issues).

I was secretly hoping someone would respond and say “ Hey, you can buy exactly what you need for under $10 from Core Electronics” but alas, this was not to be the case.

Thanks again,


All good Tim. I have a lathe and Milling machine as long as accuracy is within the range of my older eyesight.

    Another option is a "Gang of Choppers", eg 36 tooth and 10 tooth (geared 36:1), using opto's in quadrature, but you still need a reference position.

    Hare & Forbes (Machinery House) sell the Toolmaster "Digital Bevel Box". _(Toolmaster #M997)I was lucky enough (Unlucky?) to buy one that was defective, so they sent another good one in it's place, but didn't want the original back. So I pulled it apart, as we tend to do!

    Inside is an LCD on a pcb, plugged onto a second pcb with a micro under a blob of epoxy, and an angle resolver with a weight mounted on it to measure it's angle against gravity.

    On the defective one the weight seemed to get caught, as opening it up resulted in readings. When I removed the LCD board however, the SMD plug/socket came away leaving it still attached on the LCD pcb. So not great QA. I'll resolder it and expect success.

    If you remove the weight and manage to attach a shaft, maybe you're in business ? IF, the shaft mount works for the application, if it's robust enough for 30rpm, etc. etc.

    Might be worth a look, or even something to play with. Should be available from ebay for $cheap if you want to try it. It's intended for setting the blade angle on compound cutoff saws, docking saws.

Follow up pic…

Here’s a pic off an ebay page, size about 40x40x25.

  I did a search for "Angle Resolver" and typical modern search

engines got “Ankle Revolver” !!!

Bob Harper

  *retired: TAFE Teacher; Author, Editor*