Detect increasing or decreasing pot output

In summary: V =high outputdecreasing or stable V =low outputwill this circuit work , how do i improve itAn opamp comparator circuit can be used to achieve this.
  • #1
hackhard
183
15
I want to detect whether potentiometer output voltage is increasing or decreasing and convert this to a digital signal.
the circuit must be able to sense tiny voltage changes (order of 10mV) and with high speed.
all I am interested is if Vout increases or decreases not by how much
increasing V =high output
decreasing or stable V =low output
how can i achieve this?
 
Engineering news on Phys.org
  • #2
Easiest is convert the incoming voltage signal to digital as first operation . Then use some simple software to compare latest sample with previous sample . Usually best to do comparison using values averaged over several sequential samples rather than just spot values .

Any of the low cost single board computers available now with on board ADC could be used to do this .

Just for interest this was done in older times using an analog drift comparator . Using only op amps and RLC circuitry the short term average value of the test signal was compared with the rolling longer term average .
 
Last edited:
  • #3
Nidum said:
Any of the low cost single board computers available now with on board ADC could be used to do this .
is there any alternative to adc, i don't want to use a microcontroller.
will a data slicer opamp circuit do the job ?
 
Last edited:
  • #4
will this circuit work , how do i improve it

ads.png
 
Last edited:
  • #5
hackhard said:
will this circuit work , how do i improve it

ads.png
You should be using feedback in pretty much any opamp circuit. Look up "opamp differentiator" to find what you are looking for... :smile:
 
  • #6
Your example circuit will oscillate and amplify any supply noise.

A differentiator circuit will detect the slew rate of the voltage from the pot. It will not detect slow changes of absolute voltage.
You need to use a window detector. https://en.wikipedia.org/wiki/Window_detector
The LM339 is a comparator with a positive internal feedback of a few mV.
It also has open collector outputs that can perform a negative-logic wired-OR function.

Window_1.png
 
  • #7
hackhard said:
will this circuit work , how do i improve it

ads.png

well, for a start, the DC voltage from the pot isn't going to go through C1

you said you wanted a digital signal ... that isn't going to produce it
You need an ADC chip followed by a microprocessor to work on that data or use a PIC or micro of your choice that has an ADC built inD
 
  • #8
My previous post assumed you wanted to detect any change. "detect increasing or decreasing pot output".
This circuit only detects a rising voltage.
hackhard said:
increasing V =high output
decreasing or stable V =low output
how can i achieve this?
If you must do it with analogue then you must also specify how you will signal that the voltage is stable. In this circuit you press a momentary switch to load the input set voltage into C1.
How the circuit works.
If not yet buffered, this circuit uses op-amp U1 to buffer the potentiometer output voltage.
Q1 and R1 with the +5V supply makes a current sink of about 440uA. The 440uA flows through resistor R2=47R and so drops about 20mV from the buffered input voltage.
That slightly lower input voltage is compared with the set voltage. If the input rises by more than 20mV then the comparator U2 output goes high. U2 must have very low input bias current so it needs to be a CMOS or JFET input comparator or possibly an op-amp.
Changing the value of R2 will set the rise above the set voltage before detection. R2 can also be adjusted to compensate for the offset voltage of U2. Maybe R2 should be a 200 ohm trimpot.

window_2.png
 
  • #9
Below is the LTspice simulation of my take on a circuit.
It uses an opamp differentiator circuit to convert the slope change into about a 1V step signal to minimize offset effects. This goes to an opamp comparator circuit to give the desired positive pulse output for a positive slope on the input, and zero volts otherwise.
upload_2016_12_5_14_57_45.png
 
  • #10
Baluncore said:
Your example circuit will oscillate and amplify any supply noise.

A differentiator circuit will detect the slew rate of the voltage from the pot. It will not detect slow changes of absolute voltage.
You need to use a window detector. https://en.wikipedia.org/wiki/Window_detector
The LM339 is a comparator with a positive internal feedback of a few mV.
It also has open collector outputs that can perform a negative-logic wired-OR function.

View attachment 109981
That circuit won't detect the polarity of the voltage change.
 
  • #11
