NE555CP PWM Setup

Discussion in 'The Projects Forum' started by donovan_nh, Jun 7, 2009.

  1. donovan_nh

    Thread Starter Member

    Jun 7, 2009
    10
    0
    Someone told me this is where the smart people hang out. I am a rookie and this is my first post here after becoming frustrated with countless, fruitless web and forum searches.

    I am looking for some help with setting up a series of NE555CP as audio-controlled pulse width modulators.

    Here are the details of my project, followed by some questions, and a precursory schematic follows at the end of this post.

    Supply is a 9V battery bypassed with a 100uF capacitor.

    A low level audio input signal feeds a series of LM741 op amps which are separated within a voltage divider. When the input signal is low, the op amps' outputs are all high and the LED's are all off.

    As the input level voltage increases, the op amps' outputs sequentially go low and the LED's light, as they do here, an LED "bar graph" driven by the audio signal's amplitude.

    I have verified this works with white LED's on a breadboard, manually adjusting the input voltage on a DC power supply. I have not verified this with audio yet, but do not believe it will require much more than adjusting the values of the resistors in the voltage divider network to tweak in the levels. That is, unless there is an issue with the negative side of the sine wave. If all goes well, I will probably use potentiometers on the high and low ends of the divider to accomplish the necessary tweaks.

    The next planning step I would like to take (but need assistance with) is moving to RGB LED's... specifically, I will break up the audio signal into 3 portions using bandpass filters. I would like to use each portion as a unique control to an NE555CP pulse width modulator, which will then feed pulsed voltage to one color of the RGB LED.

    The effect I am looking for is that the bar graph goes up an down with signal amplitude and once PWM's are setup for R, G, and B, the color will shift or twinkle with sound frequency within each band.

    Disclaimer: I have exactly zero experience with PWM or setting up a 555 timer in any mode other than astable.

    So, a few questions:

    1) Is my plan workable or are there obvious flaws?

    2) How do I setup the timer with regard to the "Trigger" pin? I am using TI parts, but I am referencing Figure 9 of the Fairchild datasheet here. I am confused about how to use that "Trigger" pin (or if I even need to) and the formula for choosing the values of "RA" and "C". I would like to setup the frequency of the PWM to be above the audible range to avoid any crosstalk with the signal.

    3) I recall seeing somewhere that I need a couple of diodes inserted into the circuit in order to increase the extents of the duty cycle on both the high and low ends? Where might these go?

    Lastly, here is the schematic for the circuit so far. Notw that this includes only one of the colors and does not include any of the bandpass filtering I mentioned, but will rather serve as the basis for just one of the 3 colors.

    [​IMG]

    Thanks vey much and in advance for any advice you may offer.
     
    Last edited: Jun 7, 2009
  2. Wendy

    Moderator

    Mar 24, 2008
    20,764
    2,534
    The 741 has a problem in that there is no minimum voltage spec, an 9V doesn't work well with them. A LM324 is a quad with similar specs, except it does have a minimum voltage spec, of 2V. It will handle 9V extremely well. It's major flaw, which the 741 also has, is poor crossover distortion, that basically only matters if you are listening to the audio.

    I've resized your image so it will fit in a forum thread better, I find having to scroll side to side extremely distracting. The max size width is 800 pixels. Also, avoid .jpg images, they create the fuzz you see around your parts. Either .png (prefered) or .gif will avoid this. I'll think about where you may want to tweak this design.

    You can edit your post and either link on this attachment (use the A/A symbol on the upper right hand corner to see the LeTex symbols that allowed you do to this). Here's a How To link...

    How to Display Attachments Full Size


    [​IMG]
     
    • temp.GIF
      temp.GIF
      File size:
      19.2 KB
      Views:
      137
  3. Wendy

    Moderator

    Mar 24, 2008
    20,764
    2,534
    So to ask what you are after, you want to use an audio signal to vary the brightness of the LED. You are wanting to do this with each channel. Why PWM? Why not linear?
     
  4. donovan_nh

    Thread Starter Member

    Jun 7, 2009
    10
    0
    Yes, I want to vary LED brightness using sound, specifically the sound's frequency, not it's amplitude. I was under the impression PWM was the best way to go. Actually, I did not know there was another way. Would you please describe how to accomplish the same thing with a "linear" approach?

    Thanks again.
     
  5. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Sounds like what you really want to do is create a spectrum analyzer.

    Consider using LM3915 log dot/bar display drivers for the LEDs.
    http://www.national.com/ds/LM/LM3915.pdf

    For the frequency range selection, you could use opamps connected as active filters.
     
  6. Wendy

    Moderator

    Mar 24, 2008
    20,764
    2,534
    Linear in this case means varying the current to the LEDs. PWM has the advantage in that being digital, nothing gets warm. Linear you do have to pay attention to where heat might be being developed. The end effect is much the same. Sometimes the simplicity of linear is worth it though.

    If you have a simple LED/resistor combo and vary the voltage going in the intensity of the LED will also vary.
     
  7. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    The LM3915 IC has an input amplifier, 10 comparators, 10 current-regulated LED drivers and an adjustable voltage reference inside. It is made for a sound level bar-graph.
    Numerous LM3915 ICs can each be fed from a bandpass filter and peak detector circuit for different frequencies to be shown.
     
  8. donovan_nh

    Thread Starter Member

    Jun 7, 2009
    10
    0
    Thank you all for your replies.

    I do not want to consider any chips outside of standard op amps or discrete components at this time for reasons of convenience.

    Did anyone have a chance to look at my 555 setup or can anyone answer my original question about the "Trigger" pin?

    As I mentioned, I want to vary brightness with frequency. So, if I were to choose linear, how would I go about varying the voltage as a function of frequency? I do not want to vary voltage as a function of amplitude... I've already got that part covered with the bar graph portion.

    In the end it should be:

    Number of lit LED's indicates amplitude
    Brightness of LED's indicates frequency
     
  9. DC_Kid

    Distinguished Member

    Feb 25, 2008
    638
    9
    it sounded to me like the OP wanted both amplitude (led bar graph, aka VU), but also drive a tri-color led using varying PWM to to each color based on frequency. so basically a VU meter with RGB display. this would be very interesting to see.
     
  10. donovan_nh

    Thread Starter Member

    Jun 7, 2009
    10
    0
    Yes DC_Kid. That is exactly what I intend. :)
     
  11. DC_Kid

    Distinguished Member

    Feb 25, 2008
    638
    9
    well, then PWM might be too complicated.

    use the op-amp comparator voltage divider set up as a voltage follower and perhaps normalize the output gain. this gets the VU affect. then you need to put the amp output through 3 freq filters (perhaps digital) and each fed into 3 op-amps. rectify the last stage output and drive each led segment directly.
     
  12. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    A 555 won't do it and PWM also won't do it.
    It won't work with most music because there are many frequencies playing at the same time.

    You can make a circuit that will light an LED brightly for a single high frequency or light the LED dimmly for a single low frequency. Frequencies in between will have a certain amount of dimming.

    An LM2907/LM2917 IC is a tachometer and has an output voltage depending on the input frequency.
    You can make your own LM2907/LM2917 with many "ordinary" opamps and comparator ICs.
     
  13. donovan_nh

    Thread Starter Member

    Jun 7, 2009
    10
    0

    Thanks to all that have replied. A coworker recommended this very approach as well today. I think I am going to try it this way using the 3 filters. If this works I will be very happy for not having to tinker with the 555. Thanks for your time.
     
  14. donovan_nh

    Thread Starter Member

    Jun 7, 2009
    10
    0
    Well, I tried the filter method. I created a buffer to the signal, then 3 filters: one for reds, one for greens, one for blues. The filters arebased on the "design a filter in 39 seconds" document SLOA093 by TI. The work wonderfullt, but now I am faced with the problem of getting enough voltage out of the circuit to run the LED's.

    I set up op amp gain stages for each, but was not able to get enough voltage on the output to run a single LED with sufficient brightness. This is using LM741's throughout with a 9VDC supply.

    Is this problem related to the inability to get close to the rails using a 741?

    Should I try cascading gain stages?

    Should i try the filter output triggering a 555 in monostable mode with a period of about the highest expected sound frequency?

    Concerns are component count and ease of availability. Unfortunately, I need to try to limit this project to Radio Shack availability.
     
  15. Wendy

    Moderator

    Mar 24, 2008
    20,764
    2,534
  16. DC_Kid

    Distinguished Member

    Feb 25, 2008
    638
    9
    a schematic would help.

    with a scope or meter what voltages are you seeing at the last stage output?

    most amps cant reach the rails fully.
     
    Last edited: Jun 10, 2009
  17. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    The datasheet for the LM3915 bar graph display shows and discusses the use of a "peak detector circuit" that samples and holds an LED turned on long enough to be seen clearly (about 20ms). Without the peak detector circuit the a bar-graph of LEDs showing music look like a dim blur.

    Your new circuit is called "a colour organ" and millions of them were made with LM3915 bar-graph LED driver ICs.
     
  18. donovan_nh

    Thread Starter Member

    Jun 7, 2009
    10
    0
    Thank you. The LM3915 datasheet looks as if that is exactly what I need, should save me lots of space. I ordered 5, will report back after trying them.
     
    Last edited: Jun 11, 2009
  19. donovan_nh

    Thread Starter Member

    Jun 7, 2009
    10
    0
    This works awesome!

    I received 5 free samples of the LM3915 from National Semi the other day.

    The first attempt at hooking them up was only slightly successful. I was getting some erratic behavior. This turned out to be due to feeding the signal line too much voltage as I was going through a preamp and could not get the reference quite right.

    Tonight, I fed an unamplified signal of about 100mV P-P, a few uA's of current, and the chip works beautifully. I am amazed by its performance.

    Thank you all for your help and especially the suggestion of the LM3915. Not only is it perfect for my application, but it is going to save me buckets of space that was otherwise going to be taken up by many discrete components.

    Thanks again! :)
     
Loading...