300 mA from a microcontroller pin

Maybe I have lost sight of what you are looking for. I don't see how this circuit can light both LEDs in the package. That is, I don't see how the shift register can pull the LED pin high to light the bottom LED in each package.

Ah, I see what you are doing. You are using the shift register to "enable" a column and driving each row to light up all LEDs in the selected column. I would do this differently. I would use the push- pull driver on the shift register outputs since you have no way to tristate them. Then I would use a driver on the rows to "enable" one row at a time. To do this you need to do two things...

1) Swap the transistors in the push-pull row drivers so that they are in the emitter follower configuration and remove the resistors between the drivers and the MCU. This will allow the row driver outputs to float when the input from the MCU floats. It also prevents the transistors from saturating and give you a 0.7 volt drop when driving. Since the row drivers are only driving with a 1/6 duty cycle the power is 1/6 * 0.7 * 300 mA or 35 mW. The 0.7 volt drop will be useful for item 2... 2) If you float the row line, there is a sneak path between two columns through two LEDs. The current through this path will be small since the LED voltage drops are double the intended path, but it may be enough to light up. So you need to reduce the driving voltage to something below 4 volts. The row driver will drop about 0.7 volts and the column driver will drop another few tenths of a volt depending on the device selected. So this puts you in the 4 volt ballpark. But if your power supply is a little high and the column driver has a low saturation voltage, you may still get enough current to light the LEDs, especially since the sneak current can be full time while the intended current is only 12% duty cycle or so. So you might want to add a diode between the 5 volt supply and the high side drivers. This will drop your LED driving voltage to around 3.3 volts. So you need to resize your current limiting resistors and, of course, move them from the row to the column. The extra diodes may not be needed, you can try it both ways.

I spent about 15 minutes thinking about this and did not test anything I have said, so I may have overlooked something important. But at first pass this looks good to me. Do you see any problems with it?

One last thought... 300 mA may be a bit high. With a 1/6 duty cycle, the average current is 50 mA. Shouldn't that be a lower drive current to get your 30 mA?

Reply to
rickman
Loading thread data ...

After looking over your JPG schematic, it seems that you may have a problem using two pins per channel. One way to handle this---at the cost of a lot of research on transistor characteristics might be:

+5V +5V | | 10K |---P-Chan | | | P1.1-----------------| |------------- Output | | | 10K |---N-Chan | | GND GND

If you can select the P-Chan and N-Chan transistors such that they are off with 2.5V gate voltage and On with 5V gate voltage then you could get your Hi/Low/OFF behavior at the output. Note that this is an inverting driver, so adjust your P1.1 level as appropriate.

Of course, if you get the wrong transistors, or mismatched thresholds, you'll let the magic smoke out of the transistors. ;-) For this reason, you might want to add two current-limiting resistors between the P-channel N-Channel transistors and the output.

Mark Borgerson

Reply to
Mark Borgerson

... snip ...

Ignoring total dissipation, a single tri-state driver will do:

+5 | R1 | tri state here >---|X|-----+ LED | R2 | GND

with R1 approximately equal to R2. The ratio controls brightness.

--
 Chuck F (cbfalconer at maineline dot net)
   
   Try the download section.
Reply to
CBFalconer

This only works if the Vg cutoff is more than 2.5v. I've tried all sorts of these types of drivers, and they just don't work. For MOSFETs, the Ids at Vg=2.5v (or even 1.65v) is too much - both transistors conduct. For NPN/PNP pairs, the Ibe leakage causes both transistors to be on no matter what.

If you knew you were working with 5v (I was working with 3.3v) you could use 2.5v zeners to make your "floating" Vgs close enough to zero to keep the mosfets off, but you'd need a second stage to do level shifting.

Here's one half, as an example:

+5v | +5V zener | | 10K |---P-Chan *---------- | | | | P1.1-----------------* *-----N-Chan | | | 10K 10K | | | | GND GND GND

Alernately, use a single op-amp follower to produce a regulated 2.5v reference, and tie the first stage sources to that.