hackhard said:
That circuit won't detect the polarity of the voltage change.
True, my first circuit actually detects both polarities of change, then ORs them together. If you separate the outputs you get two independent outputs, one for a rise, the other for a fall.

You wanted to detect a tiny step change as small as 10mV but you have not specified what positive slew rate you want to detect. Is it +10mV/second?
 
  • #12
Baluncore said:
You wanted to detect a tiny step change as small as 10mV but you have not specified what positive slew rate you want to detect. Is it +10mV/second?
positive slew rate is +10mV/0.1s = +100mV/s
 
  • #13
It would help us a lot if you would post what the heck you are trying to do. In engineering, we start with specifications on the circuit performance. You are making us guess what you want to do, which is not a good thing. I will close this thread until you PM me what your goal is and what your circuit specifications are. I will re-open the thread then so you can post that for others to be able to help you better.
 
  • #14
After a PM conversation, the thread is re-opened. The OP will post more information to help us help him with this project... :smile:
 
  • #15
project details --
pot rotating clockwise (from any initial angular position)=high output
pot rotating anti clockwise (from any initial angular position)=low output
pot not rotating (stable at any angular position)=low output
 
  • #16
my rotatory pot has stops
 
  • #17
So talk about using an opamp differentiator circuit followed by some other circuitry. What would that look like, and how would you design it to reject noise and have the desired logic level output?
 
  • #18
hackhard said:
increasing V =high output
decreasing or stable V =low output
hackhard said:
pot rotating clockwise (from any initial angular position)=high output
pot rotating anti clockwise (from any initial angular position)=low output
pot not rotating (stable at any angular position)=low output

I have three specific questions.
What sense of rotation increases the pot output voltage ?
Do you want to detect the positive or the negative voltage changes from the pot ?
Does the detected situation produce a high or low voltage output from the circuit ?
 
  • #19
resistance of pot is 50k
that will require the addition of a buffer at the pot output to handle the maximum equivalent pot output impedance of 12.5k.
The modified circuit is shown below:
The added buffer at the pot output is configured as an inverter since the LM324 has a maximum output of about 9V when used as a non-inverting buffer and a 10V supply.can i use lm358 in place of lm324?

upload_2016_12_6_21_11_45.png
 
  • #20
Baluncore said:
What sense of rotation increases the pot output voltage ?
Do you want to detect the positive or the negative voltage changes from the pot ?
Does the detected situation produce a high or low voltage output from the circuit ?
pot rotating clockwise (from any initial angular position)=increasing voltage = high output
pot rotating anti clockwise (from any initial angular position)=decreasing voltage=low output
pot not rotating (stable at any angular position)=stable voltage=low output
i want to detect the positive voltage changes from the pot
detected situation produce a high voltage output from the circuit
 
  • #21
Attached is an LTspice model. Strip the .txt extension to run the simulation.

To make model plots easier I redefined power supplies (0V,+5V,+10V) to (-5V,0V,+5V).
Use any op-amp you have. Op-amp inputs are close to mid-supply.
You could even use comparators in place of the op-amps.

A "Threshold" of about 10mV is set by R2 with the 200 ohm trim-pot, R3.
Mid-position is about 10mV.
The offset voltages of U1 and U2 are also eliminated from the threshold value by the setting of R3.

Slow changes in pot voltage are followed in C1.
When stable, the voltage at bottom of C1 = "tracking", will be close to the "threshold" voltage.
Slew rate of "tracking" is limited by 5V/R1 = 50uA, with C1 = 500uF, it sets 100 mV/sec.

C2 and R4 quieten the U1 op-amp output when pot voltage is stable.
Otherwise U1 produces a +/-5V signal while following a changing pot voltage.
C2 and R4 are not needed if a comparator is used for U1.

Any positive pot voltage step over 10mV will be immediately detected by U2 going high.

Any pot slew rate rising faster than +100 mV/sec will outrun "tracking".
Once that "tracking" error has accumulated to greater than 10mV, the output of U2 will go high.
Note that for slowly rising voltages, eg for +120mV per sec, it will take 0.5 sec before detection.

