Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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

Status
Not open for further replies.
I hooked up a 100k pot and it works as expected.

Edit: So... from the measurements I've taken, the magic area that gives me the movement range I want happens when the LED is getting between 1.0v and 1.5v. Center will be 1.25v. Right now my circuit gives me from .5v to 1.5v. So how can I shift it so that I get 1.0v to 1.5v going to the LED instead of .5v to 1.5v?
 
Here is a circuit that provides a current proportional to the control pot setting. If the 100k that you are replacing actually controls a 555 timer, this should work, and not have sensitivity variations over the control range. I have added another "factory adjustment" pot (R1), because I'm not sure what the value of the emitter resistor should be. You might even have to make R5 a lower value.
If you try it, please let us know if it works.
 

Attachments

  • vectrex_emulator.png
    vectrex_emulator.png
    15.6 KB · Views: 488
djpubba said:
I hooked up a 100k pot and it works as expected.

Edit: So... from the measurements I've taken, the magic area that gives me the movement range I want happens when the LED is getting between 1.0v and 1.5v. Center will be 1.25v. Right now my circuit gives me from .5v to 1.5v. So how can I shift it so that I get 1.0v to 1.5v going to the LED instead of .5v to 1.5v?

Have you tried adjusting the pots R602 & R 604?

You could also reduce the 1 k resistor that is in series with the LED. I don't know what the LED's maximum safe current is, but they casn usually withstand up to 20 mA at least. So a resistor of 220 R would restrict the max current to this level. The brightness of a LED is mainly dependent upon the current through it. So measure this, not the voltage across it.

If these measures are not sufficient, I would connect a resistor from the anode of the LED to +5 V. You did not show the values of pots VR-X & VR-Y. These values would help me to calculate the resistor value.

This resistor will set the minimum LED current and thus the right limit.
 
LEDs and LDRs are both very nonlinear. I would be very surprised if the combination yields anything useable. However, I could be wrong. I was wrong once before. :shock:
 
ljcox said:
Have you tried adjusting the pots R602 & R 604?

No. They'll be closed up inside the Vectrex controller, so even if I could adjust them, I don't want to tell people to open their controllers to adjust them in my article.

You could also reduce the 1 k resistor that is in series with the LED. I don't know what the LED's maximum safe current is, but they casn usually withstand up to 20 mA at least. So a resistor of 220 R would restrict the max current to this level. The brightness of a LED is mainly dependent upon the current through it. So measure this, not the voltage across it.

If these measures are not sufficient, I would connect a resistor from the anode of the LED to +5 V.

I'm going to go to the electronics store and buy some pots to connect to both sides of the LED so I can try adjusting the current to where I need it. I'm also going to pick up the parts and build Ron's circuit so that I can offer both solutions in my article if they both work.

You did not show the values of pots VR-X & VR-Y. These values would help me to calculate the resistor value.

The schematic doesn't show them but I listed them below it. They're 10k.

I'll post my results hopefully later today. Thanks for all the help.
 
djpubba said:
ljcox said:
Have you tried adjusting the pots R602 & R 604?

No. They'll be closed up inside the Vectrex controller, so even if I could adjust them, I don't want to tell people to open their controllers to adjust them in my article.

As you're effectively 'crippling' yourself by not being able to adjust R602 and R604, I would suggest adding two opamps between the pot slider and Q1 in Ron's circuit (you need two to make it non-inverting!). You could then have two pots around the opamps, allowing external adjustment of gain and DC offset.
 
Ron's circuit is very good. I would concentrate on it rather than the LDR suggestion. It has the advantage of being linear which the LED/LDR combination is not.

Here is a spreadsheet of the range of voltages for combinations of pot settings.

Pot---------Pot
VR-X-------R 604---------v

0k-----------0k-----------1.60--------Volt
5k-----------0k-----------3.30
10k----------0k-----------5.00

0k-----------5k-----------1.19
5k-----------5k-----------2.46
10k----------5k----------3.73

0k-----------10k----------0.95
5k-----------10k----------1.96
10k----------10k----------2.98

The formula is:-

v = 5(x + 4.7)/(y + 14.7)

where x = lower side of the VR-X pot and y = the value of R604
 
djpubba said:
Ron H said:
Here is a circuit that provides a current proportional to the control pot setting.

Am I supposed to connect +5 to the spot between R6 and R7?

Yes. This circuit provides a constant current into the computer. When I say constant, I mean constant for a particular pot setting.

The problem you may find with this is that the range of voltage from the VR pots may not be wide enough. If so, then some gain and level shifting may be required as suggested by Nigel.

However, it may not be necessary to use an op amp. A simple transistor amp may be sufficient. If you have problems, measure the voltage at the base of Q1 for both extremes of the pot and tell us whether the problem is not enough "right or left"
 
Cool, thanks, that's what I did.

First I tried Len's circuit, connecting 1k pots to both sides of the LED to try adjusting the current into the range I needed. I think it's safe to say this isn't working well. It's way too non-linear and if I get one side right, the other is way off.

So I wired up Ron's circuit. This works much better but still needs a bit of tweaking.

I'm using a small DOS program on the PC called JCENTER for testing and centering of the joystick. it gives a range of values for X and Y from 000 to 999. 500 is center. With Ron's circuit, if I adjust R1 so that I'm at 500 for center, then I can only get down to 290 or so by moving the R2 to the far right, but when I move it far left, it goes past 999 twice (so, like 3000+).
 
