# +/-3.5v to 0-100k resistance conversion circuit help please!

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by djpubba, Jan 4, 2006.

1. ### djpubbaNew Member

Joined:
Jan 4, 2006
Messages:
40
Likes:
0
Hello nice people.

I'm trying to convert an old analog game system controller (Vectrex) to work on a PC through a gameport for a magazine article I'm writing. I need to create and document a circuit to do the job but it's getting a little over my head due to the oddball way the Vectrex controller is designed to operate.

The way it works is that it takes +/-5v input and outputs it between +/-3.5v for each axis depending on the value of the pots connected to the joystick (at least I think that's what's going on). Here is a schematic:

(VR-X and VR-Y are 10k pots). The schematics show R601 and R603 as 4.7k, but measuring them gives 3.5k. The pots at r602 and r604 are factory set at 4.2k.

So VR-X and VR-Y vary the voltage coming out of X and Y between +/-3.5v. I need to convert this to a ~0-100k range of resistance to match what a PC's gameport requires. I'm thinking of using some type of voltage controlled resistor to do the job.

As I see it through my electronically-newbish eyes, what I need to do is:

1) Figure out how to create both -5v and +5v from a single +5v source (a PC gameport's +5v pins).

2) Build or find a voltage controlled resistor circuit that will take an input range of +/-3.5v and convert it to 0-100k resistance across two points, following the input voltage linearly. -3.5v = 0k resistance, 0v = 50k resistance, +3.5v = 100k resistance.

I need to avoid modifying the original Vectrex controller's circuit so that I don't anger Vectrex collectors/preservationists.

For the voltage controlled resistor, I was looking at the DS1666-100 as an option.

http://pdfserv.maxim-ic.com/arpdf/DS1666-DS1666S.pdf

It looks like it has most of the things I need except I'm not sure the inputs are quite what I need. Any opinions on that or other alternatives?

Any advice for either of my two objectives for this project would be appreciated.

Or, if you have any ideas about how to do it a simpler way, that'd be great, too.

I'd be happy to credit anyone who is able to help in the magazine article if they like (it'll be published in the February issue of Hardcore Gamer Magazine -- deadline's coming up quick, too!!).

2. ### ljcoxWell-Known Member

Joined:
Dec 25, 2003
Messages:
3,226
Likes:
28
Location:
Melbourne Australia
I can't see any easy way to do it with the DS1666.

I suggest that you use a LDR and a LED. Connect the LED to the output of the game pot (a transistor may be required for buffering) and arrange the LED & LDR in a light proof enclosure.

As the game pot is changed, it will alter the light intensity and thus you should be able to change the LDR resistance from about 500 ohm to over 100 k.

If necessary, you can limit the upper resistance to about 100 k by connecting a resistor in parallel with the LDR.

You don't need the -5V supply, just connect this line to gnd.

The relationship between the pot setting (ie. the angle of rotation) probably won't be linear, but it may be acceptable. If not, there are ways to taper the slope.

3. ### OznogActive Member

Joined:
Apr 21, 2004
Messages:
2,879
Likes:
11
Location:
Austin, Tx
1. MAX1044.
2. Don't. In all likelihood the Vectrex simply reads the voltage with a high impedance amplifier. So just providing a voltage from -3.5v to 3.5v should do the job.

Joined:
Jan 12, 1997
Messages:
-
Likes:
0

5. ### djpubbaNew Member

Joined:
Jan 4, 2006
Messages:
40
Likes:
0

This looks like it'll do the trick very nicely! I snatched an LED/LDR pair out of a mouse and wired it up. I got a range of 6k ohm to 16M ohm so I wired up a 100k resistor in parallel with the LDR and got a range of 6k-100k. w00t! Thank you very much.

I didn't end up using a transistor for a buffer. With the output of the Vectrex controller hooked up to the LED with a 10k resistor on the - side of the LED to ground, I got a voltage range of +.5v to +1.5v. Seems to work okay.

You're right about it not being quite linear, though. Once I hook it up to the actual PC I'll see if it's too far off kilter on one side to be noticable. If it is, I'll be back for more of your golden advice.

I'll definitely give a "thanks Len" in the article.

6. ### djpubbaNew Member

Joined:
Jan 4, 2006
Messages:
40
Likes:
0
1. Ahh, thanks. Now I'll know how to do that if I ever need to in the future.
2. I'm hooking it to a PC's gameport, not a Vectrex, so that range won't do.

7. ### ljcoxWell-Known Member

