Shop OBEX P1 Docs P2 Docs Learn Events
Looking for circuit example (audio line level to single LED) — Parallax Forums

Looking for circuit example (audio line level to single LED)

RobotWorkshopRobotWorkshop Posts: 2,307
edited 2011-06-02 09:25 in General Discussion
Hello, I'm trying to wrap up a demo project for the upcoming UPENE show and I hope that perhaps some of you may be able to help me with a simple circuit. There probably is an example out on the net somewhere but I haven't found one. I'd normally just start wiring up things on a breadboard but I am really pressed for time and am focused on other aspects of the project.

I currently have an audio output (line level) that is going to a set of amplified speakers. I also want to take that same line level audio signal and drive a single LED with it. Basically I just want the LED to light when there is some sound being generated. It can be as simple as varying the intensity depending on the signal or just flash the LED when the audio plays. I'd like to keep it fairly simple and not load down the audio signal too much.

So, if anyone has something they know of that would work or serve as a basis for this it would really help!

Robert

Comments

  • skylightskylight Posts: 1,915
    edited 2010-08-18 11:39
    you could use a voltage follower circuit to drive the led using an op amp
  • LeonLeon Posts: 7,620
    edited 2010-08-18 12:05
    I'd rectify the signal to provide a DC level.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2010-08-18 12:07
    I should also mention that I'm trying to run this from a 5V supply so for any Op Amp that is used it needs to use +5V and ground. No negative supply available.
  • skylightskylight Posts: 1,915
    edited 2010-08-18 12:29
    http://ww1.microchip.com/downloads/en/AppNotes/00682c.pdf

    example of voltage follower on single rail supply
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-08-18 13:29
    I've just hooked the LED up to the audio through a current limiting resistor. It blinks and flashes with the sound/music. The more amplitude (louder) the brighter the LED. It's kinda fun to watch actually.

    I didn't use one, but for LED life, I'd probably use a diode to ground (or another LED in reverse polarity) to rid the negative values of Audio. Depending on the power of your amplifier, it might lower the volume of that audio channel though..... just a little.

    Heck if you don't use the idea, it takes 30seconds to hook up and mildly entertaining...


    Oh, you said line level.... Ya might need a simple audio amp transistor (Radio Shack) to drive it then.... or a 741 op amp (Radio Shack). There should be + supply circuits on the datasheet.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2010-08-18 13:33
    Did you put your LED before the Amplifier or after it? What you did is similar to what I am trying to do but I want to pickup the signal before the amp.

    Robert
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-08-18 13:44
    Yea, I put it after the amp.... sorry I saw that after I posted... then edited the post. I guess you replied in the interim.

    It MIGHT work off the line level if you use one of the little 3mm bright green LEDs I bought from Jameco. They provide good light at about 1mA!!! Chances are I'll bet you'll need a preamp though. You could try it, the worst that happens is you pull the line low and don't get audio out right?


    If you build a small crude amp, which wouldn't take much, you may need a cap on the output to rid of DC level. Otherwise the LED would go from light to bright levels and never really blink. You'd see it with an o-scope if you have one.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2010-08-18 13:51
    Maybe a simple amp like the lm386 (which I happen to have on hand) would work.
  • ercoerco Posts: 20,257
    edited 2010-08-18 13:54
    You could also try an audio matching transformer to better match line-level signals to the LED. Typically 1K w/centertap to 8 ohms, they are versatile in many apps, and you can reverse them for different impedence matching. Quick to experiment with a few alligator clips. Unfortunately they are getting harder to locate in this digital age. Radio shack still has them: http://www.radioshack.com/product/index.jsp?productId=2103254

    I second the suggestion for low-current LEDs. I get mine from Junun:

    red: http://www.junun.org/MarkIII/Info.jsp?item=62
    green: http://www.junun.org/MarkIII/Info.jsp?item=63
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-08-18 14:37
    Maybe a simple amp like the lm386 (which I happen to have on hand) would work.

    That's what I would use. Erco is greater than I though... his suggestion might be a lot better. :D
  • ercoerco Posts: 20,257
    edited 2010-08-18 22:52
    Hey, I love your 386 solution as much as the next guy! One of my favorite ICs, right up there with the 555, 567, 324, 339 and 3909.
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-08-20 12:31
    erco

    I like the lm567 tone decoder and the 3909 flasher too! :-)
    Hard to find a good buy on the 3909 though. You can get
    the 567 for .25 from China in large lots....easier than writing
    tone detection code.
  • ercoerco Posts: 20,257
    edited 2010-08-20 12:54
    Holly: You have great taste in ICs!

    I see guys scalp obsolete 3909s on Ebay for $5-10: http://cgi.ebay.com/LM3909-Oscillator-LED-Flasher-3909-/400083973122?pt=LH_DefaultDomain_0

    But they are always in stock at http://futurlec.com/ for $2.75. Shipping takes a while, but they have some interesting parts.

    When anybody finds a deal on my beloved obsolete FPT540A phototransistor, please advise! I'll buy a batch for my own nefarious purposes....
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2010-08-20 13:11
    I'm sure I have some LM567 and 3909 chips on hand. Since they are obsolete now I'll probably just save them for repairs or for building a "classic" project. For something new I'd rather use current parts.

    Robert
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-08-20 13:38
    If you're going to use/get an IC, then make it an LM3915 or LM3916. Visually compelling, just a few support components, easy, still available from Jameco. You don't have to use all of the LEDs/outputs.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2010-08-20 19:15
    That could be another option as well. Thanks for all the suggestions. I may not have time to get it done for the UPENE but will have a list of things to try later on.

    Robert
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-05-29 06:49
    I was able to finally get back to this project but still don't have a good solution yet. I'm running the whole circuit at 5V. It needs to drive a RED LED that already has a 470 ohm current limiting resistor with one side tied to +5V. It has to be that way since there is a relay which can switch control of the relay to the Propeller controller. I've confirmed that when the relay is switched to audio control that it will light when I apply ground to the LED output pin. The audio to LED driver is a separate circuit board that has a three-pin connection to my main board. It has a ground connection, +5V, and the output to the LED. +5V to the LED line is full on. I also have an audio cable that goes to a Y splitter so it can pickup the audio signal that also goes to the speaker.

    I've experimented with a couple different LM386 circuits but nothing promising so far. I just want to monitor the audio line and when there is sound then vary the voltage for the LED so that it is on when speaking. It can either just flash on/off as the audio is there or even better vary in brightness as the audio is active. I just want it to come on when the speech module is talking so that there is some visual indication of speech.

    Has anyone else had to make a similar circuit or know of some other examples?
  • RDL2004RDL2004 Posts: 2,554
    edited 2011-05-29 07:50
    Would something like this work?

    3918_amp.gif
    689 x 380 - 211K
  • kwinnkwinn Posts: 8,697
    edited 2011-05-29 08:15
    Try this circuit. The sensitivity can be varied by changing the valuer of R1, R2, R3. I would suggest using one pot for R2 and a second pot for R1 and R3 with the wiper going to pins 2 and 6.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-05-29 08:40
    Thank you for the suggestions!! This will give me a couple more things to try later this afternoon. If any others show up on this thread I'll try them too. It will be nice to get something working this weekend.

    Robert
  • davejamesdavejames Posts: 4,047
    edited 2011-05-29 20:18
    Robert - try this if you haven't had any luck with the other suggestions.

    Pretty much any op-amp will work. The only requirement is that it deliver 10mA on its output for the LED.

    Running the op-amp with an open loop means tons 'o gain so any wiggle on the input is going to slam the output from near 5 volts to near ground.

    The 1uF will be sufficient to pass freqs beyond 10kHz. The two 20k resistors bias the op-amp to mid-supply, in this case around 2.5V.


    AudioLineIndicator.png


    If things get squirrely, there may be the need to reduce the input signal, and/or, add a cap from the 510/LED junction to ground. We can talk about that if you like.

    Regards,

    DJ
    211 x 121 - 3K
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-06-02 09:25
    I worked on this a bit last night and it seems to be working well now! Used a combination of the suggestions. It is similar to the one that davejames suggested with a couple differences. First, I had to swap the + and - inputs since the LED was already connected to +5V and I needed to control the ground. Instead of the two 20k resistors I used some 24K resistors I had on hand. With that the LED was on most of the time and almost never shut off. To fix that I added a 10K resistor to ground and a 20K control to +5V at the point where the input cap went to the positive input. I could then adjust the control so that it was on when no noise was being produced and then back it off until the LED went out. So far that seems to have done it! I can post a schematic once I clean it up.

    Robert
Sign In or Register to comment.