<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Driving a Bicolor LED from a Single Output Pin</title>
	<atom:link href="http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=151" rel="self" type="application/rss+xml" />
	<link>http://www.neufeld.newton.ks.us/electronics/?p=151</link>
	<description></description>
	<lastBuildDate>Sun, 08 Dec 2024 17:19:24 -0600</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: James McDaniel</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=151&#038;cpage=1#comment-26801</link>
		<dc:creator>James McDaniel</dc:creator>
		<pubDate>Wed, 29 Dec 2010 17:23:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=151#comment-26801</guid>
		<description>Oh yea, I forgot to say that the main advantage of this circuit is that it allows one output pin to give give a three-state output.  That is, the one bit can operate either of the two LED&#039;s but can also turn them both off by setting the output to Hi-Z (floating).  Pretty cool, huh?  :)

BTW, when I breadboarded it, I used a bipolar instead of the MOSFET and it worked fine.  I was easily able to EITHER turn on the green LED, turn on the red LED, or turn them both off, with just one output pin (provided the output pin could be set to Hi-Z, which almost any MCU can do these days).  However, as I&#039;m not the author, I can&#039;t answer any other questions.

Good luck!</description>
		<content:encoded><![CDATA[<p>Oh yea, I forgot to say that the main advantage of this circuit is that it allows one output pin to give give a three-state output.  That is, the one bit can operate either of the two LED&#8217;s but can also turn them both off by setting the output to Hi-Z (floating).  Pretty cool, huh?  <img src='http://www.neufeld.newton.ks.us/electronics/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>BTW, when I breadboarded it, I used a bipolar instead of the MOSFET and it worked fine.  I was easily able to EITHER turn on the green LED, turn on the red LED, or turn them both off, with just one output pin (provided the output pin could be set to Hi-Z, which almost any MCU can do these days).  However, as I&#8217;m not the author, I can&#8217;t answer any other questions.</p>
<p>Good luck!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James McDaniel</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=151&#038;cpage=1#comment-26800</link>
		<dc:creator>James McDaniel</dc:creator>
		<pubDate>Wed, 29 Dec 2010 17:14:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=151#comment-26800</guid>
		<description>Hello,

I downloaded this &quot;one bit - two LED&quot; schematic and description a couple years back because I thought it might be useful one day, but I have completely forgotten where I got it from or whose work it is.  Maybe someone else interested can google it and find out.  It is certainly NOT my work, so I don&#039;t claim credit, nor can I comment on it or answer any questions.  I just thought it might be helpful for this thread.   The text is below the dashed line.  Here is a link to the schematic.  I don&#039;t have any web space, so I stuck it on my yahoo photos page:

http://pulse.yahoo.com/_ZOQB4FGXO5ZH752O73MPYLXG2Y/album/photos/316026/in/430449

Good luck,
James

-----------------------

Using discrete components, another circuit offers an inexpensive approach that avoids the other circuits&#039; disadvantages (see diagram). When the microcontroller&#039;s output port goes high, current flows through the green (upper) LED, R2, D2, and FET Q2, which the port&#039;s high level turns on. When the microcontroller&#039;s output port goes low, transistor Q1 turns on and delivers current to the port pin through R2 and the red (lower) LED. The circuit operates symmetrically because silicon diode D2&#039;s forward-voltage drop is present regardless of whether the microcontroller&#039;s port pin goes high or low. VCC may vary during operation but must remain higher than 3V.

You can individually adjust the LEDs&#039; currents to equalize brightness or compensate for a difference between the microcontroller&#039;s power-supply voltage and the LED-driver circuit&#039;s VCC. Replace R2 with two resistors connected in series between Q1&#039;s emitter and D2&#039;s anode. Connect the midpoint of the two resistors to the LEDs.

With the microcontroller&#039;s port pin configured as an &quot;input with pullup,&quot; the port delivers a small current to the green LED. However, pullup-resistor values of 22 kO or higher do not cause misleading light output from LEDs in the off-state. When the input signal from the port pin floats—that is, with VCC at 5V and the port configured as an input with no pullup resistor—the circuit draws no additional current, and the quiescent current, which R1 determines, averages less than 100 µA.</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I downloaded this &#8220;one bit &#8211; two LED&#8221; schematic and description a couple years back because I thought it might be useful one day, but I have completely forgotten where I got it from or whose work it is.  Maybe someone else interested can google it and find out.  It is certainly NOT my work, so I don&#8217;t claim credit, nor can I comment on it or answer any questions.  I just thought it might be helpful for this thread.   The text is below the dashed line.  Here is a link to the schematic.  I don&#8217;t have any web space, so I stuck it on my yahoo photos page:</p>
<p><a href="http://pulse.yahoo.com/_ZOQB4FGXO5ZH752O73MPYLXG2Y/album/photos/316026/in/430449" rel="nofollow">http://pulse.yahoo.com/_ZOQB4FGXO5ZH752O73MPYLXG2Y/album/photos/316026/in/430449</a></p>
<p>Good luck,<br />
James</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Using discrete components, another circuit offers an inexpensive approach that avoids the other circuits&#8217; disadvantages (see diagram). When the microcontroller&#8217;s output port goes high, current flows through the green (upper) LED, R2, D2, and FET Q2, which the port&#8217;s high level turns on. When the microcontroller&#8217;s output port goes low, transistor Q1 turns on and delivers current to the port pin through R2 and the red (lower) LED. The circuit operates symmetrically because silicon diode D2&#8242;s forward-voltage drop is present regardless of whether the microcontroller&#8217;s port pin goes high or low. VCC may vary during operation but must remain higher than 3V.</p>
<p>You can individually adjust the LEDs&#8217; currents to equalize brightness or compensate for a difference between the microcontroller&#8217;s power-supply voltage and the LED-driver circuit&#8217;s VCC. Replace R2 with two resistors connected in series between Q1&#8242;s emitter and D2&#8242;s anode. Connect the midpoint of the two resistors to the LEDs.</p>
<p>With the microcontroller&#8217;s port pin configured as an &#8220;input with pullup,&#8221; the port delivers a small current to the green LED. However, pullup-resistor values of 22 kO or higher do not cause misleading light output from LEDs in the off-state. When the input signal from the port pin floats—that is, with VCC at 5V and the port configured as an input with no pullup resistor—the circuit draws no additional current, and the quiescent current, which R1 determines, averages less than 100 µA.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregg</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=151&#038;cpage=1#comment-26796</link>
		<dc:creator>Gregg</dc:creator>
		<pubDate>Wed, 29 Dec 2010 03:32:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=151#comment-26796</guid>
		<description>I believe I did. As for part availability, I believe that it might be from one of three suppliers here in the US. But I am not sure which ones.

Not really about polarity, the SN74125 and SN74126, are the same quad tri-state buffer, but the line that sets the ability of the buffer is the difference. the SN74125 is inverted, and the SN74126 isn&#039;t.

I&#039;ve also used two buffers of six on a SN74367 to do the same thing. In fact that&#039;s my next step. To use the six of that chip to drive three LED units.</description>
		<content:encoded><![CDATA[<p>I believe I did. As for part availability, I believe that it might be from one of three suppliers here in the US. But I am not sure which ones.</p>
<p>Not really about polarity, the SN74125 and SN74126, are the same quad tri-state buffer, but the line that sets the ability of the buffer is the difference. the SN74125 is inverted, and the SN74126 isn&#8217;t.</p>
<p>I&#8217;ve also used two buffers of six on a SN74367 to do the same thing. In fact that&#8217;s my next step. To use the six of that chip to drive three LED units.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Neufeld</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=151&#038;cpage=1#comment-26793</link>
		<dc:creator>Keith Neufeld</dc:creator>
		<pubDate>Wed, 29 Dec 2010 02:41:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=151#comment-26793</guid>
		<description>Jin, I didn&#039;t know there was such a thing as a rail splitter IC.  Very nice!  Thanks for the education!</description>
		<content:encoded><![CDATA[<p>Jin, I didn&#8217;t know there was such a thing as a rail splitter IC.  Very nice!  Thanks for the education!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jin</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=151&#038;cpage=1#comment-26792</link>
		<dc:creator>Jin</dc:creator>
		<pubDate>Wed, 29 Dec 2010 02:33:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=151#comment-26792</guid>
		<description>Gregg, that&#039;s an inverting buffer, right? The article I linked to above had a circuit that used an inverter. Sadly, it no longer appears to be available. I think you can do what you want by having your pin drive the input of an inverter and hooking up the LED (in series with a current limiting resistor) in parallel to the input and output of the inverter. When the pin goes high, the inverter output goes low and current flows one way. When the pin goes low, the inverter output goes high and current flows the other way. There is no way to turn it off in this manner. This assumes your pin can supply enough current for your LED, otherwise you will have to add a non-inverting buffer or transistor to supply the current.

I would recommend using a circuit similar to the one Keith outlined above. Here is an example: 

http://dl.dropbox.com/u/3845046/intervalometer.png

The LED driver is the lower half of the diagram. The voltage drop of the LED plus one of the zener diodes must be less than VCC. (The LED in the diagram is intended to be a bicolor LED of the &quot;back to back&quot; sort.)

You can also use a rail splitter chip instead of the resistor divider in Keith&#039;s last circuit, which gives you the same circuit but with much less wasted current.</description>
		<content:encoded><![CDATA[<p>Gregg, that&#8217;s an inverting buffer, right? The article I linked to above had a circuit that used an inverter. Sadly, it no longer appears to be available. I think you can do what you want by having your pin drive the input of an inverter and hooking up the LED (in series with a current limiting resistor) in parallel to the input and output of the inverter. When the pin goes high, the inverter output goes low and current flows one way. When the pin goes low, the inverter output goes high and current flows the other way. There is no way to turn it off in this manner. This assumes your pin can supply enough current for your LED, otherwise you will have to add a non-inverting buffer or transistor to supply the current.</p>
<p>I would recommend using a circuit similar to the one Keith outlined above. Here is an example: </p>
<p><a href="http://dl.dropbox.com/u/3845046/intervalometer.png" rel="nofollow">http://dl.dropbox.com/u/3845046/intervalometer.png</a></p>
<p>The LED driver is the lower half of the diagram. The voltage drop of the LED plus one of the zener diodes must be less than VCC. (The LED in the diagram is intended to be a bicolor LED of the &#8220;back to back&#8221; sort.)</p>
<p>You can also use a rail splitter chip instead of the resistor divider in Keith&#8217;s last circuit, which gives you the same circuit but with much less wasted current.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregg</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=151&#038;cpage=1#comment-26791</link>
		<dc:creator>Gregg</dc:creator>
		<pubDate>Wed, 29 Dec 2010 01:47:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=151#comment-26791</guid>
		<description>Hello!
An excellent idea. But what about using either a SN74125 (Or SN74LS125) or a SN74126 (Or SN74S126) to drive the device?

And that&#039;s the circuit guide I am trying to find. I know the LED gets placed between two buffers and the way the enable lines are driven causes the right colors to be seen. It&#039;s how to drive them that&#039;s causing me to be something of a frustration experience specialist.</description>
		<content:encoded><![CDATA[<p>Hello!<br />
An excellent idea. But what about using either a SN74125 (Or SN74LS125) or a SN74126 (Or SN74S126) to drive the device?</p>
<p>And that&#8217;s the circuit guide I am trying to find. I know the LED gets placed between two buffers and the way the enable lines are driven causes the right colors to be seen. It&#8217;s how to drive them that&#8217;s causing me to be something of a frustration experience specialist.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Neufeld</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=151&#038;cpage=1#comment-22297</link>
		<dc:creator>Keith Neufeld</dc:creator>
		<pubDate>Tue, 07 Oct 2008 14:19:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=151#comment-22297</guid>
		<description>Jin, I had looked at the circuits when you posted, but hadn&#039;t completely figured them out yet.  I&#039;m glad you had time to go through them some more.

That&#039;s a good analysis of the Zener circuit!  A couple things to beware of:

&lt;ul&gt;
&lt;li&gt;Many newer LEDs have a forward voltage drop V&lt;sub&gt;D&lt;/sub&gt; &gt; 2.5V, so this wouldn&#039;t work on a 5V supply.  (That&#039;s just a corollary to what you already said.)&lt;/li&gt;
&lt;li&gt;The smaller the voltage margin and resistor, the more impact slight manufacturing and thermal-related variations in V&lt;sub&gt;D&lt;/sub&gt; are going to have.  So if you have a bank of lights and want them at even brightness (when lit), better to increase the supply voltage so you have more headroom.&lt;/li&gt;
&lt;/ul&gt;</description>
		<content:encoded><![CDATA[<p>Jin, I had looked at the circuits when you posted, but hadn&#8217;t completely figured them out yet.  I&#8217;m glad you had time to go through them some more.</p>
<p>That&#8217;s a good analysis of the Zener circuit!  A couple things to beware of:</p>
<ul>
<li>Many newer LEDs have a forward voltage drop V<sub>D</sub> > 2.5V, so this wouldn&#8217;t work on a 5V supply.  (That&#8217;s just a corollary to what you already said.)</li>
<li>The smaller the voltage margin and resistor, the more impact slight manufacturing and thermal-related variations in V<sub>D</sub> are going to have.  So if you have a bank of lights and want them at even brightness (when lit), better to increase the supply voltage so you have more headroom.</li>
</ul>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jin</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=151&#038;cpage=1#comment-22283</link>
		<dc:creator>Jin</dc:creator>
		<pubDate>Sat, 04 Oct 2008 08:48:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=151#comment-22283</guid>
		<description>Okay, I&#039;ve thought about it more, and I think I understand what technique #2 from that article is doing. It adds two zener diodes in between the two resistors of the voltage divider. If you select diodes with appropriate Zener voltages (&gt; V+/2 but &lt; V+ - VLED), you should get no current loss through the divider at all. At 5V, that doesn&#039;t leave you much voltage to play with, but you can use as small a resistor as needed to get the current you want without worrying about losses. All the current flows through the LED.</description>
		<content:encoded><![CDATA[<p>Okay, I&#8217;ve thought about it more, and I think I understand what technique #2 from that article is doing. It adds two zener diodes in between the two resistors of the voltage divider. If you select diodes with appropriate Zener voltages (&gt; V+/2 but &lt; V+ &#8211; VLED), you should get no current loss through the divider at all. At 5V, that doesn&#8217;t leave you much voltage to play with, but you can use as small a resistor as needed to get the current you want without worrying about losses. All the current flows through the LED.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jin</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=151&#038;cpage=1#comment-22280</link>
		<dc:creator>Jin</dc:creator>
		<pubDate>Fri, 03 Oct 2008 17:57:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=151#comment-22280</guid>
		<description>This article: http://www.edn.com/article/CA6262537.html
gives three different techniques to drive a bicolor LED from a single output pin. #1 is to use an external inverter gate, #2 is essentially your solution with the addition of two zener diodes, and #3 gives a circuit using transistors to drive the LEDs.

Can you explain what the diodes are for? I&#039;m just a beginner at this stuff. My guess is to reduce the current loss through the voltage divider and to control the LED voltage in both red and green states, although I&#039;m not sure why you couldn&#039;t just use appropriate resistor values to do that.</description>
		<content:encoded><![CDATA[<p>This article: <a href="http://www.edn.com/article/CA6262537.html" rel="nofollow">http://www.edn.com/article/CA6262537.html</a><br />
gives three different techniques to drive a bicolor LED from a single output pin. #1 is to use an external inverter gate, #2 is essentially your solution with the addition of two zener diodes, and #3 gives a circuit using transistors to drive the LEDs.</p>
<p>Can you explain what the diodes are for? I&#8217;m just a beginner at this stuff. My guess is to reduce the current loss through the voltage divider and to control the LED voltage in both red and green states, although I&#8217;m not sure why you couldn&#8217;t just use appropriate resistor values to do that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James McDaniel</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=151&#038;cpage=1#comment-21638</link>
		<dc:creator>James McDaniel</dc:creator>
		<pubDate>Thu, 01 May 2008 02:08:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=151#comment-21638</guid>
		<description>Hi,

I just breadboarded this circuit and it doesn&#039;t work that well.  I messed around with different values to get it to work somewhat.  When I dropped the resistors in the voltage divider down to about 100 ohms each or so, I could see the LED&#039;s barely lighting up, but not enough to be usable.  I used a 2n3904 for the npn and a 2n4403 for the pnp.  Since the latter circuit has the two transistors in emitter-follower configurations, I removed the base resistor and got it to work better, but then the LED&#039;s glowed a little bit in tristate mode.  If anyone gets this to work right, please let me know!

Thanks</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I just breadboarded this circuit and it doesn&#8217;t work that well.  I messed around with different values to get it to work somewhat.  When I dropped the resistors in the voltage divider down to about 100 ohms each or so, I could see the LED&#8217;s barely lighting up, but not enough to be usable.  I used a 2n3904 for the npn and a 2n4403 for the pnp.  Since the latter circuit has the two transistors in emitter-follower configurations, I removed the base resistor and got it to work better, but then the LED&#8217;s glowed a little bit in tristate mode.  If anyone gets this to work right, please let me know!</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
