MUFF WIGGLER Forum Index
 FAQ & Terms of UseFAQ & Terms Of Use   Wiggler RadioMW Radio   Muff Wiggler TwitterTwitter   Support the site @ PatreonPatreon 
 SearchSearch   RegisterSign up   Log inLog in 
WIGGLING 'LITE' IN GUEST MODE

AC Signal LED Switch Driver
MUFF WIGGLER Forum Index -> Music Tech DIY Goto page 1, 2  Next [all]
Author AC Signal LED Switch Driver
cackland
How can I create an AC signal LED switch (discrete or op amp - ideally low component count)?

As AC, alternates, and LED’s require a constant current I’m trying to figure out a way to create a signal detector switch. This application of this circuit is to activate as soon as an AC signal has been detected (doesn’t matter how large or small this signal is).

This is the current circuit that I’ve implemented to do the job, however I’m wondering if there is a more efficient circuit that requires less components.

Currently the 'ON' threshold is +- 6mV.

Any recommendations?

Edit: Ignore the input jack, this is merely where this sub-circuit connects to the main circuit. This is not a standalone circuit.

Synthiq
You may be able to replace the two opamps with two comparators with open collector outputs and connect them together for a wired-or function to eliminate the two diodes. If you only draw 2 mA in the LED, you should be able to drive it directly from the comparator output without a separate drive transistor. The drawback is that the filter capacitor has to be moved to the output and may have to be larger for the same time constant. The R7 resistor would have to be split into 2 with the capacitor connected to the node between them to limit the maximum current in the capacitor. Some comparators also have the output transitor connected to the negative supply so the LED would in this case be driven between -12V and ground.
Synthiq
One more thing: The voltage divider R3/R8/R4 relies on perfect matching between the supply voltages to work correctly and it only takes a 12mV difference for both thresholds to become positive (or negative). For reliable operation, there needs to be 2 separate voltage dividers, one between +12V and ground and one between -12V and ground.

The thresholds must also be set to a higher value than the worst case offset in the opamp/comparator or the output may be active even without an input signal.
cackland
Synthiq wrote:
You may be able to replace the two opamps with two comparators with open collector outputs and connect them together for a wired-or function to eliminate the two diodes. If you only draw 2 mA in the LED, you should be able to drive it directly from the comparator output without a separate drive transistor. The drawback is that the filter capacitor has to be moved to the output and may have to be larger for the same time constant. The R7 resistor would have to be split into 2 with the capacitor connected to the node between them to limit the maximum current in the capacitor. Some comparators also have the output transitor connected to the negative supply so the LED would in this case be driven between -12V and ground.


Thanks.

So I couldn't redesign the circuit to take into account what you are recommending. My interpretation of your words don't translate to a diagram. I've looked into open collector comparators in a wired-or function. Couldn't exactly grasp the concept.

Assuming you are referring to a an LM358 / LM339? Are there are reference diagrams you could suggest?
cackland
Synthiq wrote:
One more thing: The voltage divider R3/R8/R4 relies on perfect matching between the supply voltages to work correctly and it only takes a 12mV difference for both thresholds to become positive (or negative). For reliable operation, there needs to be 2 separate voltage dividers, one between +12V and ground and one between -12V and ground.

The thresholds must also be set to a higher value than the worst case offset in the opamp/comparator or the output may be active even without an input signal.


I assume when you say matching, you are referring to the resistor tolerance. I generally use 1% resistors. 1% on those resistor values give me a tolerance of +- 5.9mV to +- 6.1mV.

I set it for a 12mV range, so that basically even the smallest signal will turn on the LED. The range could be increased to 24mv by increasing R8 to 200 ohms, allowing for the resistor tolerances to come into play.

Both positive and negative signals should turn on the LED. Not only audio signals would turn on the circuit but negative CV as well.

This circuit is more so implement to show a signal connected, an ON / OFF switch to light the led.
Synthiq
The comparators must be open-collector for this to work, so a LM339 or LM393 will work, but not the LM358 since it has a push-pull output.

Below is a simulation of the circuit with a LM339 comparator. R7 and C1 will control the turn-on time, R8 and C1 the turn-off time and R7+R8 the LED current.

Synthiq
cackland wrote:
Synthiq wrote:
One more thing: The voltage divider R3/R8/R4 relies on perfect matching between the supply voltages to work correctly and it only takes a 12mV difference for both thresholds to become positive (or negative). For reliable operation, there needs to be 2 separate voltage dividers, one between +12V and ground and one between -12V and ground.

The thresholds must also be set to a higher value than the worst case offset in the opamp/comparator or the output may be active even without an input signal.


I assume when you say matching, you are referring to the resistor tolerance. I generally use 1% resistors. 1% on those resistor values give me a tolerance of +- 5.9mV to +- 6.1mV.

I set it for a 12mV range, so that basically even the smallest signal will turn on the LED. The range could be increased to 24mv by increasing R8 to 200 ohms, allowing for the resistor tolerances to come into play.

Both positive and negative signals should turn on the LED. Not only audio signals would turn on the circuit but negative CV as well.

This circuit is more so implement to show a signal connected, an ON / OFF switch to light the led.

No, I was referring to the matching of the supply voltages, but mismatch in resistor will also be important. Try changing the positive supply to 12.1V and calculate the voltages in the divider chain or change one of the resistors from 100kohm to 101kohm and you will see that the threshold voltages will be way off.
cackland
I see. So even though the supply rails SHOULD be regulated, a variance could swing the threshold totally off.

