LM3914 - All LEDs active, dimming based on signal :(

Thread Starter

sitech

Joined Jul 3, 2008
23
Hi,

Basically I've decided to get into electronics more and therefore I am strictly a beginner.

Part of one of my projects is a LED bar graph driven via LM3914.

I am running it via a Arduino kit which supplies me with a 5V source and I've made it output a trial signal varying between 0-5V (basically over a period of 1 minute). Prototyping on a breadboard.

However, when I hook it up like in the first example of the data sheet or some other arrangements (some of which I've seen in other posts), ALL the lights remain lit and the only change is that the LEDs themselves seem to get brighter as the signal voltage increases!

My latest pin layout is as follows:
2) GND
3) 5V source
4) GND
5) Arduino analog output
6) 5V source
7) GND via 1.2k resistor
8) GND
9) 5V source

As mentioned previously, I've tried other arrangements too including the one in the datasheet on page 2!

I've tested voltages on all pins and got what I expected, including the signal source from the arduino unit.

I have not included the capacitor as it says its only needed for lengths greater than 6"

I do not have all the LEDs connected (ran out early) and as I am writing this post I just realised I could replace them with resistors temporarily! I'm thinking that my issue is not having all the LEDs connected, something I'll have to try tomorrow. Is this my problem?

Any help would be greatly appreciated!
 

SgtWookie

Joined Jul 17, 2007
22,230
1) The minimum V+ supply that the circuit requires is 6.8V. It can be as high as 18V.
2) Go back and re-configure your circuit as it shows on the top of the 2nd page.
3) Try connecting a 0.1uF (100nF) cap between pins 2 and 3.
4) You need the 2.2uF cap, because the Arduino unit is generating lots of noise on the supply.
5) You need to use a bypass capacitor across the Arduino Vcc/ground terminals. Check the datasheet.
6) You likely will need a small capacitor (say, 1nF to 0.1uF) from pin 5 to ground, and a resistor (say, 10K) in the connection to the Arduino output, as the Arduino may be generating the output voltage via PWM. PWM is a valid method for generating a voltage level, but you must filter the output to get a fairly stable voltage.
 

Thread Starter

sitech

Joined Jul 3, 2008
23
Thanks for the response.

I've decided to make the max signal voltage 3.2V instead of changing the other voltage (that should work yeah?).

Just out of curiosity, what are the symptoms of the issues with my circuit?

Like what effect does noise have on the output?
What is the affect of not having that 1.8 V difference?
 

SgtWookie

Joined Jul 17, 2007
22,230
I've decided to make the max signal voltage 3.2V instead of changing the other voltage (that should work yeah?).
The LM3914 has a built-in regulator, similar to an LM317L, that has a minimum voltage drop of 1.8V.

Just out of curiosity, what are the symptoms of the issues with my circuit?
Sounds to me like your biggest problem is noise. uC's (microcontrollers) generate a great deal of noise. They're digital. You need to use bypass capacitors across their supply pins to quiet them down a bit.

Like what effect does noise have on the output?
Having a uC on the same board as a linear circuit is like inviting a punk band to play in a public library. :eek: Using bypass capacitors and filter circuits is like putting sound deadening material around to suck up the noise.

What is the affect of not having that 1.8 V difference?
Explained above.

You can use the circuit in the datasheet as-is, but you'll only get 3.2v of LED's lighting up from it. You would have to recalculate R1/R2 in order to assure full "swing" on the LEDs.

You can save yourself some LED plumbing by picking up a 10-segment LED display from Radio Shack, or order one from Mouser, Jameco, or elsewhere online. It just makes it a bit easier.
 

Thread Starter

sitech

Joined Jul 3, 2008
23
Thanks for the help, I've been playing around with your suggestions but I unfortunately have ran out of components and have to go to the shop tomorrow and get some more.

I tried your final suggestion regarding PWM and that has apparently done the trick, although I could not find anything other than a 0.5 uF (by chaining together a few higher capacitors).

There seems to be a a brightning effect on the last LED lit as the voltage increases (ie, if 50% means 5 lit, 60% 6 lit, 55% means 6 lit, but 6th dimmer than other 5). Is this a feature of the chip (I can see how it would be useful), or an effect of the noise?
 

SgtWookie

Joined Jul 17, 2007
22,230
It's the remaining noise. My suggestions for R and C were basically suggestions on how to reduce the noise significantly, without knowing anything about the frequency of the PWM your Arduino uC is putting out. Keep the capacitor fairly small, but try increasing the value of the resistor in stages (from 10k to 20k, then 33k, then 50k, etc.) to reduce the noise. A fixed resistance of 10k plus a 100k potentiometer would save you a lot of re-wiring; just vary the pot up and down until you get a decent trade-off between reduced noise and response that is fast enough.

As you increase the resistance, your response time will increase, but the noise will decrease.

The datasheet for the LM3914 is rather lengthy, but it's worth reading through a few times to get a good understanding of the IC. You'll discover that there is some "overlap" when operating in "dot" mode; ie: two LEDs may be illuminated simultaneously when the input voltage is right on the threshold between the two.

However, what you're observing is the PWM "noise" on top of the DC level. And you're right - this could actually be useful in determining what voltage level the Arduino is attempting to emulate via PWM.

It takes time to charge and discharge the capacitor through the resistor; that's what smooths the signal level. How long does it take to charge the capacitor?
A rough rule of thumb is:
Charge time (seconds) = 4RC
So since you're currently using a 0.5uF cap and a 10k resistor, your charge time is:
4 * 10*10E+3 Ohms * 0.5*10E-6 Farads = 0.02 Seconds, or 20mS
Or, you could just match the decimal places up by dividing R by 1E6, which is a bit easier to calculate:
4 * .01 * .5 = .02 Seconds.

I suggest that you do not reduce R below 10k; otherwise you may exceed the current limits of your Arduino PWM output and permanently damage your device.
 
Top