Wheel Of Resistors Form Unique Rotary Encoder

Continuing his tradition of making bits of wire and scraps of wood work wonders, [HomoFaciens] is back with a unique and clever design for an electromechanical encoder.

There are lots of ways to build an encoder, and this is one we haven’t seen before. Not intended in any way to be a practical engineered solution, [HomoFaciens]’ build log and the video below document his approach. Using a rotating disc divided into segments by three, six or eight resistors, the encoder works by adding each resistor into a voltage divider as the disc is turned. An Arduino reads the output of the voltage divider and determines the direction of rotation by comparing the sequence of voltages. More resistors mean higher resolution but decreased maximum shaft speed due to the software debouncing of the wiped contacts. [HomoFaciens] has covered ground like this before with his tutorial on optical encoders, but this is a new twist – sort of a low-resolution continuous-rotation potentiometer. It’s a simple concept, a good review of voltage dividers, and a unique way to sense shaft rotation.

Is this all really basic stuff? Yep. Is it practical in any way? Probably not, although we’ll lay odds that these encoders find their way into a future [HomoFaciens] CNC build. Is it a well-executed, neat idea? Oh yeah.

75 thoughts on “Wheel Of Resistors Form Unique Rotary Encoder

  1. If your wheel was a stack of discs, each had conductive points (and internal resistor), you could make a “music box” with lots of spring leads. could even just use a 555 and use the resistor to change the output frequency.

    1. I’m definitely stealing this idea at some point… Maybe when I finish all my other projects ;) (yeah, haha). Sounds really cool, I’d actually like to see this on action.

    1. No, you won’t get clean transitions with an optical sensor. With the resistor wheel you have either a fixed or infinite resistance in your path. With the optical version the reading on a transition between two patterns could be anything in the range between both patterns.

    1. I do consider my-self “estupido” in hw .. but i was laying the other night in bed and thinking how expensieve the “endless” rotaries are … and came up with something similar in mind :) definitely not macgyverish stuff

      1. I am not sure if the optical mouse will be a good choice for a linear sensor. My concerns are that “steps” are lost, thus when moving forward 100mm and back 100mm does the sensor find exactly back to the starting point? That’s what I will try to find out in the near future.

      1. Well your English is far better than my German (since I don’t speak German) but there might be something off with the way you encode the audio because the timbre of your voice seems off, I can’t put my finger on it but I bet you sound better in real life.

      2. Damn it, I mentally read that reply with your voice… I really love your stuff Norbert!!! It’s just when I hear you voice I sort of backfill my own terrible Arnold Schwarzenegger impression in my head and try to talk along with you :) Keep on doing what your doing don’t ever change a goddamn thing -good on ya mate!
        Maybe I’ll do a “Boots n Pants” Geico-esqe remix one day of your stuff, but don’t hold your breath :)

          1. There is something wrong with all Americans. We all can do Schwarzenegger. “I’ll be back” i’m sure everyone just read that in Schwarzenegger voice.

            @marco, man i did the same thing reading his comments. and yes i feel like he is too? but why? Feels forced right.

  2. You could also have two contacts that were wheels on either side of a disk that has a labyrinthine track path on it so that the resistance on one side fell as it rose on the other and these were compared with two AD ports, or perhaps a simple circuit that fed a final value to a single AD port. Not sure how the noise level would be but with averaging techniques this should be manageable. The above method also tells you exactly where the shaft rotation is at all times.

      1. If the wheels are actually cylinders of the right size there is always one part of the contact touching part of the track, this reduces noise and eliminates bounces, and as I pointed out, you can use only one ADC, at the price of a small amount of additional parts. At 10 bits on the ADC accuracy to 1 degree is possible. The reason I mention it at all is that this article is about methods using resistors, and that is what the tracks are. Obviously no system with contacts is ideal because they all wear out, but designing an ideal system isn’t the point here.

          1. No, it is just that a thin wheel has a point where it can sort of bounce as it goes over the gap between the arms of the track unless it is wide enough so that it can be positioned so that one part is still in contact at all times. If the track was more resistive than a simple copper track it could just run parallel to the circumference of the disk, but if you want a simple design that you can just etch on double sided PCB material you need to make the effective length of the track longer, which creates the other problem that is solved by the wider wheel contact.

        1. I guess I understand what your tracks would look like, but there is also contact bounce whenever new “switches” are closed on whatever track you create, even if there is still another connection to the track without a change in switching state. It’s time for you to turn your idea into practice and do some experiments…

          1. There is no bounce like you get with isolated switches as there is always a continuous circuit, there is just noise and that is at a frequency and amplitude that is so different from the data rate and signal level that it can be filtered out by the usual RC means. Also keep in mind that there are two paths on either side of the disk with the resistance arranged deferentially so for the total system there is no bounce on the same scale as a single isolated switch. Having two fat contact wheels on either side allows you to use a single spring to cause the contact head to pinch the wheel with a constant pressure on both sides at all times. The track is radial wedges that are alternatively connected at the top and bottom (labyrinthine) so they get very thin near the disk centre/shaft where no contact occurs, but this is desirable because the resistance is inversely proportional to the track cross-section.

            I hope that additional explanation assists your endeavours to visualise the mechanism better, otherwise I’ll need to find the time to draw it.

          2. I did a rough diagram of the track, it has a spacing error so it may not be usable as it but you can clearly see how it works. N.B. the blue horizontal lines that show the levels for the two contact wheels (there are three in total if you use both sides of the wheel with the track pattern mirrored) the lower wheel is “fat” so part of it is always in contact with the track, and the upper wheel is always on the circumferential part of the track, treat that as ground.

            You can always cut off the inner parts of the track spokes and have SMD resistors there to turn it into a version of your idea, because they are closely related.

            Here is the image, I hope it works,


          1. Now the drawing is displayed. Interesting pattern and I can see what you’d like to create. That could be a solution for mass production of this type of encoder. Still there will be bouncing whenever the contact wheel touches one of the “pikes” or brakes that contact. I don’t know if the bouncing characteristic of wheel contacts is better than that of wipers.

          2. If the wheel is always in contact at some point, it’s shaft is vertical and the contact is diagonal there will always be a circuit to prevent even a micro arc, so if there is noise it will be at a much lower level. There is always a path from the wheel to the track, and air gab never opens up completely.

            I should write some Python or OpenSCAD code to parametrically generate the resistor track pattern. There are improvements to the top contacting area I can make too, and the long path should probably ziz-zag as if travels down the wedge area to maximise the length. Not sure how thin I can get the tracks with a DIY toner transfer type PCB etch, but that is the idea. When you want an encoder for a “dumb” motor that can use no components other than the Analog In of an ATTiny. I think that gives you just enough ports to take commands via 2 wires, drive the motor F and R with two more, and have 1 for position sensing. I don’t have a pressing need to do it “right now” but the idea is very interesting so I thought if I shared it with you guys people could pick it up and improve it further, let it evolve.

          3. There is a difference in potential when making or braking contact with a pike, thus the mechanism of contact bounce is identical to that of a normal switch. If you argue that there is a lower difference in potential, well you could also operate my wheel with lower input voltage.

          4. But there is just a single track the entire pattern is a continuous circuit, contact is never completely broken because just before the fat wheel leaves one part it is contacting the next part. the difference in current is not from 0% to 100% like in a switch, it is the difference between the current determined by the resistance and one point on the track and the next segment, which is a small fraction of the entire track length. The voltage drop change is tiny, a few percent. The area of contact between the wheel and the contact area is always greater than the thinnest part of the track.

            Remember the wheel is fat so the contact area is indicated by the red area in this animation. A normal wheel would be a dot not a bar. And yeah I know it would be even thinner but so would the tracks at the bottom, the animation is to get the idea across.


          5. Now I see where you’d like to add the wheel. Your argument is lower difference in potential. Let’s say input voltage is 5V, potential at wheel 2V and 2.5V when making contact with the next peak of the track, thus we get a difference of 0.5V. Well in principle you can operate my simple wheel with an input voltage of 0.5V to get something similar.

          6. Except it would be 5/40 (0.125) volts drop per step for that particular wheel and there would be subtle inductance and capacitance effects caused by the wheel track layout as the current flow changes paths rather than switching on and off completely. An ideal track design would have 360 steps so the steps are less than 0.01 volts or between 2 and 3 times less resolution than the 10 bit converter can handle. Assuming total drop over the entire track is 5 volts. You’d need to scale everything correctly to get the most out of the Analog Input.

            As I said before it is very much like your idea, but inside out and with way more resistors, plus that trick with how the contact works. Except it doesn’t need actual discreet resistor components. It should be better as it has less parts and less friction, as well as much greater resolution. And that is ignoring the noise and bounce difference as they seem to be disputed. :-)

          7. Two things to consider:
            1.) There is one transition in your track from 5V to (nearly 0V) when the wheel goes from end to start. At this transition you get all the contact bounce.
            2.) Noise reduces the number of peaks your microcontroller can resolve.

            Finally your construction is a potentiometer except that there are quantum steps instead of a smooth transition from 0V to Vinput.

          8. Yes it is like lots of little resistors and there is never a broken circuit so the noise should be lower and the bounce likewise for each side. You can also ignore false readings more easily when you have all that positional information and you are using both sides of the PCB arranged so that the major voltage transition is 180 degrees apart. This is why I mentioned two sides up in the initial comment. I am still sure that just with a 2 sided PCB and contact wheels feeding two analog inputs you get 1 degree position accuracy at all times and no significant problems with noise or bounce. You can have 2.5 bits of noise and still have an accurate reading. With 2 inputs you are even more accurate as they can be average, that means up to 5 bits of noise is not an issue, over the total 20 bits of readings. Two sided PCB may rule out the ATTiny at the MCU for a DIY smart motor, unless it talks via 1 wire, which is possible.

          9. Yes they will work almost the same way, they are both forms of variable resistors, not exactly the same but very similar, except then you will need two pots, and good quality ones that have as little friction as the wheel on wheel method or they will wear out very quickly in a CNC design. And those twp pots need to be designed so that you can put them inline on the same shaft otherwise the configuration gets even more complex and requires gears etc. The wheel method is ideal for very low budget DIY projects, that is all, because optical methods is always going to beat it over all. However if you can half the cost of building a 3D printer, that will matter a lot to some people who are not well resourced. That would be a great thing to do for the children of the third world.

          10. Another thing for CNC designs is keep it simple. Even the “third world” students I am in contact with have access to broken printers, thus salvaging optical sensors is no problem (which is why I made another video about reusing those sensors). The wheels on wheel encoder is more an academical problem to solve. If you think your design is a better choice than using “normal” potentiometers, take that challenge and tell me about your results.

          11. Those other videos were great. Optical is the way to go if you can salvage the parts, it is smart to utilise the embodied accuracy of somebody else’s industrial complex. As for the resistor method, yes it is just an oddity that may have use in some exceptional circumstance, or for teaching how a pot works. I’m not even sure if I can source pots that can sit on a shaft without needing a gear on the shaft and a gear for each shaft of the pot. I should pull a few apart and see if you can run a shaft right through them, that would save a lot of effort. We have our own household wiki here, I’ll list it as an exploration the kids can challenge themselves with.

  3. Love it! Very clever!

    Suggestion: decrease mechanical losses between the resistor leads and the voltage divider by printing the desired number of bare traces and interrupting each trace reasonably near to the inside of the wheel with a surface-mount resistor. The contactors could be small copper finger-stock or carbon brushes. The contact patches would be on a bare section each radial closer to the outside edge of the wheel (so no discernable height change for the contactor, as it is not contacting any part of the resistor body). Thus, significantly reduced mechanical losses in the contacts. An additional benefit would be the ability to arrange the radials on a perfectly even basis even with a high quantity of radials, or the ability to do non-linear attachments (logarithmic sequencing perhaps, or eccentric… whatever you need your encoder to do). Fascinating possibilities here!

    1. Yes, the build quality and so the electric properties of my build are a nightmare. I was surprised that it worked in the simple control loop I have build for a linear drive (see video link in a comment above).
      A simple way to get better mechanical quality is using a commercially available electromechanical quadrature switch and add two different resistors (e.g. 1k and 2k) on the outputs forming a voltage divider with another 1k resistor whenever an output is in close position. I will demonstrate that in a future video.

      1. I’ve always heard the Austrian accent described as “sing-song”. I hear what that means now.

        FWIW I used to work with an Austrian guy who once told me he was overheard by a stranger on the beach who instantly recognized his accent as a particular region of Austria. I was baffled by that until I realized how easily I can discern a Boston accent from a Providence accent. It’s all about what you’ve grown up with, I guess.

        Of course I grew up in Connecticut, so I have no discernible accent. Wicked no accent.

  4. Norbert, have you considered doing the same thing with capacitance? A small metal plate would be fixed, with a bunch of metal plates attached to the resistors on the wheel. As the rotating plates pass the fixed plate they form a temporary capacitor. The fixed plate could have a layer of paper to act as a dielectric. Then the circuit becomes a resistor, capacitor, and another resistor. The debounce would be replaced with the first derivative of the voltage.

    1. Well, you would need an extremely precise “switch”. Remember that capacitance changes with distance between the plates. Another thing is that the capacitance changes while the moving plates slide along the fixed one. You need an alternating current to “connect” the circuit. I guess that won’t work in practice – at least not in a simple McGyver way ;)

      1. The changing capacitance is a feature, not a bug. AC is easy, since you already have a clock pin on the Arduino, though you’d probably have to connect that to a transistor. And you’d still only be using one wire for sensing.

        1. I prefer simplicity over complexity. That wheel was meant to be a simple rotary encoder…
          My McGyver toolbox isn’t suitable to create something precise as you suggest, thus its your turn to show that it works – just build it!

    2. along the same lines you could use simple RC circuit to debounce the signal. Maybe even add a schmitt trigger to the circuit. It adds complexity over software debounce. but if tuned right might increase speed of the encoder. mechanical switches…so many problems. could do a SR Flip Flop debounce circuit too. then you need some nand gates..Might be worth it if you need low power processing of an input. like something with a battery that moves real slow. think solar power tracker? but for hardware cost software is the best solution i guess.

      Should see what we are doing at work with a direct drive motor. cant say much more since it’s going through patent right now….man i want to say more but everything i type i feel is too much info. oh well.

  5. I’m guessing that Resistor matrix ROMs could be built using a similar idea. for added bonus, adjust the number of possibilities of resistor values and how many of these form a word. Now you can build your own 14-19 bit word ROMs which could be interesting. No need to use only 8 bit or 16 bit ROM storage l ;)

    Or you could also use a Resistor tape (or Resistor tape loop) ROM where it’s read like magnetic audio tape, but with the Resistor tape and the Resistor values under the “read head” (resistance sensor of some kind).

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.