Joined:
Dec 25, 2003
Messages:
3,226
Likes:
28
Location:
Melbourne Australia
[quote="djpubba]
I didn't end up using a transistor for a buffer. With the output of the Vectrex controller hooked up to the LED with a 10k resistor on the - side of the LED to ground, I got a voltage range of +.5v to +1.5v. Seems to work okay.[/quote]

+.5v to +1.5v. seems to be a rather small range. It's a wonder that the LED glows at all. A red LED needs at least 1.7 V to see a visible glow. And other colours need more.

I would be inclined to insert a transistor in the Emitter Follower configuration in order to shield the pot from the LED, so to speak.

8. ### Nigel GoodwinSuper ModeratorMost Helpful Member

Joined:
Nov 17, 2003
Messages:
39,385
Likes:
666
Location:
Derbyshire, UK
ONLINE
A PC game port is a crude resistance measuring device (essentially the timing resistor in a 555 circuit), the joystick is just a 100K pot from 5V to the input pin (with only a small part of it's range used).

If you ignore the negative connection, and disconnect the negative resistors from the pots, it will probably work?.

9. ### ljcoxWell-Known Member

Joined:
Dec 25, 2003
Messages:
3,226
Likes:
28
Location:
Melbourne Australia
Nigel,
As far as I can gather, he indicated he does not need the -5V.

10. ### Nigel GoodwinSuper ModeratorMost Helpful Member

Joined:
Nov 17, 2003
Messages:
39,385
Likes:
666
Location:
Derbyshire, UK
ONLINE
Which is why I said to ignore it, and disconnect the resistors to the negative. PC joystick pots only use +5V and the input pin, not even a ground pin! - although the buttons use the ground connection.

11. ### ljcoxWell-Known Member

Joined:
Dec 25, 2003
Messages:
3,226
Likes:
28
Location:
Melbourne Australia
Yes but the 2 pots will be interconnected via R601 and R603 and will thus affect each other. So he needs the ground in order to isolate them.

12. ### Nigel GoodwinSuper ModeratorMost Helpful Member

Joined:
Nov 17, 2003
Messages:
39,385
Likes:
666
Location:
Derbyshire, UK
ONLINE
I've written disconnect the resistors to the negative twice now, for that exact reason - you CAN'T connect the resistors to ground, it would prevent the game port working correctly.

13. ### ljcoxWell-Known Member

Joined:
Dec 25, 2003
Messages:
3,226
Likes:
28
Location:
Melbourne Australia
Re: +/-3.5v to 0-100k resistance conversion circuit help ple

[quote="djpubba]/
2) Build or find a voltage controlled resistor circuit that will take an input range of +/-3.5v and convert it to 0-100k resistance across two points, following the input voltage linearly. -3.5v = 0k resistance, 0v = 50k resistance, +3.5v = 100k resistance.
[/quote]
Nigel,
I think you are missing the point of what he is trying to do. The above is from his first post. My understanding is that he wants a pair "floating" resistances that are controlled by the pots in the controller. So the PC will see only the floating resistances thus satisying your point.

14. ### Nigel GoodwinSuper ModeratorMost Helpful Member

Joined:
Nov 17, 2003
Messages:
39,385
Likes:
666
Location:
Derbyshire, UK
ONLINE
Re: +/-3.5v to 0-100k resistance conversion circuit help ple

I rather think it's you who's missing the point 8)

His first line says:
Which was what I was suggesting to do, simply wiring the controller to make it more suitable for a PC game port - far easier than trying to build something to try and do it?.

15. ### ljcoxWell-Known Member

Joined:
Dec 25, 2003
Messages:
3,226
Likes:
28
Location:
Melbourne Australia
Re: +/-3.5v to 0-100k resistance conversion circuit help ple

This is why I assumed he needs an interface.

16. ### Nigel GoodwinSuper ModeratorMost Helpful Member

Joined:
Nov 17, 2003
Messages:
39,385
Likes:
666
Location:
Derbyshire, UK
ONLINE
Re: +/-3.5v to 0-100k resistance conversion circuit help ple

That makes it a LOT more difficult then :lol:

17. ### djpubbaNew Member

Joined:
Jan 4, 2006
Messages:
40
Likes:
0
I gave it a try and it did indeed give me a wider range -- +.5v to +4v with +2.5v at the center, which is great, but then the resistance range I get from the LDR is all out of whack. It goes from 1k to 100k, but centers on 5k. So it's 1k-5k on the right of center, then 5k-100k on the left, which is way too lopsided.

I don't think this is a visible light LED. It's probably infrared. I think I'll stick with the .5v - 1.5v range I got without a transistor if there's no other reason not to, and see if that ends up being too lopsided still once I hook it all up to the PC.

18. ### ljcoxWell-Known Member

Joined:
Dec 25, 2003
Messages:
3,226
Likes:
28
Location:
Melbourne Australia
I can't recall what the voltage drop across an infrared LED is. If you're happy with the LDR range with this diode then all is well. But if you need to shift the centre, then you will need a diode and 2 resistors. If you need to do this, let me know what the LED voltage is at the point where you want the shift and whether you want the shift to be up or down (in LDR resistance) and I'll calculate it for you.

19. ### djpubbaNew Member

Joined:
Jan 4, 2006
Messages:
40
Likes:
0
Well, I got it hooked up to the PC and I must say that I'm stumped by the behavior. It doesn't register any input to the left of center. When I measure the resistance across the LDR when it's not hooked up to the PC's gameport, it measures just the way I want -- 95k on the far left, 50k in the center and 5k on the far right. But connected to the gameport, the PC sees nothing from center to far left. Works great from center to the right. To troubleshoot, I tried using a 50k resistor in parallel with the LDR instead of 100k. Nada. It gave me the expected range -- 45k to 25k to 5k, but still did nothing from center to the left.

If I try to measure the resistance in circuit, the meter just shows 0L.

The voltage on the X input stays at +5v regardless of the position of the stick.

Here's a diagram of my circuit:

Maybe I need to add some diodes in there to seperate the Vectrex power from the LDR power???

20. ### ljcoxWell-Known Member

Joined:
Dec 25, 2003
Messages:
3,226
Likes:
28
Location:
Melbourne Australia
The first test I would do, would be to connect a 100 k pot in lieu of your circuit.

If you still cannot make it move left of centre, then connect a 100 k resistor in series with the pot. It may be that the computer needs more than 100 k to go left of the centre.

21. ### djpubbaNew Member

Joined:
Jan 4, 2006
Messages:
40
Likes:
0
I'll try a 100k pot alone to make sure it's not the Gameport being wacky.

I should clarify that the PC is seeing the full range. But it sees it between far right and center. So when the stick is centered, it thinks it's far left. To get center on the PC I have to hold the stick half way to the right. This is what led me to try a 50k resistor instead of 100k, but it behaves the same way.

I do have an X/Y oscilloscope, I just don't know how to use it very well and one of the channels is broken. (Y, iirc).