I'm trying to create a circuit to blink lights at the precise frequency for a mind machine. The lights need to be in sync with audio.

Audio channel 1 300 hz Audio channel 2 310 hz

The led needs to blink at 310-300 = 10 hz And it should be in sync with the audio I.e. It should peak when both audio channels peak

I tried using a computer to generate the frequencies and a lm358 opamp . I am getting confused whether this is the right opamp I should use and what kind of external circuitry I should use.

The audio frequencies may be changed to 300 to 350 hz to get desired effect.

Edit : more details: The input frequencies are generated by a computer or an MP3 player. I don't know what voltages they are.

The brightness of the led can be changed.. I think this is easily controllable by using a potentiometer. I want to experiment with different LEDs of different power and brightness (upto 1w). But for now I'm testing normal 5mm red LEDs .

The whole thing needs to be powered by a 5v battery ( so no negative voltages available)Switching between different output waves is desirable, if it's easy to achieve, or only sine wave is fine.

I have an Arduino uno and pro mini if that's useful. I do not have an oscilloscope, so using an Arduino to count output frequency.

heres a video of what I achieved so far. It's a lm358 with almost no external circuitry. Showing result for sin and square wave. http://youtu.be/Aj5mE7mWrZA

In future I also need frequency filters to filter out interesting frequencies from audio. E.g. When nature sounds are mixed with the 300 and 305 hz audio channels to give relaxing effect, 300 and 305 hz signal needs to be filtered and fed to this opamp circuit. Frequencies of interest lie between 300 and 360 hz.


  • \$\begingroup\$ so the question is: I have two pure sinusoid inputs and I want to blink a led each time both of them are at a maximum, right? \$\endgroup\$ – Vladimir Cravero Jan 21 '15 at 9:54
  • \$\begingroup\$ yes Vladimir. Ideally output should be sinusoids as well so that led blinks softly and is not hard on eyes. \$\endgroup\$ – Hrishikesh Huilgolkar Jan 21 '15 at 10:05
  • \$\begingroup\$ blink does not include softly usually, you might want to add that. and please also add what you achieved so far. what you want to do is sum the two signals and then use an envelope detector. to build a full circuit way more specs are needed. what are the two channel voltages? what kind of led are we talking about? are there any limitations on power supply, such as a split supply is a no no? \$\endgroup\$ – Vladimir Cravero Jan 21 '15 at 10:11
  • \$\begingroup\$ I have updated the question with more details and video link. \$\endgroup\$ – Hrishikesh Huilgolkar Jan 21 '15 at 12:43
  • \$\begingroup\$ From what I read the question is more clearly asking for a "difference frequency" output, ("blink at 310-300 = 10 hz"). To get the difference frequency from two sine waves it is necessary to mix the signals in a non-linear way then use a low pass filter to extract the difference frequency. \$\endgroup\$ – Nedd Jan 21 '15 at 15:59

It sounds like you want to drive the LED roughly in response to the amplitude of the sum of the two audio signals. Making a signal that is proportional to the amplitude of another is called AM demodulation. There are various options for doing that. Such circuits have been around for a long time since they are fundamental to a AM radio receiver. Yours will run a much lower frequencies, but the concept is the same.

In your case, you also probably want to threshold the signal a little. In other words, instead of the brightness being proportional to volume, the brightness will be 0 below some volume. LEDs are diodes, so have a threshold voltage built in to first approximation. For example, a common green LED drops about 2.1 V when fully lit. But, the current, and therefore the brightness falls off rapidly as the voltage gets lower. At 1.5 V it will be so dim you won't notice it on in normal office illumination.

So what I'd do for experimenting is to start by AM detecting the sum of the two audio signals. Using a opamp amplifier with two pots, allow for adjusting both the gain and offset of this signal. Then connect that to the LED with a resistor in series. The resistor should be sized so that the LED current never exceeds its maximum rating even with the largest possible voltage coming out of the amplifier.


Take your two sine waves and put them into a summing opamp circuit. (Make sure the opamp has bipolar supplies.) The output will be a sine wave that beats at the difference signal. Send this signal into your LED with a resistor in series (maybe 100 ohms or so... you'll have to play a bit to see what you like.) Set the amplitude of each sine wave to be the same at ~4 Vp-p, that means the maximum of the summed signal with be 8 Vp-p or 4 V peak above ground. As the beat signal approaches it's maximum you'll be turning the LED on and off at ~300 Hz... too fast for you to see the blinking... and it will just look like an LED blinking at the difference frequency.

  • \$\begingroup\$ Thanks for answer. Is that what I'm doing in the above circuit? ( see video) \$\endgroup\$ – Hrishikesh Huilgolkar Jan 21 '15 at 18:20
  • \$\begingroup\$ I don't know, maybe? Can you post a circuit.. or post a link to where you copied it from. \$\endgroup\$ – George Herold Jan 21 '15 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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