View Single Post
  #14   Spotlight this post!  
Unread 11-04-2006, 20:37
ZZII 527's Avatar
ZZII 527 ZZII 527 is offline
"Scale Electric Vehicle"
AKA: Shane Colton
FRC #0097
Team Role: College Student
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Cambridge, MA
Posts: 366
ZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond repute
Send a message via AIM to ZZII 527
Re: Potentiometer 5 or 6 detents

Edit: Kris beat me to it by a few minutes. And with impressive knowledge of the Digikey catalog!

One way to get approximately what you want is to wire up a SP6T switch as follows:

+5V connected to a resistor R, then to the common lead.
Signal wire should be joined to common lead.

Lead 1: straight to GND
Lead 2: thru resistor value R/4 to GND
Lead 3: thru resistor value 2R/3 to GND
Lead 4: thru resistor value 3R/2 to GND
Lead 5: thru resistor value 4R to GND
Lead 6: thru BIG resistor to GND

This sets up a 6-setting voltage divider which will give the following voltages across the common resistors:

Position 1: ~0V
Position 2: 1V
Position 3: 2V
Position 4: 3V
Position 5: 4V
Position 6: 5V

You can set up ranges in the program to check for this. These resistor ratios can all be approximate, but that gives you the widest separation possible for the analog input, reducing the risk of mistaking one mode from another.

Of course, binary inputs are simpler if you have enough pins.
__________________
MIT Mechanical Engineering
>> College Mentor, Team 97: Cambridge Rindge and Latin School with The Edgerton Center, MIT Mechanical Engineering, Bluefin Robotics, and Draper Laboratory
>> Alumnus, Team 527: Plainedge HS

Last edited by ZZII 527 : 11-04-2006 at 20:49.