a digital scan of a 35mm film image of a processing sketch running on an LCD
Skip to Content

Buzz Pot: A Variable Detent Potentiometer

In the course of developing Brain Radio with Arturo and Sofy, we saw the need for a means of tuning between an arbitrary, and potentially unstable number of channels. For the sake of context, Brain Radio is a head-mounted EEG-based broadcast system — everyone with a headset can tune into anyone else with a headset, and listen to sounds synthesized by that person's brain waves.

How, exactly, would the tuning process take place? We knew a few things:

  • We wanted to use a dial to leverage associations with radio / tuning / broadcast / analog.
  • We would need some kind of tactile feedback, since the dial would be mounted on the headset, outside of the wearer's field of view.
  • The number of available stations / channels would vary — if three people were in range, the dial would need to be able to tune to three positions. If more channels came online or dropped out, the interface would have to adapt.

What we really wanted was a potentiometer with detents, to make it easy to click-click-click from station to station. Detents also summon a tactile delight rivaled only by toggle switches and large mechanical levers. They inflate the sense of intention associated with an action: They make you feel like you know what you're doing.

The catch, of course, is that detented potentiometers have a finite number of detents, and they're set at the factory. If we bought five-detent pots and ended up with six radio channels to tune between, we were SOL. What we needed was a variable detent potentiometer.

Google turned up some shady, product-less patent filings. And the PComp list confirmed that no such device existed — and then suggested something very savvy: use something else to generate the tactile feedback. How about a vibrator motor...

So I did exactly that. A vibrator motor, some hot glue, a potentiometer, and some code all collided to create the buzz pot:

The video doesn't really communicate the physical feedback coming through the pot when channel thresholds are crossed, but in practice it works pretty well. The number of channels is easily changed in software — and the resistance range of the potentiometer is simply divided up so a given range of values represent a single channel.

For example, a three channel setting would put channel 1 between analog values 0 and 341, channel 2 between 341 and 682, and then channel 3 between 682 and 1023. When the pot passes from one channel range to the next, the microcontroller flips on the transistor controlling power to the vibrator motor for a fraction of a second, sending a mechanical buzz through the pot that lets the user feel when they've changed channels, even if they can't see what they're doing.

Development was relatively simple. Hot glue held up surprisingly well to the vibration motor.

Buzz pot motor mountedBuzz pot bottom view

The basic test configuration includes a seven-segment LED display so I could verify when the channels changed.

Buzz pot test configuration

Here's the schematic. The seven-segment display adds some complexity... it's really just for troubleshooting purposes (sending the channel status out over serial would be much simpler). Even then, a shift-register would allow for more sensible use of the Arduino's pins if this were more than a proof of concept. The TIP 120 between the Arduino and the vibration motor is definitely overkill, I just put it in place since Brain Radio was going to have discrete power sources and it would have made sense to put the motor on the non-Arduino power supply. (Some of the graphics in the schematic were adapted from the Fritzing project.)

Buzz Pot Schematic

