Go Down

Topic: LM3914 with arduino. Wiring and explaination. (Read 4685 times) previous topic - next topic

mellink

Dec 16, 2010, 10:58 pm Last Edit: Dec 16, 2010, 11:01 pm by mellink Reason: 1
Hey,
i'm wating to drive about 20 Leds from a output on the arduino using 2 LM3914.
Problem is I don't really understand the wiring or which equation relate to what. Which resistors i change and what that effects. I would rather understand than just be told if possible.

I have a 12V supply and can obveously make that to 5V if thats more practical.

Question is how do the resisots effect things? How do i know what change in voltage lights up how many LED's? Would 50% PWM from the arduino board = 2.5V?

Any help as I cant really understand the datasheets.
http://www.national.com/ds/LM/LM3914.pdf

Thanks Rob

biocow

http://www.youtube.com/watch?v=Ww87KVy-J6Q

Upper line is 5v, lower is zero. You can't get 2.5 out of a digital pin. But the PWM kind of "tricks" you into seeing the LED lit up half way by turning it on and off really fast.
10 PRINT CHR$(7)
20 GOTO 10

mellink

yh i get PWM, but can i use with with the LM3914 to drive its input? Will it work or will the IC see it as 0V and 5V instead of a 0---5V?

Thanks Rob

jackrae

The LM3914 might not be the ideal way to drive LEDs from an arduino.  It is a complete A-to-LED driver unit designed to take an analogue input (say 0 to X volts) and drive a range of 10 LEDS with LED1 lighting at 0.1X, LED2 at 0.2X etc with LED10 lighting at X

The output of the arduino is a PWM 5 volt signal.  If you want to create a 0-5 analogue voltage from that to control the 3914 you'll have to create an R-C smoothing system and then use that smoothed output to drive the LM3914.  Generally the 3914 switching of LEDs is not hard-off to hard-on, there is a sort of deadband where the LEDs go through a transition range from off to on.  As the input moves from one transition point to the next, the next LED starts to glow dimly and isn't full on until the cross-over deadband has been exceeded.

You might be better to use a couple of binary LED drivers to drive 16 LEDs.  That way you switch the LEDs under software control and each will be either full off or full on. If you really need 20 then use 3 driver units.

jack

mellink

how would i go about smoothing it? ( I may want to remove the arduino at some point and just hard wire it )

can you suggest a suitable IC for the binary controller version? how many pins would that use on the Arduino? trying to save as many pins as possible as I wont have many spare at the end of this project.

Thanks Rob

biocow

Easiest way to drive LEDs is with a shift register. Only uses up 3 pins. http://www.arduino.cc/en/Tutorial/ShiftOut

10 PRINT CHR$(7)
20 GOTO 10

mellink

ok so 3 pins and stackable.
Sounds like a good comprimise to me :-)
Thanks Rob

mellink

looking at prices £13 for one driver. as apposed for £5 for 2 of the anolog ones.

Is there a alternative to the STP16C596?? ?

Thanks Rob

pelletta

Hi and sorry for my poor english, I'm italian.
It is possible to wire LM3914 to drive leds with arduino, I've used them for my little project (sorry for bad image quality, I'll post some video when I'll finish my work):

LM3914 does not like pwm as input so I have put a low pass filter on the arduino pwm output and it works great (a 100K resistor and a 1uF capacitor between arduino pwm pin and LM3914. I'm a beginner in elecroinc and scripting so these values may be wrong... forgive me if I'm in fault  ;)
However shift registers are better to drive leds even if they require 3 pin to work against one of LM3914, they are less expensive  ;)
Greetings from Italy,
Pelletta

Graynomad

#9
Dec 17, 2010, 06:25 am Last Edit: Dec 17, 2010, 06:28 am by graynomad Reason: 1
Quote
Is there a alternative to the STP16C596?? ?


Try

STP16CP05
TLC5916/7
TLC5926/7

I don't know about the prices, but these don't need resistors for every LED.

Quote
However shift registers are better to drive leds even if they require 3 pin to work against one of LM3914


That's right, especially as your 3 pins can drive any number of LEDs, 100s of needed.

______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

mellink

I think that picture looks like something from Knight Rider :-) Love it :-)

mellink

would a low pass filter work? are you sure?

mellink

would this be a suitable IC?

http://proto-pic.co.uk/products/Shift-Register-8%252dBit-%252d-74HC595.html


I think with this one I would have to use resitors to drive the LED's. Can anyone find one i can get in the UK easily? adn less than £12 for one IC + P&P

Thanks Rob

Graynomad

#13
Dec 17, 2010, 10:38 am Last Edit: Dec 17, 2010, 10:48 am by graynomad Reason: 1
The 74HC595 is not suitable for driving LEDs, it can only sink 6mA.

I repeat

STP16CP05 £1.51
TLC5916  £0.83  DIP package
TLC5926 out of stock but £1.04

from http://uk.farnell.com (don't know about P&P though)

and you don't need resistors, what's not to like?

______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

mellink

sorry did a quick search and could find any of the 3 above so i was looking for a alt. And the one I added was used in a Arduino with a 8 segment display.
thanks for the help rob

Go Up