Thank you for your reference schematic. So having each rail go to ground through the voltage divider should eliminate this potential issue?

So, in relation to component count, adding an additional 50ohm resistor, however we've lost 2 diodes, 2 10k resistors, transistor, and the led current resistor = 5 Components. Not bad. Component count is important in this subcircuit
Synthiq
cackland wrote:
So having each rail go to ground through the voltage divider should eliminate this potential issue?

Yes.

You also save 2mA in current consumption by using LM339 or LM393 comparators instead of a TL072 amplifier, if you care.
cackland
Gotcha.. Always care about current consumption.

I did simulate your update circuit with TL072, which acted like a normal positive LED driver. Not the intended response of this circuit, so no go there.

I still could use my reference circuit, adding the individual voltage dividers to ground, however that obviously goes against my plan to reduce component count. So I'll have to give yours a go before implementing it into my main circuit.
Synthiq
Well, a TL072 can supply around 10mA so you can drive the LED directly just as with a comparator, but you would then need the diodes to do the OR function so it would cost you 2 more components than with comparators. And more current, although a TL062 would reduce it to even lower levels than a LM393.
cackland
Something to think about.

Thank you Synthiq
Synthiq
Just noticed that the output of the LM393 comparator is limited to 20mA so it is possible to eliminate resistor R7 in my schematic if using this comparator so one more component can be eliminated.
cackland
Synthiq wrote:
Just noticed that the output of the LM393 comparator is limited to 20mA so it is possible to eliminate resistor R7 in my schematic if using this comparator so one more component can be eliminated.


Another win!! thumbs up

I was actually wondering if R6 could be eliminated also?
Synthiq
cackland wrote:
I was actually wondering if R6 could be eliminated also?

If the input is always connected to a low impedance source that can sink the input bias currents from the comparators, then you can eliminate R6. If you know that the input signal is within +/-12V I don't know why to keep R5 either since the only purpose I can think of is to limit the input current if the signal is clipped by an input protection diode in the comparator.
cackland
Ok, something to test also.

Noticed that your schematic only shows the negative signal. Just to clarify, the LED will light if the input signal is above and below the threshold set to +-6mV?
devinw1
Technically you can make a full wave rectifier with one op amp, 2 diodes, and some resistors. You could use this and 1 comparator?

I don't have a specific circuit in mind and there may be pitfalls, but I'm thinking this general approach might work well for this?
Synthiq
cackland wrote:
Noticed that your schematic only shows the negative signal. Just to clarify, the LED will light if the input signal is above and below the threshold set to +-6mV?

Yes, if you look closely at the wired-OR comparator outputs (blue) in my simulation you can see it goes low (active) when the input signal is both positive and negative and only becomes inactive (high) during zero-crossings while the input signal is active.

The reason the output signal is negative is only because the output stage pulls the output to the negative supply voltage when active. You can connect the LED to the positive supply to get a symmetrical output signal but you would burn twice the power since you would double the voltage, so there is nothing to gain from it.

There are some comparators that have the emitter of the output transistor connected to a pin instead of the negative supply so you can select the low level to be ground or some other level instead , but then you can't get two comparators in a 8-pin package.
KSS
What about a 14mv AC input with 9mv bias?
Solutions so far provided seem to assume centered input.
cackland
KSS wrote:
What about a 14mv AC input with 9mv bias?
Solutions so far provided seem to assume centered input.


Any signal that’s is positive of 6mV will light the led, and vice versa with any signal that is negative of -6mV.

The only issue I see, is if there is an offset and the peak or trough of a signal falls in between the threshold, the led will switch off, even though there is technically a signal active. I would assume this would be a rare occurrence, however could potentially happen.
cackland
devinw1 wrote:
Technically you can make a full wave rectifier with one op amp, 2 diodes, and some resistors. You could use this and 1 comparator?

I don't have a specific circuit in mind and there may be pitfalls, but I'm thinking this general approach might work well for this?


This was my initial thought process, however didnt seem to work when simulated. The voltage rise and fall of a rectified signal would still light and dim with the rise and fall. Component count is important here, so unless your imagined circuit has fewer components that what has already been suggested, it won’t do.
cackland
So far the component count is as follows:

R1, R2, R3, R4, R8, C1, D1 and a dual Op amp. (8 Components).

I can already see a full wave rectifier plus comparator to be more than 8 components.

Edit: Forgot the comparator decoupling caps. So 10.
KSS
cackland wrote:
Any signal that’s is positive of 6mV will light the led, and vice versa with any signal that is negative of -6mV. The only issue I see, is if there is an offset and the peak or trough of a signal falls in between the threshold, the led will switch off, even though there is technically a signal active. I would assume this would be a rare occurrence, however could potentially happen.


So you don't care that any DC with an offset/bias less than +/-6mv is LED off, and any DC with an offset/bias greater than +/-6mv is LED On?

How does AC detect matter?
edit added +/- and quoted full prior reply for clarity
cackland
Well, of course I care if either AC or DC falls into that threshold. However, in my application of this circuit, as the threshold is so small, its difficult to achieve. Not saying it can't happen.

How does AC detect matter? Do you mean why am I detecting for AC signal?

I am detecting for both really.
Orgia Mode
Super useful circuit...I'll have to try to remember where to find it if I ever need it. razz
MUFF WIGGLER Forum Index -> Music Tech DIY Goto page 1, 2  Next [all]
Page 1 of 2
Powered by phpBB © phpBB Group