0
\$\begingroup\$

I have an input signal like this.

enter image description here

I wish to display the highest voltage for a period of time with LED. So I need to retain the highest voltage until the next new highest voltage comes. I tried D flip flop, but being a digital component, it makes everything 0 or 1. But in my (analog) case, say, the 1st highest voltage is 5V, the next could be 7V, and I need to preserve the values! In addition, if the next peak is 4V (<5V), I need to latch 4V.

So what is the simplest possible analog way of latching the highest voltage until a new peak (possible lower or higher) comes?

\$\endgroup\$
3
  • \$\begingroup\$ Do you mean a single indicator LED, or an LED numeric display of voltage? \$\endgroup\$ Oct 16, 2014 at 5:50
  • \$\begingroup\$ @SpehroPefhany Well, in between, I would say. It is a LED array actually. So a binary digital D flip flip will not work. I do have some levels. I could use 3 LED to indicate 3 levels, etc.. \$\endgroup\$ Oct 16, 2014 at 6:41
  • \$\begingroup\$ Let's say you have a 5 volt peak occur, and then the next peak is at 4.9 volts. What do you want to see displayed when each peak occurs? Please be specific. \$\endgroup\$
    – EM Fields
    Oct 16, 2014 at 13:43

4 Answers 4

5
\$\begingroup\$

I think, the type of a circuit that you are looking for is called peak detector.

The simplest peak detector consists of a diode and a capacitor. The diode prevents the capacitor from discharging, so it retains the max voltage less the diode drop. The diode drop is a shortcoming of a simple circuit like this. It doesn't "see" voltages that are less than the diode drop.
enter image description here
(That page where this snippet came from is worth skimming through.)

An OpAmp peak detector is more precise. It compensates for the diode voltage drop. enter image description here
( source )

There is a fair amount of information about peak detectors: EEVblog video, Planet Analog article.

\$\endgroup\$
2
4
\$\begingroup\$

Another way of handling this is to use a simple microcontroller, and feed the input signal into its ADC (analog to digital converter). You will need to use a voltage divider to divide the maximum input of of 8v to fit the maximum voltage of the ADC.

With this arrangement you can easily determine the peaks in firmware. With the other schemes using the capacitor, there is no method shown to discharge the capacitor in order to measure the next peak (your example of 7v -> 5v -> 4v). With firmware, this is trivial.

Another advantage of using a microcontroller is the low parts count -- just the microcontroller, a decoupling capacitor, and a pull-up resistor on the reset line.

One microcontroller to consider is the PIC16F1786 which has a 11 channel, 12 bit ADC. It is available in a 28-pin DIP package from Digi-Key for $2.54. It has an internal oscillator so no external crystal is needed.

Here is a suggested circuit:

enter image description here

You could use three of the microcontroller's outputs (or any number, e.g. 8 if you want) to directly drive a bank of LED's without any additional circuitry (except for the LED resistors), since the I/O pins can source or sink 25 mA.

It has an internal 4.096v reference, so dividing the 8v input signal in half is ideal. The combination of a 4.096v reference and 12-bit ADC means each count corresponds to exactly 1 mV.

The program (in C) would be quite simple, probably not even a full page of code.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks a lot for the enlightening, but in this particular project micro controllers are not available. :) \$\endgroup\$ Oct 17, 2014 at 16:41
3
\$\begingroup\$

One sort of hybrid analog-digital way would be to have a series of comparators fed from the input signal and a resistor ladder (a DIY flash ADC converter) and some SR flip-flops to hold the states. For example:

schematic

simulate this circuit – Schematic created using CircuitLab

The LM339s have open-collector outputs which allows for easy level shifting down to 5V with just the pullup resistor. When any comparator output goes low the latch is set and the /Q output goes low, turning the respective LED on.

The D inputs should be grounded. You can either ground the clock inputs or use the clock inputs as an edge-sensitive reset input (rather than the level-sensitive reset as shown).

You can expand this to more outputs as required, though at some point (even though you specified an analog approach) you should consider just doing all this in a micro which would be a rather simpler approach (only one IC package and perhaps half a dozen resistors for many LEDs). You would have to write a bit of code though (it's a pretty easy starter project for a micro, so I'd recommend that approach if you're so inclined).

\$\endgroup\$
1
\$\begingroup\$

If its a fairly periodic signal, you should be able to use a an inverter circuit that feeds into a peak detector circuit using op-amps.

In fact, googling for "inverting peak detector" yielded this picture: Trough detector

\$\endgroup\$
1
  • \$\begingroup\$ Also, I wouldn't feed W1 directly into your LED. I would use it to feed a high-input impedance amplifier and then into the LED. \$\endgroup\$
    – SDGator
    Oct 16, 2014 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.