Knobs/Switches for the OI

Hi,

In the past years our OI was very simple with only joysticks, however, this year we are thinking of using knobs and simple switches for some components.

I know that in the past some teams have succesfully used knobs on the OI, i would like to know how to hook up a knob to the OI, also what will be its resolution and how to read its reading into the FRC controller. If anyone has done this in the past please let us know the model No. of the knob. :slight_smile:

Inside a joystick, there are 2 potentionmeters that measure x and y axis movement. You can refer to this as x/y pitch/yaw… whatever…

This is the way the pins on a gameport are arranged (male)

Look at the chart on this site to see which pins relate to which digital/analog input.

Ok so this is what you do.

  1. Find an old gameport joystick, or random db-15 cable with male connector.
  2. Splice open the cable, and see which wire leads to which pin.

If you want to wire a knob that measures how far it is spun, you want to use whats called a potentiometer. These work like this…
http://www.team195.com/images/pot.gif

If you connect the wire from the +V wire from the gameport cable to the center pole/lead, the other 2 leads will give you a variable signal depending on where the shaft is.

So if you want to use a pot…

  1. Connect pot to cable. Refer to this pot as pN_x in code, where N equals the port number.

  2. Wire up switches. You can put up to 4 for each port.

I hope this helped. Reply if you need more help.

The pinouts for all the ports on the OI are listed in this document: http://www.ifirobotics.com/docs/oi-ref-guide-2005-revnc0-1-12-05.pdf

Use this to find an open port that will not be used by your joysticks and then wire in some potentiometes as outlined in the above post. We have done this successfully in the past with many standard potentiometers that can be found at radio shack.

Thankyou for the informaiton, Does anyone has a sample code to read the potentiometer in the RC.

Hey,
I wired a 100K audio Potentiometer to OI. With the Middle and Outside terminals of the POT connected to the OI. I am getting the values from 231(min) - 254(max). Can any tell my what i am doing wrong or how i can increase this range. Thanks in advance.

hey tom thanks for the pictures they were a big help but i still dont completely understand…so say i wanted to wire up a pot to p3_x i tried it but i didnt know what to connect each lead on the pot to. i felt somewhat confused when i found there was 3 leads on the pot. this is what i did:

(the underscore line signifies a connection)

(pin 4 ground)_______________ Outside Lead on POT
(Pin 3 x)____________________ Middle Lead on POT

when i did this ran it through our dashboard and it wasn changing values

lemme know what to do, thanks
-Ben

Look on page 5 of the OI Reference Guide (which Damian previously posted). Pots need to be wired to the +5V pin (which is pin 1) rather than ground. The other end goes to the analog input. It doesn’t really matter which way you connect it as long as you have the “wiper” pin (typically the middle) and one of the edge pins. Also, you can use an ohmmeter to test the pot before you wire it.

Audio pots are generally bad for OI use, because they are made to be used as a volume control and therefore are not linear. Each degree of rotation of the pot does not result in the same change in resistance.

Yo Thoughtful,
My guess is that you connected one end of the Pot. to +5vdc and the wiper to the sig. input, but didn’t connect the remaining lead on the pot to gnd.
If that is the case, then your pot is just acting as a pull up resister, an adjustable one at that. That is why you are only seeing numbers in the very high end of the max range. Once you connect the other end of the pot to gnd, you will , in essence, be spreading the +5v across the entire length of the pot. Now as you move the slider/wiper along the length of the pot, you will see values from ~255 to ~ 0. Actual numbers will slightly different.

The other cause of what you are seeing is that you have an “open” in the wiring from gnd to the pot.