Flashing LEDs to music

Discussion in 'The Projects Forum' started by mtv22, Jul 4, 2013.

  1. mtv22

    Thread Starter New Member

    Jul 4, 2013
    5
    0
    Hello,

    I've been trying to get LEDs to flash to music through the 3.5mm audio jack on my laptop. I want to get this to work so I can go on to splitting the frequency for bass mid and high, but for now I'm struggling to get a simple test circuit to work. I've searched through endless instructables and youtube videos made by people who know even less than I do about circuits to no avail. I'm still kind of a beginner; I've tried to read the articles on here about it but they are way more complicated than I can understand.

    So, right now my problem is I can get the LEDs to flash to music with just one transistor (2n3904 ot tip31), but they only hit the max current if the volume on my laptop is considerably high. I plan to split the audio output later so I can listen to music too, so I don't want to have the music on full blast to get a couple of tiny LEDs to light up. To solve this, I tried to connect two transistors in a darlington pair with a pot. I know it's working because the LEDs flash when I touch the base wire, but when I connect the circuit to the audio jack, the LEDs just stay about 70% lit and flicker a very small amount. I guess my question is, why is this happening and is there anyway I can fix this/do it a different way?

    http://i803.photobucket.com/albums/yy317/mtv221/circuit.jpg
    Here's an image of my circuit with the two transistors
     
  2. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,535
    Part of the problem is no resistors on the base. Try adding a 4.7K on the input. Also add a 10μF capacitor.

    [​IMG]
     
  3. DickCappels

    Moderator

    Aug 21, 2008
    2,648
    632
    Bill, where should be put the capacitor and should the base resistor be in series with the signal?

    One one other thing, the audio signal needs to be capable of supplying over 1.2 volts, which is more than some portable music players can put out, or the transistors will probably never turn "on". You can probably get by with a single transistor.
     
  4. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,535
    Basically a transistor input looks like a simple diode in the common emitter configuration, a Darlington looks like two diodes. My thought is to eliminate stray currents from the computer interfering with the transistor DC bias, but another thought occurs to me. You may not have enough signal to break over the two diode B-E junctions.

    I cover a lot of this territory in my LEDs, 555s, Flashers, and Light Chasers article in chapter 12, labeled "Fire!".

    Be right back, drawing.
     
  5. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,535
    OK, here it is...

    [​IMG]

    I was being conservative, C1 can probably be eliminated. It is an old trick to make a polarized cap into a non-polarized type.

    R3 needs to be as large as you can get, 100KΩ or larger. It is to take the transistor to the threshold of being turned on, without actually turning them on. The audio signal will then do the rest.

    Good to hear from you Dick. Playing devil's advocate? I know you know this stuff.
     
    mtv22 likes this.
  6. donpetru

    Active Member

    Nov 14, 2008
    186
    25
    Something simple that works perfectly and is circuit "SIG" used in many audio amplifiers projects that I have designed.
    @mtv22, for example, analyzes DW300 project (see sheet 2, SIGNAL circuit). You will find what you need.

    Remember the following: the solution presented by me working with audio signals greater than 1V but can be easily adapted to operate with lower signals.
     
  7. mtv22

    Thread Starter New Member

    Jul 4, 2013
    5
    0
    Wow thank you so much for your help! I used the final schematic Bill posted and it worked very well!! To get the LEDs to flash really brightly I have to have the pot at a spot where the LEDs are always dimly lit with no music playing, but I've been playing around with it and have gotten it in a pretty good spot so the LEDs are barely lit when there's no music and still flash brightly with the music. Thank you so much for your help, time for me to experiment with just a single transistor and possibly higher currents to drive more LEDs.
     
  8. wayneh

    Expert

    Sep 9, 2010
    12,094
    3,033
    No offense, but why bother with a single transistor? A darlington is a very good choice here and they can be readily purchased pre-made as if they are a single transistor. Just sayin'
     
  9. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
  10. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,535
    Minimum parts count is always important, to mangle Einstein, Make it as simple as you can, but no simpler.

    The OP also specified a very low level signal. A Darlington with a gain of 1000 or more will work well, and can be bought as a single package.
     
  11. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I breadboarded the circuit linked in post #9, but used only one LED per channel: red for low frequencies, yellow for mid, and green for high. It works well.
     
  12. €Hunter

    New Member

    Jul 6, 2013
    33
    3
    LM3915 (log) is cheap enough now (non genuine that is)
     
  13. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I don't have any idea what the relevance of that is to this thread.
     
  14. €Hunter

    New Member

    Jul 6, 2013
    33
    3
    The LM3915 will flash leds to music. Many leds actually.
     
  15. €Hunter

    New Member

    Jul 6, 2013
    33
    3
    Read the datasheet.
     
  16. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    How do they differentiate frequency? Just varying the intensity of LEDs in response to voltage changes may form the basis for a VU meter, but not a color organ.
     
  17. €Hunter

    New Member

    Jul 6, 2013
    33
    3
    You can make an led spectrum analyser based around it. Filter out the frequencies with op amps I guess.

    Great IC. You looking to buy?
     
  18. €Hunter

    New Member

    Jul 6, 2013
    33
    3
    Band pass filters. Give it a go.
     
  19. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    Unless you are just working on your post count, you should spend more time reading the threads and less time dropping one-liners. Fifteen posts by someone who has been a member here less than two hours?
     
  20. €Hunter

    New Member

    Jul 6, 2013
    33
    3
    I am on a smart phone, not a PC.

    Regards,

    State-of-the-art Hunter
     
Loading...