Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LED stay on once active

Status
Not open for further replies.

Jimbop

New Member
I guess this is a simple question but I haven't done this stuff since high school and have forgotten much. I want to build a simple sound meter (e.g. https://electronics-lab.com/projects/audio/005/) but want the LEDs to stay on once activated as a record of the peak signal. Ideally only the highest one would stay lit but that would be more complicated. Would a latch circuit work for this? I just need a hint...
 
This simple cct. uses a diode to peak detect the audio for a DC control bar graph.

For analog Memory you want a Peak detector with decay might do. Putting a suitable Cap after the diode will slow the decay , but also if too big a value will be less sensitive to the peaks due to current drive limits charging the Cap depending on the source.

It is a nice simple bar graph but no simple solution for latching the largest active output other than a priority encoder, a CPLD but not simple.

However if you want to play with a Peak and Hold, you might be able to switch between input and an active peak detector with a clock and analog switch so the active signal and peak signal alternate on the display in some fashion to suit your purpose even tho it is not as you wanted with just the top LED ON.
 
Last edited:
Just put a peak detector on the analogue input. This way the peak of the analogue signal is detected and held, and the LED dot output will reflect this by also holding at its highest value. Google peak detector for schematics.
 
Peak detectors don't hold indefinately until reset which is what I think the OP wants.
They can hold for a very long time if done thoughtfully.
If you want to use SR FF on the outputs, you could do some cascade like so (obviously if would repeat for all LEDs, and I haven't drawn in any resistors):
sr.jpg
 
The LEDs are driven by current sinks so the outputs of the IC do not produce digital lows unless the LEDs are replaced with resistors, then the digital low voltage will be 0.4V when the current is 2mA.
 
A chip similar in function to this **broken link removed** obsolete one can get you there. If there's more than 8 LED's,,, I didn't think that far ahead.

The digital comment you made I wasn't consciously aware of.
 
Thanks for the help. I like the peak detector concept but think the decay will rule it out since I want it to last until reset. I'll have a go with a priority encoder and let you know how it works out.
 
the OP said:
So the priority encoder acts much like a multiplexer which reports the highest value as a binary output.

Yes

the OP said:
Do I then need to demux to point that output to the correct LED?

Not exactly. The address presented to the data selector (which is the binary value of the highest LED)

The "data selector" steers a fixed "1" or "0" to one of the outputs, depending on what you need to turn on the LED using a "new LED driver" You can think of it as when the address is 7 turn on output 6. When the address is 5 turn on output 4. When the address is 0, turn on output 0.

At some point, the logic could get complicated. I don't remember how to expand a priority encoder or a data selector.

I think there is an 8 Pin version of ULN200x i.e. 2003, 2004 etc.

You can also get yourself brightness control by changing the voltage used on the ULN driver for the LED supply. Each LED will need a resistor too. You could also PWM that pin as well for brightness control.
 
Do you have a circuit for the priority encoder setup? The RS latch implementation above can be done for eight outputs using two 74279 logic ICs (or four quad NAND logic ICs).
 
Do you have a circuit for the priority encoder setup? The implementation above can be done for eight outputs using two 74279 logic ICs (or four quad NAND logic ICs).
That's what I'm reading up on now. Thanks for the 74279 pointer. Soooo much to learn and relearn - it's been a fun couple of days.

At the moment I'm thinking of using a microphone instead of hooking directly into the speaker source and adding a variable resistor to adjust input sensitivity. So the overall scheme is (currently):

Microphone/potentiometer -> opamps -> LEDs (real-time array) -> priority encoder/RS latch -> LED driver -> max demand LED array

Does anyone use a circuit simulation software? They didn't have that when I last did this :) LTSpice looks unfriendly but pretty powerful.
 
LTspice is popular here. Steep learning curve but well worth it. It has built-in 'Help', but extra help and free third-party model libraries are available from the Yahoo LTS User Group.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top