djpubba said:
First I tried Len's circuit, connecting 1k pots to both sides of the LED to try adjusting the current into the range I needed. I think it's safe to say this isn't working well. It's way too non-linear and if I get one side right, the other is way off. Forget this option.

So I wired up Ron's circuit. This works much better but still needs a bit of tweaking.

I'm using a small DOS program on the PC called JCENTER for testing and centering of the joystick. it gives a range of values for X and Y from 000 to 999. 500 is center. With Ron's circuit, if I adjust R1 so that I'm at 500 for center, then I can only get down to 290 or so by moving the R2 to the far right, but when I move it far left, it goes past 999 twice (so, like 3000+).
It would help me to do the calculations if you measured the voltages at the base of Q1. when the screen is at 500 and again when it is at 290 and 999.

Also, when the pot is at the centre, disconnect the computer and measure the current coming out of Q2 ie. connect your multimeter between the collector and 0V.

Then re-connect the computer, set the screen to 290, then disconnect and measure the current again. repeat for 999.
 
If the 100k pot that we are replacing actually connects to a 555 timer, then it has to have a series limiting resistor. Since I don't know the value of this resistor, I don't know how to design the circuit to have the same characteristics as the 100k pot.
Djpubba, is it too much to hope that you have access to an oscilloscope? If we could measure the frequencies on the 100k pot at its limits, things would be much simpler.
 
If it's a standard PC gameport, which I have no reason to believe that it wouldn't be, this document describes how the 100k pot is connected to the 555 timer:

https://pinouts.ru/data/GameportPC_pinout.shtml

(it says it's a 2.2k resistor).

I do have an oscilloscope but I don't know how to use it very well. My volt meter also has a frequency counter, but it's range is pretty limited. I'll see if the frequencies are within it's range on a 100k pot connected to the gameport. Should I be measuring from +5 to the X input or from ground to the X input? I suppose I'll soon find out.

I'll soon have the measurements Len is asking for as well.
 
With a 100k pot connected to the gameport, the only place I get a reading is with the negative lead on the X input and the positive on the +5 pin. Here's what I measured.

Ohms -- Freq -- Screen
0.6k -- NR -- 020
52k -- .496 kHz -- 500
100k -- .472 kHz -- 965

Since I got no reading at the lowest setting on the pot, I put 10k on the pot and measured. I got:

Ohms -- Freq -- Screen
10k -- .518 kHz -- 113

Measurements for Len coming next.
 
ljcox said:
It would help me to do the calculations if you measured the voltages at the base of Q1. when the screen is at 500 +2.609v and again when it is at 290 +4.06v and 999 +1.578v.

Also, when the pot is at the centre, disconnect the computer and measure the current coming out of Q2 ie. connect your multimeter between the collector and 0V. 61.4 µA

Then re-connect the computer, set the screen to 290, then disconnect and measure the current again107.0 µA. repeat for 999.I can't easily take this measurement because there's a spring on the pot and I can't hold it at 999 and then disconnect it from the comptuer without it moving. However, pushing it as far left as it will go, I get 8.3 µA. This is not the same spot that I measured 1.578v above, though. When I measured that, it was easy to hold it at 999 and look at the volt meter. If it's really critical that I get that measurement, I'll rig something up to make it easier.
 
Using your figures, I deduce that the R1 + 10k is about 32.5 k, ie. the pot alone is about 22.5 k.

So at 999, you should read about 30 uA.

Ron said to set the R1 pot for the maximum current, but you said that you set it for the centre.

So I suggest you set R2 at the 000 end and adjust R1 for 000 on the screen. Then repeat the voltage & current measurements for 000, 500 and 999. (assuming that you can make it reach 000)

Then turn the power off and measure the resistance of R1. (I forgot to ask you to do this last time.

Once we have those figures, we should be able to advise you how to restrict the range to what you want.
 
djpubba said:
If it's a standard PC gameport, which I have no reason to believe that it wouldn't be, this document describes how the 100k pot is connected to the 555 timer:

https://pinouts.ru/data/GameportPC_pinout.shtml

(it says it's a 2.2k resistor). I had a quick look at this site. I bekeive that the 22. k is inside the computer and acts as a minimum resistance. It also gives some protection to the computer electronics against over voltage.
 
ljcox said:
Then repeat the voltage & current measurements for 000 I can only get it down to 90, which is probably good enough) 4.06v / 347 µA 500 1.17v / 61.4 µA and 999 0.85v / 31.2 µA.

Then turn the power off and measure the resistance of R1. 157 ohm (as low as it will go)
 
I suggest that you make R5 4.7 k.

Then adjust R1 so the screen is at 000 (with R2 set where you want it for 000) and repeat the measurements.
 
I Suggest that you add resistor R8 and pot R9 as shown.

Set R9 initially to its max resistance, you decide whether you want it be max clockwise or anticlockwise.

Set R2 for max left and adjust R5 for 000.

Set R2 for max right and adjust R9 for 999.

I assume that you want the screen at 500 when R2 is in the centre. If so, then set R2 at the centre, and if the screen is < 500, then adjust R9, otherwise adjust R5.

These adjustments will interact with each other a little so the adjustment procedure will be iterative.
 

Attachments

  • gameboy.gif
    gameboy.gif
    44.6 KB · Views: 401
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top