Better Simulators With Homemade Potentiometers

Perhaps you’ve played a flight simulator before, using something like a mouse and keyboard. That’s a fine experience, but like any other activity you can get a lot more out of it if you put a little more effort into the experience. Some will upgrade to a joystick for a modest improvement, and others will build incredible accurate cockpit replicas down to the smallest detail. The builders of these “pits” are always looking for ways of improving their setups, and it’s from this world that we find a method of building specialized, inexpensive hall-effect sensors.

A hall-effect sensor is a circuit that outputs a voltage based on the presence of an external magnetic field. These can be used to make compasses, but with a permanent magnet in close proximity can also be used to create a potentiometer-like device at lower cost and with higher precision than a similarly-priced pot. There was a method of building these in the simulator world using the housing of a Bic pen and some strong glue, but [LocNar] has improved on this method as well. He repurposed some bearings and some stock metal tubing in order to fabricate a professional-level sensor at a fraction of the cost.

This build is essentially a solution for anyone needing a potentiometer that’s easier to build, less expensive, has higher precision, and interacts with a digital input in a much more predictable (and programmable) way. Certainly this has applications in the simulator world, but will work for many other applications. If you’ve never thought about the intricacies (and shortcomings) of potentiometers, some other folks have taken a deep dive into that as well.

Thanks to [Keith O] for the tip!

21 thoughts on “Better Simulators With Homemade Potentiometers

    1. Hall effect sensor has the digital output.
      The value can be fed directly to the digital input, there is no need for ADC in this case.
      What must be confusing for you is that the regular pots are analog, this is not the case.

      1. TFA says higher precision than a similarly priced pot, not cost. I really doubt it anyway, but it could be improved by using a magnetic encoder, with precision amplifier and ADC on the chip. Those things could give you some 4096 counts/rev.

        1. nah cost is lower. high quality pots in the spec you want are expensive in small quantities. most controllers want 60 degree pots when your typical run of the mill linear pot is 270 degrees. you would end up with big dead bands at either end of your range if you used the latter.

          hall sensors also do have deadbands but they aren’t as severe. the ss49e sensors ive been using have an output voltage range of 0.86-4.21v, and the remaining range maps to 180 degrees of rotation. i want to start experimenting with other b-field geometries to try and use the full range of the sensor out of a 60 degree rotation. but that likely requires some math i dont yet know.

          1. You can cheat a bit by using more than 1 sensors offset at an angle to cover the ranges. You would need some overlapping to cover the dead bands.

            As for the math, calibrate and use look up tables with piecewise interpolation.

          2. i was thinking more of orienting magnets with their poles at arbitrary angles forming sharply turning flux lines. this might throw in some nonlinearity though that’s fixable through calibration, luts and interpolation. the problem here is if you are replacing a pot on a system with a bunch of closed source blobs and no way to do really low level calibration.

            the mechanical route works too. you could actually print the gearing right into the armature that rotates the magnets. i made some pots for an old timey heavy equipment joystick module, which did use gearing (really nice fine pitch aluminum gears) that was easy to adapt to.

        2. As I prepared to be smug saying to myself “I know they have 10,000 counts/rev optical encoders I looked up their price US $1,881.00 and I’m like ummm ok I can live with 4096 counts/rev

      2. “… in a predictable way…”

        Instead of grinding carbon and copper contact, which will produce all sorts of spikes and contact bounce possibly, this thing. Hall effect sensors are analog, but very, very linear compared to a cheap potentiometer, because, well, cheap potentiometers come from China.

    2. you still need an adc input to read it. its technically analog. though you can get hall latches in the same package that are more suited to encoder applications, those are digital.

    3. >what?

      A potentiometer isn’t actually trivial to interface with if you care for precision, because the load you put on the potentiometer changes the reading, and turning the pot causes noise in the output. The supply voltage you give to the pot in a digital circuit has all sorts of switching noise as well. For purely digital inputs where you want to detect a limit using a potentiometer, this creates ambiguity and erroneous readings.

      A linear hall sensor has an internal voltage regulation and an op-amp for output that provides a stable signal voltage with a reasonable ability to sink and source current without changing the output value, so your Arduino’s ADC doesn’t end up depressing the signal.

      (The Arduino and many similar chips have a simple sample-and-hold circuit that charges up an internal capacitor for the SAR ADC. This forms an RC network with the potentiometer, which ends up working like a variable lowpass filter. This interacts with the sampling rate and produces an error that depends on the varying resistance of the pot.)

      1. You would want an external capacitor right at the ADC input pin. The cap would provide the low AC impedance and the charge for the internal ADC switched cap sampling SAR. ADC section of the datasheet/app note explains that.

        The track length the cap is critical as well as the grounding as track inductance increases the impedance. I have seen error creeping up on one channel vs others of my project when it was a bit more than 1cm.

  1. I play analogue synthesizers, can this match the accuracy of a 10 turn pot? Yes halls are are standard on e-bike throttles etc. A 10 turn would be nice to adjust flight trim for sure. Slop, never heard of that.

  2. i made some hall encoders and potentiometers and the surprising thing is how easy they are to make. ive been 3d printing them so i need to make progress scaling them down.

  3. Look at Austrian Microsystems AS5040, 5045, 5048, and the like: magnetic rotary encoders, with 8, 10, 12 bits of precision. They’re fairly cheap and do all the work for you: SPI(ish…) output that gives you the angular position, and they have a proportional PWM output should you prefer that, and they have an index pin if all you want is RPM, and they work up to something like 30,000 rpm. I used to sell breakout boards for these, and my arduino libraries for interfacing with them are widely available online. With some physical adjustment, software tuning, and writing the onboard tuning PROM, you can get LSB stability. (I usually could get LSB stability just through physical adjustment and a bit of averaging of sequential readings.)
    and of course these would also work for ten turn or a hundred turn or whatever else.

  4. FWIW, if you want to characterize them, all you need to do is print out a circle with 360 ticks along the edge that has a radius of (for example) 360 / pi / 2 mm and stick it to the knob, then mark another tick on something else and advance the wheel one position per tick. If you want more precision, making it 3 times larger (with 3 times as many ticks) will give you 1080 positions per rotation.

Leave a Reply

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