# Using a trimmer pot to output a percentage of voltage

I am trying to do a project where I am getting two (or more) voltages and averaging them all out. Then I would like to use a trimmer pot to adjust the voltage by a percentage, basically as a fine-tuning calibrator.

The elements I am using are 2 or more humidity sensors, They take a voltage in (5.5v) and give a voltage out (a percentage dependent on the humidity). I will average those voltages out and want to have a relay switch when the voltage reaches a certain number.

I am new to this, so I assume if I get a 5v DC relay (OUAZ-SS-105D) I will need 5 volts to switch the relay over. The humidity sensors will only output around 3-4 volts averaged. I would like the relay to switch over when the average voltage output from the humidity sensors reaches 4.125v.

How should I approach this? Does this make sense? or did I totally confuse you?

• Why not use it as a voltage divider? Commented Jun 6, 2014 at 21:44
• Use a comparator. Try googling it - you set a voltage on the reference pin and the output switches state when the other pin reaches this voltage. Commented Jun 6, 2014 at 21:51
• @IgnacioVazquez-Abrams How do I use the pot as a voltage divider? Is it naturally one? or do I need to add some other components? I will check the comparator, though I would still like some fine-tune aspect Commented Jun 6, 2014 at 22:17
• A pot is a voltage divider - connect your signal to one end of the pot, the other end to ground, and the wiper of the pot will give a percentage of the signal voltage, depending on the pot's position. For your application I would probalby connect your signal to one input of the comparator, and the pot to the other, with the pot connected between +5 and ground - adjusting the pot will then adjust the trip point of the comparator. You might want to put a resistor between the pot and ground to adjust the usable range of the pot. Commented Jun 6, 2014 at 22:25
• @PeterBennett Great information! Thank you! I'm excited to get home and try this out now. If you add that as an answer, I would be happy to accept and vote that up! Commented Jun 6, 2014 at 22:31

I took the liberty of fleshing out @PeterBennett's idea a bit here. I've used half an LM358 dual op-amp as a comparator. The R1, R2, R3 provide a voltage of half the average of the two inputs, which keeps the input voltage within the common-mode limits of the LM358.

R4 provides some hysteresis- if you have chattering, reduce it somewhat.

simulate this circuit – Schematic created using CircuitLab

• That's much better. Commented Jun 7, 2014 at 4:06
• It looks like I have a lot to learn. I am going to take this into consideration and try to find all of the appropriate parts. I would like to check this as answered, though it will take me a bit of time to get it going. Thank you @Spehro! Commented Jun 7, 2014 at 5:46
• So, I was doing some more testing and looking at the humidity datasheets and it seems I need to get them to 2.9v. After reading through - it shows the sensors have a range from .75-3.75 output voltage. I did some testing with them and I show that they are calibrated perfectly at 5v in. Now, I need the comparator to switch at 2.9v. Which set of resistors would I have to change in order for this to work? Commented Jun 7, 2014 at 5:55
• Nevermind! I can read it now! I didn't notice the R6 is a pot trimmer. So I can set the R6 vOut to ~2.9, once the sensors' average reaches above that, switch the comparator. (Edit button didn't work on the last comment) Commented Jun 7, 2014 at 6:19
• You would set it to about 1.45V since the average is halved. That's right at the lower limit of the pot, so better to make R7 1K and R8 3K, than middle of the pot rotation is 1.5V. Commented Jun 7, 2014 at 12:05

A pot is a voltage divider - connect your signal to one end of the pot, the other end to ground, and the wiper of the pot will give a percentage of the signal voltage, depending on the pot's position. For your application I would probalby connect your signal to one input of the comparator, and the pot to the other, with the pot connected between +5 and ground - adjusting the pot will then adjust the trip point of the comparator. You might want to put a resistor between the pot and ground to adjust the usable range of the pot.

simulate this circuit – Schematic created using CircuitLab

• This will not work for various reasons 1) a TL081 is not rated for single 5 volt operation 2) it's output will not pull to ground 3) its' inputs are not guaranteed to work properly at this voltage 4) for a slow-moving signal like relative humidity, hysteresis is a must 5) the relay needs a flyback diode or the switching transients will kill the comparator. Use a real comparator rated for 5 volt operation, with rail-to-rail inputs (since the switching point is 4.125 volts. Commented Jun 6, 2014 at 23:00
• @WhatRoughBeast: I wasn't thinking too hard when I drew that - I usually rant at people who use op-amps as comparators! Yes, that should definitely be a single-supply comparator, like an LM311, and hysteresis is a definite requirement - but it does give the OP something to play with. Commented Jun 6, 2014 at 23:25