And finally, the code:

  1. // Buzz Pot
  2. // Eric Mika, 2009
  3. // Provides tactile feedback for a potentiometer to denote changes
  4. // from one value range to another. Ideal for situations where an unknown
  5. // number of values must be set by a single potentiometer.
  6. // To do:
  7. // 1. Debounce the thresholds.
  8. // 2. Handle fringe-case runtime channel count changes.
  9.  
  10. int vibratorPin = 9; // Turns the vibration motor on and off through a transistor.
  11. int potPin = 0; // Reads the potentiometer.
  12. int potValue = 0; // Stores the potentiometer value.
  13.  
  14. int channels = 10; // Number of values selectable by the pot.
  15. int currentChannel = 0; // Starting value.
  16. int lastChannel = 0;
  17.  
  18. int vibDuration = 200; // How long to turn the motor on when thresholds are crossed.
  19. unsigned long vibStart = 0; // Keep track of time so we know when to turn off the motor.
  20.  
  21. // Map digital pins to their respective LEDs in the 7 segment display.
  22. // Could use a shift register instead to save pins.
  23. int dispA = 2;
  24. int dispB = 3;
  25. int dispC = 4;
  26. int dispD = 5;
  27. int dispE = 6;
  28. int dispF = 7;
  29. int dispG = 8;
  30.  
  31. void setup() {
  32.   // Set up 7 segment display pins.
  33.   pinMode(dispA, OUTPUT);
  34.   pinMode(dispB, OUTPUT);
  35.   pinMode(dispC, OUTPUT);
  36.   pinMode(dispD, OUTPUT);
  37.   pinMode(dispE, OUTPUT);
  38.   pinMode(dispF, OUTPUT);
  39.   pinMode(dispG, OUTPUT);    
  40.  
  41.   // Set up vibrator pin.
  42.   pinMode(vibratorPin, OUTPUT);  
  43. }
  44.  
  45. void loop() {
  46.   // Read the analog input into a variable, correct for value inversion.
  47.   potValue = 1023 - analogRead(potPin);
  48.  
  49.   // If 10 channels, return a number between 0 and 9...
  50.   // Constrain to catch rounding errors at the top end.
  51.   currentChannel = constrain(potValue / (1023 / channels), 0, channels - 1);
  52.  
  53.   // Show the current channel number on the 7 segment display.
  54.   displayDigit(currentChannel);
  55.  
  56.   // Vibrate if we change channels.
  57.   if (lastChannel != currentChannel) {
  58.     vibStart = millis();
  59.   }
  60.  
  61.   // Keep vibrating for the full duration...
  62.   if ((millis() - vibStart) <= vibDuration) {
  63.     digitalWrite(vibratorPin, HIGH);
  64.   }
  65.   else {
  66.      digitalWrite(vibratorPin, LOW);
  67.   }
  68.  
  69.   lastChannel = currentChannel;
  70. }
  71.  
  72. // Shows a number on the 7 segment display.
  73. // It's a common anode model, so LOW is actually on.
  74. void displayDigit(int digit) {
  75.   switch (digit) {
  76.   case 0:
  77.     digitalWrite(dispA, LOW);
  78.     digitalWrite(dispB, LOW);
  79.     digitalWrite(dispC, LOW);
  80.     digitalWrite(dispD, LOW);
  81.     digitalWrite(dispE, LOW);
  82.     digitalWrite(dispF, LOW);
  83.     digitalWrite(dispG, HIGH);      
  84.     break;
  85.   case 1:
  86.     digitalWrite(dispA, HIGH);
  87.     digitalWrite(dispB, LOW);
  88.     digitalWrite(dispC, LOW);
  89.     digitalWrite(dispD, HIGH);
  90.     digitalWrite(dispE, HIGH);
  91.     digitalWrite(dispF, HIGH);
  92.     digitalWrite(dispG, HIGH);
  93.     break;
  94.   case 2:
  95.     digitalWrite(dispA, LOW);
  96.     digitalWrite(dispB, LOW);
  97.     digitalWrite(dispC, HIGH);
  98.     digitalWrite(dispD, LOW);
  99.     digitalWrite(dispE, LOW);
  100.     digitalWrite(dispF, HIGH);
  101.     digitalWrite(dispG, LOW);
  102.     break;
  103.   case 3:
  104.     digitalWrite(dispA, LOW);
  105.     digitalWrite(dispB, LOW);
  106.     digitalWrite(dispC, LOW);
  107.     digitalWrite(dispD, LOW);
  108.     digitalWrite(dispE, HIGH);
  109.     digitalWrite(dispF, HIGH);
  110.     digitalWrite(dispG, LOW);
  111.     break;
  112.   case 4:
  113.     digitalWrite(dispA, HIGH);
  114.     digitalWrite(dispB, LOW);
  115.     digitalWrite(dispC, LOW);
  116.     digitalWrite(dispD, HIGH);
  117.     digitalWrite(dispE, HIGH);
  118.     digitalWrite(dispF, LOW);
  119.     digitalWrite(dispG, LOW);
  120.     break;
  121.   case 5:
  122.     digitalWrite(dispA, LOW);
  123.     digitalWrite(dispB, HIGH);
  124.     digitalWrite(dispC, LOW);
  125.     digitalWrite(dispD, LOW);
  126.     digitalWrite(dispE, HIGH);
  127.     digitalWrite(dispF, LOW);
  128.     digitalWrite(dispG, LOW);
  129.     break;
  130.   case 6:
  131.     digitalWrite(dispA, LOW);
  132.     digitalWrite(dispB, HIGH);
  133.     digitalWrite(dispC, LOW);
  134.     digitalWrite(dispD, LOW);
  135.     digitalWrite(dispE, LOW);
  136.     digitalWrite(dispF, LOW);
  137.     digitalWrite(dispG, LOW);
  138.     break;      
  139.   case 7:
  140.     digitalWrite(dispA, LOW);
  141.     digitalWrite(dispB, LOW);
  142.     digitalWrite(dispC, LOW);
  143.     digitalWrite(dispD, HIGH);
  144.     digitalWrite(dispE, HIGH);
  145.     digitalWrite(dispF, HIGH);
  146.     digitalWrite(dispG, HIGH);
  147.     break;
  148.   case 8:
  149.     digitalWrite(dispA, LOW);
  150.     digitalWrite(dispB, LOW);
  151.     digitalWrite(dispC, LOW);
  152.     digitalWrite(dispD, LOW);
  153.     digitalWrite(dispE, LOW);
  154.     digitalWrite(dispF, LOW);
  155.     digitalWrite(dispG, LOW);
  156.     break;
  157.   case 9:
  158.     digitalWrite(dispA, LOW);
  159.     digitalWrite(dispB, LOW);
  160.     digitalWrite(dispC, LOW);
  161.     digitalWrite(dispD, LOW);
  162.     digitalWrite(dispE, HIGH);
  163.     digitalWrite(dispF, LOW);
  164.     digitalWrite(dispG, LOW);
  165.     break;
  166.   default:      
  167.     digitalWrite(dispA, HIGH);
  168.     digitalWrite(dispB, HIGH);
  169.     digitalWrite(dispC, HIGH);
  170.     digitalWrite(dispD, HIGH);
  171.     digitalWrite(dispE, HIGH);
  172.     digitalWrite(dispF, HIGH);
  173.     digitalWrite(dispG, HIGH);
  174.   }
  175. }

December 29 2009 at 11 AM

Ben:

I realize this is old but people may come across it from searching. A "rotary encoder" would have been an okay substitute for your needs, though not as interesting.

April 9 2012 at 3 AM

Eric Mika:

@Ben: Thanks for commenting. This project would work just as well with a rotary encoder — but in and of itself a rotary encoder still doesn’t solve the “variable detent” problem which is the whole point of pairing the vibration motor with a selection knob. (Whether the knob is based on a pot or rotary encoder is immaterial.)

April 9 2012 at 10 AM

Add Your Comment