# How to get a variable voltage from a variable resistor

Up front, I need to declare my ignorance of electronics. I'm first and foremost a scientist/programmer, but I'm constructing a device that will allow me to control voltage to an I/O board using hand movements. I may well use the incorrect terms in this post!

I'm constructing a device that will allow me to control voltage to an I/O board using hand movements. I'm trying to get (what I think is) a variable resistor to deliver between 0 and 5 volts (or thereabouts), which will be fed into the analog channel of an I/O board (specifically, a Velleman VM110N).

I can generate a voltage using a Thurlby PL320.

The variable resistor looks like this:

And this is the Velleman I/O board that I ultimately will be sending the voltage into:

I haven't yet gotten as far as delivering the voltage to the I/O board, as I want to make sure I've got the right voltage coming out of the resistor. As a complete novice, what I can't work out is what I need to do to get the position of the slider on the resistor to affect the output voltage. There are four terminals on the resistor: on one side, I have a black and a red, and on the other side, I have a black and a green-yellow (I am at least savvy enough to recognise that this is the earth terminal).

I've put a multimeter into the circuit, and turned the dial to 'DCV 20', which displays 5.00 volts (which is close to what I've set to be generated by the Thurlby PL320 unit - I'm assuming it's a little old and doesn't deliver quite what it says it will, but it seems to be consistently a little higher than it should be). However, adjusting the slider on the resistor doesn't seem to affect the voltage at all. From my very limited knowledge, I'm sure that adjusting resistance ought to affect the voltage (volts = amps * resistance). So, I suspect I'm either delivering the wrong voltage in the first place, or I've got the wires in the wrong terminals. Here's what I'm delivering from the Thurlby unit:

And, I've pretty much tried every combination of plugging the wires into the resistor, which either results in nothing or 5 volts, which doesn't change when I shift the slider.

Edit: @SomeHardwareGuy has helped me to understand that what I have is a linear potentiometer; not a variable resistor. Of the four ports on the device, I can plug one end of a multimeter into the (only) red port, and I can plug the other end into either of the black ports - there is a black one on each side of the device. Using the instructions given by @WhatRoughBeast below, I have found a way to wire the system up and produce a different behaviour... Now, when I adjust the slider, the voltage displayed on the Thurlby goes from zero to 1.15, but this behaviour is abolished if I flick the switch at the bottom right of the Thurlby to 'on'. I'm guessing this is switching to AC. However, even though I seem to be able to change the value on the input device, I still can't get the voltage reading in the multimeter to change...

• Just a friendly advice: Team up/hire someone who knows something about electronics. Before unrecoverable damage inflicted. At least for the hardware setup. Commented Mar 25, 2015 at 18:34
• What is written on the type plate that is shown in the picture with the resistor? Any port at the other end of the resistor? Commented Mar 25, 2015 at 18:55
• Also the resistor case might be open at the bottom, do have a picture from its internals? Commented Mar 25, 2015 at 18:59
• You need to clean the lens of your camera. From these pictures, it seems there is something smeared on it, like grease, skin oils, sunscreen, etc. Commented Mar 25, 2015 at 19:30
• Oh my, that's an impressively large Stellweg you've got there. =) sorry, I couldn't resist Commented Mar 25, 2015 at 21:33

That is a crazy large resistor :). Does it only have two ports to connect wires to? If so you likely need another fixed resistor in series with it. That will make a voltage divider and you will be able to measure the difference where they meet. You won't be able to get all the way up to your power voltage but it should work.

Try measuring the resistance across the two ports as you move the slider too.

------ Edit below: Trying to explain more

Alright let me try to explain more, most of the answers are trying to explain the same thing but maybe this will help. To recap, you have a 5V source, and you want to vary that 5V source with a resistor. So how do you vary a 5V source with a resistor in general? You use what is called a voltage divider. That is how you start at 5V and get less than five.

The formula for a simple voltage divider is Vout = Vin * R2/(R1+R2)

In the circuit below you can see that if you measure the voltage between the two resistors it will be 1/2 the voltage of Vin.

simulate this circuit – Schematic created using CircuitLab

Now if you were to vary one of those resistors your voltage would go up and down because you would be changing the ratio R2/(R1+R2). I hope that makes sense if not I'll try to explain more.

Now normally if you buy a potentiometer it will have three ports like whatroughbeast's answer is showing. The wiper, the arrow in his diagram, represents the 2.5V point in my circuit above. This is why everyone is asking you how many ports there are, because they're trying to explain how a potentiometer works for you. It is not uncommon for new people to have trouble understanding them because they think a variable resistor is just two ports. This wiper is what you are moving with your hand

Now ideally this part would be a pot (potentiometer), maybe it's not, but it's worth your while to try and see if it is. You say you've found two ports where you can vary your resistance. That's great try and measure between all the other combinations and see if there is another one that also lets you vary resistance. If there is it will make it very easy for you to vary your voltage like you want.

If however you cannot find one, perhaps this is not a pot, or perhaps it is a broken and only one side still works. If that's the case and all you really have is a variable resistor then you will need to build a voltage divider like one pictured above. Placing your resistor as R2, and using a fixed resistor for R1.

