# Volume Control

## Recommended Posts

Hi, Completely new to the LABJACK but I am hoping it will suit my requirements. I would like to connect two rotary volume controls to the labjack and use the output to control volume and other device levels within a program. Could anyone please point me in the right direction to how I may go about this, i.e. the wiring mainly. I have a labjack U3 which I would of thought was suitable for the purpose, however I just need a point in the right direction.

##### Share on other sites

We need more information about your controls. Do you have a link to a datasheet or other specs? The basic question is whether they provide an encoder output or potentiometer type output, and then for either type we would need a couple more specifics.

##### Share on other sites

What you have there is a potentiometer. Two of the leads are on each end of a resistance, while the third lead is a wiper that moves to a different location on the resistor as you turn the knob. If you apply a constant voltage across the entire resistor, the voltage output on the wiper lead will vary. See the beginning of Section 2.6.3.6 of the U3 User's Guide which describes a voltage divider. A voltage divider is a common way to measure resistance.

Since the max recommened source impedance for the U3 analog inputs is 10k, you can use the linear 10k pot. Looking at the voltage divider, you know that for your pot R1+R2=10k, so the voltage divider equation simplifies to Vout=Vin*R2/10k. That means that if you apply a constant Vin across the pot, then by measuring Vout from the wiper lead you can calculate R2. Since the pot is linear, you know that if R2 is 2k, for example, then the pot is at 20% of it's 300 degree range.

For the constant voltage you provide to the pot, you could use VS (~5 volts) from the U3, but a more accurate and stable voltage would be from DAC0 or REF/DAC1. When DAC1 is disabled (which is the factory power-up default), the REF/DAC1 pin on the U3 outputs a constant voltage of about 1.5 times the internal reference. You can connect this across your pot, and then measure the actual value to use in your equation. Note you will have to use the "special 0-3.6" analog input range to measure the full voltage range you will get from the pot, so that means you use a differential analog input where the negative channel is 32.