|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Simulating a potentiometer
Ok, this might sound like a dumb question but how can I simulate a potentiometer with a switch? (sorry it is late and I am not thinking clearly but I do want to do this and without using a digital pot...)
I want to make a simple control test box that does not require any changes to the software in which I can be able to plug in a SPDT switch into the y port and have the OI read either 0, 127, or 255, unfortunately, I will not have access to the OI until after I build this... so I am looking for ideas now before I arrive on site to try this test box. I am using a 2 position switch with (SPDT with off in the middle) and I took a 50 k ohm resistor and connected it between the switch common (port Y signal) and the wiper (+5 volts) so that in the off position it should read like a mid-range 100 k ohm pot (giving me a 127, I hope). In one position it is connected to the +5 volts wiper which should read as a 255, but with the 50 K ohm in place, I will only get either a 255 or a 127... I was contemplating not putting the 50 K ohm in there at all and tying one wiper to +5v and the other to ground but because I don't know how the OI is internally wired to the Y port line, I am not sure if in this configuration whether the P_Y port will read the open switch like a mid range pot at 127.... Any ideas on how to set this switch up so that I can read a 0, 127, & 255? Thanks |
|
#2
|
|||||
|
|||||
|
Re: Simulating a potentiometer
Japper,
There is an equivalent input schematic on the IFI website. The OI is specifically designed for the joysticks to have one side tied to the +5 volt supply and a series resistance. In conjunction with the internal resistance, the joystick forms a voltage divider. When the port is pulled to near ground, the OI assumes that the joystick has been disconnected and disables the PWM being addressed by that port. Connecting a 50K resistor is perfectly acceptable to simulate a joystick at the rest position. Likewise a 100K resistor should simulate one extreme on the joystick. We use an SP11T switch with 9.1K resistors across each position, connected to one of the ports to give us 11 operator selected auto modes. Last edited by Al Skierkiewicz : 18-02-2008 at 07:54. |
|
#3
|
||||
|
||||
|
Re: Simulating a potentiometer
Thanks Al..
How would that be wired? Are you suggesting that the switch common would be tied to the signal line going to p_Y and then one wiper would be tied to a 50 K resistor to + 5 volts and the other wiper tied to a 100 K resistor to + 5 volts ---- Or --- that the switch common would be tied to the signal line going to p_Y and a 50 K resistor to +5v then one wiper would be tied to a 100 K resistor to + 5 volts and the other wiper tied diredctly to + 5 volts ? I tried to draw it in the attached schematic. Thanks |
|
#4
|
|||
|
|||
|
Re: Simulating a potentiometer
This may be too late to help.
If all you are looking to do is get three numeric values. According to the documentation no connection gives a 127. If it's a three position switch with off in the middle Wire the common to the Analog input pin. wire a 100K to the +5Vaux and to one side of the switch and then wire a small value resistor to the other side ( I calculated a value less than 100 ohms and I think the input should be able to be directly connected to +5v but I wouldn't tell you to do that until I had actually tried it myself. I'd try a 1K just to be safe and see what values you get.) also connected to +5Vaux. So switched to the 100K you should get close to zero switched off you take advantage of the system thinking the joystick is disconnected and get 127 and switched to the low value resistor it should give a 254. I'll try shorting the input and see if that blows anything and let you know. Steve OK tried the spark test... no sparks and the port still operates normally. I thought it would. must be a high impedance input only reading voltage. Last edited by Steve_Alaniz : 16-02-2008 at 14:57. Reason: Additions |
|
#5
|
||||
|
||||
|
Re: Simulating a potentiometer
Yes this work great Steve-
Thanks! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Potentiometer Problems | Nicole_Ypes | Electrical | 7 | 08-02-2007 18:59 |
| Simulating Motion with Physical Dynamics | Madison | SolidWorks | 5 | 08-02-2007 12:19 |
| Potentiometer | fezkazi | Electrical | 3 | 24-01-2007 13:29 |
| Simulating autonomous mode - i need help!! :( | itay_ms | Programming | 5 | 21-01-2007 11:28 |
| Potentiometer | Joshua May | Technical Discussion | 8 | 22-05-2004 19:51 |