50uA will flow in C1. It needs a simple non-inverting follower or buffer from the pot to C1.
Since the input voltage might be close to +5V, a rail-to-rail op-amp is probably needed for the buffer.
 

Attachments

  • window_4.png
    window_4.png
    45.4 KB · Views: 496
  • window_4.asc.txt
    2.4 KB · Views: 322
  • window_4.plt.txt
    382 bytes · Views: 304
  • #22
I start thinking digitally...

I would use a sample-and-hold (to save the "previous" value) and then (using a comparator) compare it with with the "present" value.
 
  • #23
Svein said:
I would use a sample-and-hold (to save the "previous" value) and then (using a comparator) compare it with with the "present" value.
I use a “hold” that is slew rate limited to follow at a maximum of 100mV/sec, then I compare that with the “present” value.

Where would your digital sample signal come from? and how often?
 
  • #24
Baluncore said:
I use a “hold” that is slew rate limited to follow at a maximum of 100mV/sec, then I compare that with the “present” value. Where would your digital sample signal come from? and how often?
That is in the realm of digital design. It is not hard.

On the other hand, here is a circuit that I have used in the past:
upload_2016-12-9_10-28-1.png

The R1-C1 combination is a noise filter, the R2-C2 combination acts as a time delay circuit. The values given are just examples, modify them at will.
 

Attachments

  • upload_2016-12-9_10-27-0.png
    upload_2016-12-9_10-27-0.png
    6.8 KB · Views: 518
  • #25
Svein said:
On the other hand, here is a circuit that I have used in the past:
For a stable input signal, would the output be high, low or would it drift ?
How could you calibrate it to only detect positive slew rates over +100mV/sec ?
 
  • #26
Baluncore said:
For a stable input signal, would the output be high, low or would it drift ?
How could you calibrate it to only detect positive slew rates over +100mV/sec ?
  • My schematic was just a sketch - of course there must be some adjustments, one of them being an adjustable offset to avoid problems with a stable input signal.
  • As to only detecting positive slew rates over +100mV/s, that is the purpose of R2-C2. If C2≈0, the comparator will never detect anything, if C2 is too large, it will detect all positive changes.
As usual, a formal specification would help nailing down the actual solution. Since I have been in digital design for about 40years, I have a tendency to think digitally, and the circuit I presented above is an analog counterpart to a classic "edge-detector" we use to create using a Schmitt-trigger and a two-input NAND.

If the detector needs to be very precise, I would use an A-D converter and a microcontroller. Then I could look at two successive samples and decide what action to take.
 

1. What is "pot output"?

Pot output refers to the amount of a substance, typically a drug or medication, that is produced or released by a plant or other source.

2. How can we detect if pot output is increasing or decreasing?

The most common way to detect changes in pot output is through regular monitoring and analysis of the plant's growth and yield. This can include measuring the size and weight of the plant, as well as the amount and potency of the substance it produces.

3. What factors can influence pot output?

Pot output can be affected by a variety of factors, including environmental conditions, such as temperature and humidity, as well as the quality of soil or nutrients available to the plant. Genetics and cultivation techniques can also play a role in determining pot output.

4. Why is it important to monitor pot output?

Monitoring pot output can provide valuable information about the health and productivity of a plant, and can help growers make necessary adjustments to optimize output. It can also help ensure consistency in the quality and potency of the substance being produced.

5. Are there any tools or techniques that can help with detecting changes in pot output?

Yes, there are various tools and techniques available to help with monitoring and detecting changes in pot output. These can include advanced sensors, data analysis software, and genetic testing. Consulting with experts in the field can also provide valuable insights and guidance.

Similar threads

  • Electrical Engineering
Replies
3
Views
1K
Replies
8
Views
994
  • Electrical Engineering
Replies
7
Views
6K
  • Electrical Engineering
Replies
10
Views
4K
Replies
6
Views
1K
Replies
12
Views
2K
  • Electrical Engineering
Replies
6
Views
2K
Replies
21
Views
2K
Replies
7
Views
3K
  • Electrical Engineering
4
Replies
138
Views
22K
Back
Top