This is not as nice as having a pot there, for one the size of R1 will determine how much worst case current your supply must supply, as well as how much power R1 will dissipate. It will also put a cap on how close to 5V you can get. This may not matter to you if you just need any variable voltage, which it sounds like may be true.

Hope this helps feel free to ask questions.

----- Edit #2 Ok looks like you have a POT, if so you want to hook it up like this below. It sounds like maybe you have it hooked up with the wiper and one end of the resistor to your supply so maybe the voltage is changing as you draw more current than it can handle. That would cause your voltage to sag.

simulate this circuit

• maybe measure port to case as well Commented Mar 25, 2015 at 18:53
• There are four ports - see description in question. Resistance is variable between red/black on one side of the resistor. But... I still can't get voltage to vary! Commented Mar 26, 2015 at 9:49
• Don't take this the wrong way, do you know what a voltage divider is? Commented Mar 26, 2015 at 14:54
• I do not. My post previously mentioned that I have no experience with electronics, and someone has been along and tidied up all of that. The answers I initially got here were very helpful, but since that edit was made to my question, it's been impossible to understand the advice I'm getting. Commented Mar 26, 2015 at 14:55
• @CaptainProg check out the edits I made in my answer, then feel free to ask me questions Commented Mar 26, 2015 at 15:35

Start by figuring out exactly what you have for a resistor. I see that you have a multimeter. Disconnect the resistor from everything else. Now connect the meter to the red and black sockets. Measure the resistance. Vary the slider position. Does the resistance change? (Probably not). Assuming it doesn't, connect the meter to the white and black sockets. Now see if the resistance varies as you change the slider position (it probably does).

Assuming that red/black has constant resistance, and white/black varies, your resistor looks like

simulate this circuit – Schematic created using CircuitLab

If this is so, connect the + output of your supply to the red socket, the - output to the black socket, and get the variable voltage between the black and white sockets.

Also, remember the red/black resistance you found? That will affect how much current the supply will have to provide. If the resistance is 5 ohms, 5 volts across the resistor will require 1 amp. Your Thurby can only provide 2 amps, so if your resistor is less than 2.5 ohms you're out of luck.

You may be getting a low voltage if your "Current" knob is not turned all the way clockwise. See if that makes a difference. At any rate, always trust your meter rather than the power supply meters.

• Thanks - I get variable resistance by connecting the multimeter to the red and black terminals (there is a second black terminal on the other side of the resistor, along with a ground terminal, but I'm talking about the red/black on the same side). So, this changes the resistance from zero up to 557 ohms. Is this too heavyweight when all I'm looking for is up to 5V output? (The I/O board can only take 5V). It's not so much that I need a large resistor, but I need large hand movements to operate it - I'm trying to measure hand movements over a large range. Commented Mar 26, 2015 at 9:44
• 557 ohms is fine - that's not particularly large in ohms, despite the physical size. You can certainly get 5V out of that. This schematic doesn't match your resistor, though. Commented Mar 26, 2015 at 12:34
• @CaptainProg - OK. Is there any pair of terminals that produces a constant 557 ohms regardless of slider position? Commented Mar 26, 2015 at 21:19
• Yes - if I plug into both of the black terminals (ie one black on each end), I get constant 557 ohms. Commented Mar 27, 2015 at 11:54
• Excellent. Now set the slider to zero, and find the black terminal that has zero ohms to red. Call this B1, and the other black is B2. Connect B1 to ground, and B2 to +5, and take the red terminal as variable. You can measure this with your meter (with the meter ground on B1, and the positive input on red). Then connect the B1/ground to analog ground of your Velleman, and the red to your analog input. Commented Mar 27, 2015 at 17:07

We were all noobs at one time. Here's the basic circuit you need.

For the job it needs to do that variable resistor in your picture looks way too big (physically). It probably has a very low ohm value and will eat power. The fact its in a perforated metal box is a clue that it gives out a lot of heat. Look for something in the 1000 ohm (1k0) to 100 000 ohm (100k) range.

• Thanks. I'd like to use this resistor if at all possible (by modifying the input perhaps?) I need to be able to measure large hand movements. Resistance ranges from 0 to 557 ohms. If this is way too large, then I'll look for something smaller, and have another device measure the hand movements! Commented Mar 26, 2015 at 9:50
• @CaptainProg at 557 ohms you'll get away with it. This would give a current through the resistor of 5/557 i.e. about 9mA which is fine. Commented Mar 26, 2015 at 17:57

It looks like there is a white jack at the top of the resistor end panel - that may be the connection to the moving contact. Put the slider midway, and measure the resistance between all combinations of the terminals. The readings should allow you to determine which terminals are the ends of the resistor, and which is the sliding contact.

• Thanks. It's red/black on one side (which I'll call side 1), and ground/black on side 2. Connecting the red/black of side 1 to a multimeter allows me to measure between 0 and 557 ohms with the multimeter. Even with all these combinations, I can't get a variable voltage out. The end voltage needs to vary from 0 to 5V. I have a lot of options for the input on the Thurlby PL320 unit, so perhaps I need to change the input..? Commented Mar 26, 2015 at 9:47

Just put your potentiometer where is the R2. I've already made a circuit with this component and it worked fine. Just be careful with the high losses of this IC. If you are planning to have a high voltage drop or a high current drawn you must use a heat sink.