LM3914 Dot/Bar Display Driver Question

I got some of these because I thought I could use it on a project I am working on as well as one on the drawing board. I will admit I haven't read the entire datasheet word for word but I have looked for the part that talks about how to pick which one of the 10 LEDs hooked up that I want lit and to what levle I want it lit (really bright or barely visible).From what I read I thought it could have 10 LEDs connected and light anyone of the 10 and to a certain degree of brightness. Maybe I was wrong. Anyway can anyone assist with how I can connect this via a picaxe and get it to light up LEDs to a desired brightness?

 

DATASHEET

I just skimmed over the

I just skimmed over the first 2 pages but it looks like it just takes an analog voltage on the sig pin so to adjust it with a micro you would need a DAC or PWM output. Unfortunately it doesn`t have any sort of communication like I2c in it.

I also have a couple of LED bar graphs but have been puzzling over the best way to get them running.

I figured that but it doesnt
I figured that but it doesnt say what value to send to make the brighter or dimmer and if you can pick 1 LED or you have to light all 10 up.

This chip compares an input

This chip compares an input voltage level to an internal voltage reference, and then lights the LEDs accordingly. So for example you could make a battery power level indicator.

The chip has a "bar" mode in which it lights each of the LEDs up to a certain point (depending on the input voltage), or "dot" mode in which it only lights one LED (again depending on teh input voltage).

It can work with individual LEDs or with a LED bar display. The brightness of the LEDs can be controlled by an external resistor.

Regards,

Andrew

I am quickly realizing it

I am quickly realizing it won’t fit my needs as I had envisioned. I wanted it to be able to make leds bright and fade without using a resistor because I don’t want a fixed brightness level. I wanted the chip to handle that. Which I know a picaxe can do that it can with only 2 pins and I need it to do 30 rows of leds.

http://www.trossenrobotics.co

http://www.trossenrobotics.com/store/p/3415-LED64.aspx appears to use a couple Allegro A6276 LED drivers.

"The LED drive current

"The LED drive current is determined by the user selection of a single resistor."

Still sounds like the brightness level is fixed and cannot be controlled on the fly. I want to be able to control a tri color LED (3 pins for red, blu, green) and have each color light up to a certain brightness to make whatever color I want.

So how do they use that chip
So how do they use that chip and still change brightness on individual LEDs on the Phidgets version linked?

It used PMW to do it. PICAXE
It used PMW to do it. PICAXE only has 2 pins capable of PMW. I would need 30 pins capable of PMW. There has to be a way even if I used a ton of transistors or digipots. I don’t mind doing a homebrew solution, but most I can think of would require way too many digipots and drive the cost way up.

I think you’re missing
I think you’re missing something. There is no chip on the Phidgets board that generates 64 or even 30 pins of PWM. There are 2 LED driver chips. Their update rate is 30 times per second, right about where persistance of vision comes in. If you turn on 1 LED on only 1 time out of 30 in a second, it appears somewhat dim. If it is on the whole 30 times per second then it appears full brightness.

I read that it used PWM in

I read that it used PWM in its documentation. I think I will try something home grown.

Here’s some basics on using

Here’s some basics on using LEDs. Sorry if this is all very well known to you already.

Every LED has a rated voltage drop and usually runs pretty brightly at 20 mA. You typically select a current limiting resistor based on your voltage supply. So if you have 4.5v supply, and an LED rated for a 2.2 V drop, whatever resistor you put in-line will get 2.3V. Check the specifications for your LEDs. Then use Ohms Law: V = I x R (voltage equals current in Amps times resistance in Ohms) to calculate the resistance you need.

Example: 2.2V / 0.02A = 110 Ohms

Each color in your tri-color RGB LED is actually a separate LED, with either a common cathode or a common anode. I assume you actually have 4 pins, right? You cannot put the resistor on the common pin, because each color LED will have a different voltage drop, and if you light more than one (on the same LED) at the same time, you’ll push too much current through and blow the LED. The voltage drop for your red LED might only be 2.0V, while the green and blue LEDs might drop 3.5V. So each pin needs it’s own dedicated resistor.

To adjust the brightness, I can think of three methods. The first (already discussed) is to pulse the LEDs at some frequency so they effectively appear dimmer. Calculate the resistor for the maximum current if it was on all the time, and scale the frequency of pulses using PWM or some other method. If you aren’t taking that approach, you need to either vary the (1) the voltage supply across the LED/resistor combo or (2) the value of the resistor itself.

Varying all those resistors sounds like a chore. So you either have to come up with a method to vary the supply voltage to the LEDs, or use the PWM technique.

Do you need to be able to dim each LED individually or just have one control that affects the brightness of the entire display?

To sum up 10 rows and 10

To sum up 10 rows and 10 columns of tri color LEDs (need to be able to vary the brightness for 30 “pins” 10 rows times 3 colors per row).

Method 1 pulse the LEDs: this is possible but since I have 10 rows and 10 columns is 100 LEDs this would be very difficult to keep track of. Possible is I could use 100 variables with a code in each one and then have the code cycle through the variables and blink them as needed.
Method 2 Varying the supply voltage: isnt possible since LEDs on various rows may be different colors so they can’t have different supply voltages.
Method 3: I didnt see method 3 in your post.

I am thinking method 1 is my best shot but it will be hell to code.

OK, I think I understand

OK, I think I understand what you want, and I agree that method 1 is your best shot. The only things I’m not sure of are:

1) Do you need brightness control over each individual LED, row by row, or just one just the ability to dim the entire display?

2) Would you ever have more than one color turned on at the same time in the same LED (e.g., both red and blue lit on one LED to make purple)?

Anyway, varying the voltage may be possible. In case you need it as a fall back, but mostly just to geek out and explain the idea, here’s how.

You would need a bunch of resistor networks, totaling 300 individual resistors. Each of the color control pins on each LED needs its own resistor. I don’t know the specs of your LEDS, but let’s say they are like these: http://www.superbrightleds.com/TriColor%20LED.htm

The red color has a 2.0V drop (called Forward Voltage). Green and blue have 3.5V drops.

If your power supply is 4.5v, and you want a decent brightness at max, then 20mA current is a good spot to calculate for.

The resistors connected to the red leads on your LEDs will have 2.5V across them (4.5V supply - 2.0V drop from LED). So to get the desired 20mA current, you need:

2.5V / 0.02 A = 125 Ohms

The resistors connected to the green and blue leads on your LEDs will have 1.0V across them (4.5V supply - 3.5V drop). So to get the 20mA current you need:

1.0V / 0.02 A = 50 Ohms

Assuming you are only going to turn on one color at a time for each individual LED, your max current for the display is 2.0A (100 LEDs lit at once).

Now if you were able to lower the voltage supplying the display, the current will be less and LEDs will be less bright. For example, drop the supply for the display to 4.0V. Now the resistors connected to the blue and green LEDs only have 0.5Vacross the. The voltage across the LEDs themselves stays constant. So blue and green LEDs now have 10mA of current (0.5V / 50 Ohms). You’ll have to play with your LEDs to determine the current that provides the minimum and maximum brightness you desire.

With the supply dropped to 4.0V, the red LEDs should be running at 16mA, so they would run dimmer than before, but less bright than their green and blue cousins. Therefore, you would probably need a separate voltage control for the red portion of your LEDs, but green and blue might share a supply, depending on their relative intensities at any given current.

I’m totally new to microcontrollers for robots. My first Picaxe board is on order. So I don’t know if is easy or hard to vary the voltage of an output control pin. However, if you can, it would seem to be pretty easy to implement the solution above.

This was mainly a thought experiment for me. Your conclusion that method 1 (PWM) is difficult but the best solution is probably correct.

Good luck. I can’t wait to see how your idea turns out.

Regards,

Andrew

I understand what you are
I understand what you are saying the problem I am trying to solve is I am going to put the cathodes into columns and the anodes into rows for a 10x10 LED grid. 30 anodes (1 for each color per row) and 10 cathodes. since the Anodes are in rows and the cathodes in columns I can light up a specific LED by applying voltage to the entire row and grounding the column. The problem is PICAXE only has 2 pins that can utilize hardware PWM. This means I would need 15 PICAXE which is insane. Software PWM is a possiblity but keeping track of 30 anode pins may be tough unless I can use 300 different variables and loop through the values to figure out if they should be flashed or not. Possible but it will be fun to do using software. Of course I will use resistors to keep the LEDs from blowing, but in order to keep from having to use way too many batteries the LEDs need to be able to flash fast enough to look like they are on and light solidly when they aren’t. Im sure it will chew through batteries :wink:

**More and more interesting. **

More and more interesting. It is starting to remind me of an computer monitor or TV, where you have a defined number of rows and columns, and a scan rate across the rows. In your case you could scan across the columns to ground the cathodes in sequence, then time which LEDs you want lit on each row. You would have to run the scan at a pretty fast rate. I wonder if you could adapt an LCD controller or some other similar IC, or at least use some programming techiniques based on TV or monitor behavior.

Maybe that’s what you’ve been thinking all along, and I’ve just caught up. ; j

Regards,

Andrew

A couple of other quick

A couple of other quick thoughts on a hardware approach to this. There some LED display driver ICs like the one below that may be able to handle what you want, and they can interface to a PIC microcontroller.

http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3540

The brightness of the chip above is controlled by a single external resistor. You could try a digitally controlled potentiometer, so you can vary the value of the resistor through software.

Again, good luck!

Andrew

Ok, ya cauht me on the

Ok, ya cauht me on the Phidgets docs while I was reading the driver docs. The A6276 driver does adjust the current based on the resistor it has connected to the single Rext pin. That still indicates that only 1 PWM (per chip) is being used to control 16 outputs, which they’ve multiplexed to 32 outputs (per chip).

It appears that 16 bits can be clocked in, latched, and then output. When the output occurs, all 16 will get the same current based on the resistance at Rext (which is probably simulated with PWM on the Phidgets board). Again, since data can be clocked in at up to 20 MHz, it is not a difficult task to quickly switch to other LED patterns and PWM levels to make each LED appear to have it’s own brightness.

What I was trying to recommend to you was using the driver chip in your own board, not using the Phidgets board.