+5V | 10K | *-------|+\ | | >---*---- 2.5v 10K *-|-/ | | | | GND `--------'
Reply to
DJ Delorie

... snip ...

That won't be stable with 300 mA loads switching on and off.

--
 Chuck F (cbfalconer at maineline dot net)
   
   Try the download section.
Reply to
CBFalconer

You sure about that?

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

If you replace R1/R2 with the 1/2 Vcc op-amp circuit I posted earlier, you can use a single resistor in series with the LED and reduce the "off" leakage current.

Reply to
DJ Delorie

The simple NPN/PNP buffers will auto-quasi-tristate, provided you can disable any pullups on the uC port (ie truly float the port). There will be some turn-off delays, so allow some dead time between column selects would help. A resistor from B-E would help reduce those delays. 2k2 ~ 4k7 region.

You only show one column drive polarity, but there are trimmed lines on the drawing so I presume there is a similar PNP drive scheme, and hence your 1:16 duty cycle.

A better shift register choice would be one with a latch, and OE, so you can drive only ONE device, and control dead-times. Look at HC4094, or HC595 devices. A HEF4094 has lighter drive, so you could go straight to the darlington bases with that.

The darlingtons will need to be large, as the column resistance should be much less than the series R's, to avoid unwanted brightness modulation effects.

-jg

Reply to
Jim Granville

That is actually a very elegant solution. It only requires a single op-amp for the entire array, provided it can handle the current of multiple LEDs at a time. Or you can use an op-amp for each channel. But it does not directly provide for the multiplexing the OP wants. However, I don't see your original post, so maybe you have a way of dealing with that.

What is required is a switch between the LED and the 1/2 Vcc voltage source output. I expect you could find an op-amp with a disable that cuts off all output current, no? Then the only issue I see is the fact that you will only have 2.5 volts to drive the LED. At the high current the OP wants, there may not be enough head room to adequately control the current with a load resistor. Or the LED voltage may be higher than 2.5 volts limiting the max current. But with a slightly higher Vcc, this is an excellent idea.

Reply to
rickman

Given a 2.0V forward drop across the LED, for 300mA, you need R1 and R2 to be about 10 ohms.

So power dissipation in each resistor is going to be about

0.9Watts---better use fairly large resistors!!! ;-)

My circuit at least had the advantage that there is no power dissipation when the LED is off.

Mark Borgerson

Reply to
Mark Borgerson

Neither circuit will work particularly well if the Vf of the LEDs is close to (or greater than) Vdd/2 at the desired operating point.

;-)

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Relative brightness (between colors). Ohms controls overall level.

--
 Chuck F (cbfalconer at maineline dot net)
   
   Try the download section.
Reply to
CBFalconer

Yes, but I wouldn't trust the op-amp output impedence, especially with sharp on/off pulses at 300 mA and relatively high frequency. That requires a pretty good op-amp.

--
 Chuck F (cbfalconer at maineline dot net)
   
   Try the download section.
Reply to
CBFalconer

Good point. This make DDJs op-amp circuit, and the expense for a quality op-amp involved, look much more reasonable, especially since that will handle multiple LEDs. In my circuit with R1 = R2 = R the effective impedance is R/2 hooked to 2.5 V. A capacitor at the junction will foul the whole circuit.

--
 Chuck F (cbfalconer at maineline dot net)
   
   Try the download section.
Reply to
CBFalconer

Or a big capacitor, like any good power supply.

Reply to
DJ Delorie

What do you mean by "won't be stable"? Are you saying it will oscillate? Or do you just mean the output voltage will vary a bit at the transitions, just like any power supply? Since there will be any number of devices drawing 300 mA at any given time and this current can be drawn by different devices all the time, it would be much more efficient to use a switching regulator to generate the 2.5 volts. Then the output voltage will be maintained very stably, even on 300 mA transients.

But I don't think this circuit can work with many LEDs at 5 volts. I believe the LED forward drop will be high enough that 2.5 volts will not be enough to drive it and a current limiting resistor. Instead it would be better to use 6 volts and 3 volts... or just use a different circuit that has an H bridge on both ends of the LED, one with a tristate output. Then you actually will do better with a lower voltage, 4.0 volts or below, in order to limit the current through the sneak path.

Reply to
rickman

At the risk of derailing a large number of thought trains, and admitting I haven't followed every detail of this discussion, I do have one question I;'d like to toss in here.

Two-lead Red/Green LEDs are really neat things. They're incredibly handy for monitoring polarity of the voltage applied to small DC motors (a.k.a. which way the robot will run ), but, as the discussion here shows, they're tricky to handle in large numbers. The op does not appear to be all that familiar with electronic circuits, and suggesting highly complex solutions to his problem worries me a bit.

Is there a point where it would be easier/simpler/faster/cheaper to put up two LEDs side-by-side and drive them using separate RED and GREEN grids?

The good thing is that this would reduce the problem down to two copies of "known problem, lots of solutions". Is there something I missed in the discussion that would prevent this approach?

If you put a bit of translucent plastic over the pairs it might even wind up looking just as pretty as a single-LED solution.

-- The world is divided into two groups of people: Those to whom "No user serviceable parts inside" is a warning, and those to whom it is an open challenge and provocation!

-- Frank McKenney, McKenney Associates Richmond, Virginia / (804) 320-4887 Munged E-mail: frank uscore mckenney ayut mined spring dawt cahm (y'all)

Reply to
Frnak McKenney

Frnak McKenney wrote: [snip...snip...]

I think that what is driving (no pun intended) the OP towards using a bi-directional LED is the appeal of being able to dedicate a single I/O pin to establish the color, with high Z as off.

Not to mention that three-lead common cathode red-green LEDs are widely available, along with most other color pairs and quite a few with three colors in a single package with a common cathode.

I agree, though, that the three-lead/bi-color approach seems like it would be more straightforward to implement.

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

Depends on the restrictions the OP has.

As a general comment, when you move to 5x7 Dot matrix devices, and go BiColour, they often choose the 'three lead' approach - there is room in the package for the leads, and it may be their customers push to the simpler-drive solution.

Example is HDSP-B51Z etc

I think you also get easier/smoother colour blending, as this also allows Linear-Current-Sink LED Device drivers ( MAXIM et al )

Reply to
Jim Granville

Or his advisor handed him a bag of R-G LEDs and a pre-etched and pre-drilled PC board. For someone just beginning to be familiar with data sheets either would tend to "tilt" one's thinking.

Ah! Thanks -- I had completely forgotten about those, even though I have a bunch around here somewhere, left over from an order where I thought I was getting a really good deal on the two-lead type.

Yup. Ever notice how much more fun it is to make suggestions about how someone _else_ should solve a problem when we don't have to do it ourselves?

In any case, even if the project never works, it will provide the OP with a valuable learning experience (in the sense of Dr. Douglas Bergren's "95 Theses on Education", which included this memorable item: "Even an impoverished sex life can be educational." ).

-- An education isn't how much you have committed to memory, or even how much you know. It's being able to differentiate between what you do know and what you don't.ÿ -- Anatole France

-- Frank McKenney, McKenney Associates Richmond, Virginia / (804) 320-4887 Munged E-mail: frank uscore mckenney ayut mined spring dawt cahm (y'all)

Reply to
Frnak McKenney

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.