Rectangular LEDS

Thats very neat: I like it. Its a cool trick to reduce both chip count and RPi pinouts in a single hit.

One question: what is the difference between an AHC and an HC part? And yes, I know this question shows just how long is is since I've done anything at the MSI chip level.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie
Loading thread data ...

If you switch the current sources as I suggested earlier, then the higher voltage for the LEDs cannot get back to the pi. You need opto-couplers if the supply for the LEDs and the supply for the pi have a voltage difference between their zero-volt outputs. Typically this would show up as an AC voltage, i.e. an earth loop, for example when the two supplies are in different buildings.

You would also need some form of isolation if the LED driver acted as a pull-up to a voltage higher than the GPIO output level - 3.3volts?

--
Alan Adams, from Northamptonshire 
alan@adamshome.org.uk 
 Click to see the full signature
Reply to
Alan Adams

On Fri, 28 Nov 2014 22:13:22 +0000 (UTC), Martin Gregorie declaimed the following:

My parts box is loaded with 74xx TTL chips (including a 7441; and I don't think I could now afford the Nixie tube to with it)-- the fanciest being LS series. C series were always the expensive static sensitive stuff

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/
Reply to
Dennis Lee Bieber

Usually power rail variations, i/p voltage tolerance, i/p thresholds, output drive capabilities.

I would use AHCT as that has minimum 2V input High threshold whatever the supply rail. This suits 3v3 devices which could be driving only at

2.9 to 3.1V

HC and AHC have input threshold depend on supply voltage level and these parts for driving multiple LEDs are better supplied on 5V excluding HC and AHC parts.

Driving the shift register on 5V rail not 3v3 means the amount of power drawn for LEDs and drivers (shift registers) is coming from the supply with more headroom as on model B there is only a recommended 50mA of 3V3 where is on 5V it is around 200mA or more depending on what USB devices etc. On the plus models I believe there is likely to be even more current on 5V rail.

--
Paul Carpenter          | paul@pcserviceselectronics.co.uk 
    PC Services 
 Click to see the full signature
Reply to
Paul

I was reckoning on building a PSU that can handle the display's current requirements together with the Pi. I think that means that if the RPi and LED driving circuitry have the ground and +5 rails in common there should no need for optocouplers etc.

BTW, I just discovered the PCF8574, loks as though can be configured to operate as an I2C slave plus 8 latches. Does using a set of three look like as good a solution to driving the LEDs through a set of individual constant current sources as I think it might be?

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

I'm not sure what you are looking for the addressable latch to do? It is only a latch which will allow you to expand your I/O ports of the rPi. You can only sink or drive up to 100 mA total which would be about

12 mA per I/O if all 8 LEDs are on at once. I suppose you could get twice current that if you connect 4 to be pulled down and 4 to be pulled up. This part is not designed to drive LEDs.

There are plenty of similar parts specifically designed to drive LEDs...

formatting link

--

Rick
Reply to
rickman

Yes, I know that. It would switch constant current sources that actually drive the LEDs. AFAICT the only one your search found that can do all this stuff would be the TLC59116, which is a neat chip but does have a downside: I'd need four of them (I need to drive 23 'logical' LEDs, but

12 of these contain 4 LEDS each, so each of the four rows on the display would need its own , while the PCF8574 would let me drive the four constant current sources for each light bar off a single output latch: the chips with built-in configurable LED drives won't do that.

All the other devices I looked at, e.g. the PCA9532, don't have constant current sources and would most likely need a lot of tweaking to balance the individual LED brightness *and* I'd still need a separate output per LED. Did get that wrong: If I set the same duty cycle and frequency for all the LEDs will they all have the same brightness? Other points: the TLC59116 comes in a VQFN-32 package: Is this purely for surface mount or is there a socket with somewhat bigger leads? There's no way I'll ever solder the 24 pads on this thing (5x5mm) by hand. BTW, this is another reason for using the PCF8574: it is available in a good old 16 pin DIP package. As this is a one-off, I'm quite prepared to use a bigger PCB and extra components (e.g. constant current sources) if it means that I don't need to lash for the special gear that seems to be required for even prototyping with surface-mount stuff.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

How many LEDS on at once?

If its only one, or four, use one (or four) constant current sources and switch the leds.

I'd be using transistor packs and resistors, or 'open collector' stuff here..

--
Everything you read in newspapers is absolutely true, except for the  
rare story of which you happen to have first-hand knowledge. ? Erwin Knoll
Reply to
The Natural Philosopher

I don't know what you are referring to. LED drivers will handle up to

16 LEDs in one chip. As to "constant current sources", I assume you mean something more complex than a resistor? Why? A voltage supply of sufficient level and a series resistor will set the current quite well.

I think maybe I don't understand fully what you are doing with all the LEDs.

If you set the currents the same for each one they will have very similar brightnesses.

Try the PCA9532 available in SO24 which is about as good as you'll get other than a DIP which are getting pretty rare these days.

If you just want something to drive a simple voltage output at low currents, you can drive all your LEDs from an MCU. You'll just have to program it up. The up side is you can still get DIPs from Microchip. Then you can use your current sources since the MCU won't handle the currents.

--

Rick
Reply to
rickman

OP. can you restate for the record

1/. How many bar graphs? 2/. How many LEDS per bar graph? 3/. How many LEDS need to be lit in each bar graph? 4/. If the Pi can hold the output pins steady, or of these states need to be latched?
--
Everything you read in newspapers is absolutely true, except for the  
rare story of which you happen to have first-hand knowledge. ? Erwin Knoll
Reply to
The Natural Philosopher

No more than 18 LEDs?

formatting link

But you can also drive up to 32 via x595 shift registers cascaded fairly easily

formatting link

needs 3 pins off the Pi. You can drive many more if you write your own code but I only use a 32-bit shadow register for those.

Using the mcp23s17/mcp23017 (spi/i2c) expanders - they're 16 pins each.

Just be aware of the total current draw permitted by those chips.

formatting link

And you can cascade these together if using wiringPi:

formatting link

Or 46 LEDs directly off a Pi:

formatting link

ok - that's cheating slighty...

17 off a Pi (no cheating, but breaking the rules a little)

formatting link

need more oommph, just use uln2803's.

etc.

Gordon

Reply to
Gordon Henderson

What the PCF8754 is not designed to drive LEDs?

From the PCF8574 data sheet:

"? Latched outputs with high current drive capability for directly driving LEDs"

I guess it's not then!

Reply to
mm0fmf

Assuming you mean the: PCF8574 -

The outputs are open-drain and the total current limit through the chip is 100mA - so 12mA per pin if evenly balanced.

Gordon

Reply to
Gordon Henderson

Yes, Doctor Typo paid a visit!

Indeed. But for someone to say and I quote "This part is not designed to drive LEDs" when the data sheet says "Latched outputs with high current drive capability for directly driving LEDs" then we have someone talking, what's the word I'm looking for, yes, bollocks. And I know it wasn't you that said it.

Reply to
mm0fmf

...

ity for

Just had a look at this one myself. It seems it will happily drive all 8 outputs to +- 25mA (so it can push as well as pull) and to exceed the packa ge dissipation you would have to be dropping 2V within the chip for each outpu t. As these appear to be switching outputs, not constant current you'd need a ser ies resistor or current control device anyway, so just do a static test on one output to check current output v chip voltage drop.

Incidentally, you can get more than adequate current control with just two transistors and two resistors - indeed, this combination can be directly switched so as to be the entire driver for a series string of LEDs

Finally, although LEDs have a fairly consistent light output for a given current, each one's voltage drop at that current can vary a surprising amou nt. Also this voltage is temperature dependent, so if you are running strings of them, resistors are likely to need to drop a lot of voltage to maintain consistency. With proper current control you can even work at less that a v olt 'spare'.

--
W J G
Reply to
Folderol

You only need 15 outputs not 23.

Reply to
mm0fmf

Yes, but that would require 59 LED drivers if each LED is driven by a separate output pin. This can be reduced to 23 outputs if all 4 LEDs in a light bar are connected in parallel (and requires 80mA from that pin assuming 20 mA per LED).

However, Alan Adams pointed out that doing that will look horrid because the LEDs will have different resistances and so will give an uneven brightness to each light bar. The solutions to this are to connect them in series, which will most likely need more than 5v to drive them, or to connect them in parallel and put each on a constant current source to ensure that each LED uses the same current.

Well, production spread says there will be a range of brightnesses, but how significant that will be remains to be seen: maybe connecting four in parallel exaggerates the brightness difference?

What's the pin spacing for S024? Big enough to get away with a standard electrical soldering iron and a roll of solder?

I've used proto boards designed for DIP packages in the past. These had continuous power and ground rails and rows of short patch lands for connecting to package pins and assume these are still around. I've also use a lot of Veroboard in my time.

Is there anything equivalent with suitable pad spacing for S024 prototypes?

MCU? Sorry, its not an acronym I know.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

Can be up to all 59: the original clock lights rows from the left so

08:32 would look like this (RRRR or YYYY for lit colour bar, y or r for lit rectangular LEDs, .... for off colour bar, . for odd rectangular LED

RRRR .... .... .... RRRR RRRR RRRR .... y y r y y r . . . . . YYYY YYYY .... .... Sum: 5 hrs*1 + 1hr*3 + 5mins*6 + 1min*2 = 8 hours 32 minutes

This is the way to original clocks works, but I'll also try lighting just one lamp per row to see how readable it is. This would give:

RRRR .... .... .... .... .... RRRR .... . . . . . r . . . . . .... YYYY .... ....

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

How do you calculate that?

Individually switching:

12 light bars with commoned up LEDs. 11 rectangular LEDs. == 23 Total outputs
--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

The display should look like this:

Row 1: RRRR RRRR RRRR RRRR Row 2: RRRR RRRR RRRR RRRR Row 3: y y y r y y y r y y y r y y y Row 4: YYYY YYYY YYYY YYYY

Where RRRR and YYYY respectively represent red or yellow light bars with four LEDs in each bar. These will most probably be 5x10mm light bars

r and y represent individual 5x2mm red or yellow individual LEDs.

12

4

Each colour bar is either all on or all off, so rows 1,2 and 4 represent four big blocks of colour. Each block is either on or off, but 0-4 blocks can be on at any one time.

Row 3 has 11 LEDs. Each is turned on or off independently and again 0-11 can be on at any one time.

So, there are 59 LEDs in the display but, if you look on each light bar as a single lamp, the display can be regarded as 23 lamps, i.e it can be controlled by 23 latches or switches.

At 00:00 all LEDs are off. During the day the number of ON lamps increases on average until at 23:59 all LEDs are on.

The display changes once a minute.

If each light bar can be tied to one RPi output pin, it can directly control the entire display with 23 output pins.

However, as I want the RPi to control some other stuff in the same room, I'd prefer to use fewer of its output pins. I think this requires the use of addressable latches.

Does this clarify things?

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.