<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<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">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Draining current into output pin</title>
		<link>http://forums.leaflabs.com/topic.php?id=721</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:18:31 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=721" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "Draining current into output pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=721#post-21765</link>
			<pubDate>Sat, 22 Dec 2012 12:30:22 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">21765@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;niyaas1 - That looks like an attempt to post a spam ad, so I have broken the link.&#60;/p&#62;
&#60;p&#62;You can get a good answer to your question using your favourite search engine, and something like &#34;ac/dc current clamp meter&#34;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>niyaas1 on "Draining current into output pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=721#post-21757</link>
			<pubDate>Fri, 21 Dec 2012 23:34:16 +0000</pubDate>
			<dc:creator>niyaas1</dc:creator>
			<guid isPermaLink="false">21757@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I have seen a &#60;a href=&#34;http://www.swainmeter .com/&#34;&#62;DC current clamp meter&#60;/a&#62;, but is there one that is both ac and dc?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Silntknight on "Draining current into output pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=721#post-4232</link>
			<pubDate>Fri, 08 Apr 2011 00:08:49 +0000</pubDate>
			<dc:creator>Silntknight</dc:creator>
			<guid isPermaLink="false">4232@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I agree. That is why I will likely go with the 270 ohm resistor. Thanks again!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Draining current into output pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=721#post-4227</link>
			<pubDate>Thu, 07 Apr 2011 18:54:32 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">4227@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;With two LEDs in series, the voltage drop calculation becomes:&#60;br /&#62;
3.3V -1.2V - 1.2V = 0.9V&#60;/p&#62;
&#60;p&#62;the current calculation for 500 ohms is 0.9V/500ohms = 0.0018, or 1.8mA,&#60;br /&#62;
so going for a smaller resistor value, like 270 ohm, which is safe for a single LED, might be more convenient.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Silntknight on "Draining current into output pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=721#post-4220</link>
			<pubDate>Thu, 07 Apr 2011 16:45:10 +0000</pubDate>
			<dc:creator>Silntknight</dc:creator>
			<guid isPermaLink="false">4220@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Ok. I'll look into that as well. The thing is that I will occasionally be running 2 LEDs in series and at other times, just one. If a 270 Ohm resistor works safely, then I'll probably go with that. Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Draining current into output pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=721#post-4217</link>
			<pubDate>Thu, 07 Apr 2011 16:02:57 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">4217@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Silntknight -if 500 ohm's works well, fine. &#60;/p&#62;
&#60;p&#62;If you need a bit more headroom to allow you to reduce sensitivity, or increase speed, at the other side of the optoisolator, then you might want to estimate how low would be safe.&#60;br /&#62;
Estimating a resistor value based on the 1.2V typical forward voltage drop, 8mA, maybe even ignore the worst case 0.4V LOW i.e.&#60;br /&#62;
3.3V - 1.2V = 2.1V / 8mA = 263 ohm&#60;br /&#62;
nearest preferred is 270 ohm&#60;br /&#62;
should be safely within the STM32F spec.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Silntknight on "Draining current into output pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=721#post-4213</link>
			<pubDate>Thu, 07 Apr 2011 14:11:26 +0000</pubDate>
			<dc:creator>Silntknight</dc:creator>
			<guid isPermaLink="false">4213@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;First, you are correct in that I did not account for the voltage drop across the LED. Second, I actually tested it with a 1K resistor and it worked fine (just the outputs were a little weaker, as in the LEDs were dimmer).&#60;br /&#62;
So, the specs on the opto (&#60;a href=&#34;http://media.digikey.com/pdf/Data%20Sheets/Lite-On%20PDFs/LTV-8x6.pdf&#34; rel=&#34;nofollow&#34;&#62;http://media.digikey.com/pdf/Data%20Sheets/Lite-On%20PDFs/LTV-8x6.pdf&#60;/a&#62;) show that it has a 1.4V max forward voltage drop (unless that is the threshold voltage). Either way, I will simply measure the current. I know that it will work with a 500 Ohm resistor, so I might just stick with that to be safe.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Draining current into output pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=721#post-4195</link>
			<pubDate>Thu, 07 Apr 2011 04:50:42 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">4195@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;So is the anode of the optoisolater connected to 5V or 3.3V?&#60;br /&#62;
If it is 3.3V 500 ohm sounds too big.&#60;/p&#62;
&#60;p&#62;The STM32F data sheet says 20mA/pin, so try to keep under that.&#60;/p&#62;
&#60;p&#62;What is the forward voltage drop across the LED?&#60;br /&#62;
It is usually about 1.5V worst case,&#60;br /&#62;
so 3.3 - 1.5V = 1.8V&#60;br /&#62;
with a 'low' of 1.3V (worst case)&#60;br /&#62;
1.8V - 1.3V = 0.5V&#60;br /&#62;
R = V/I = 0.5V / 20mA = 0.5/0.02 = 25 ohm&#60;/p&#62;
&#60;p&#62;Minimum/best case LED forward voltage 1.0V (e.g. for a Toshiba optocoupler)&#60;br /&#62;
so 3.3V - 1.0V = 2.3V&#60;br /&#62;
with a low of 0.4V (optimistic, hence unlikely)&#60;br /&#62;
2.3V - 0.4V = 1.9V&#60;br /&#62;
R = 1.9V / 0.02A = 95 ohm&#60;/p&#62;
&#60;p&#62;running this again for 8mA&#60;br /&#62;
worst case 0.5V/0.008A = 63 ohm&#60;br /&#62;
best case 1.9V/0.008A = 238 ohm&#60;/p&#62;
&#60;p&#62;Check your data sheet, but 500 ohm may be way to big.&#60;/p&#62;
&#60;p&#62;It looks like 100-220 ohm would be okay, and you could measure the actual current, or voltage drop with a meter.&#60;br /&#62;
(but no guarantees given, or responsibility taken :-)&#60;/p&#62;
&#60;p&#62;(full disclosure: I am not a member of the LeafLabs staff)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Silntknight on "Draining current into output pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=721#post-4191</link>
			<pubDate>Wed, 06 Apr 2011 20:42:32 +0000</pubDate>
			<dc:creator>Silntknight</dc:creator>
			<guid isPermaLink="false">4191@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Ok... So I should choose a larger resistor. Maybe something on the order of 500R? I just realized my calculation for 33mA was wrong (I assumed 5V instead of 3.3V), but 22mA is still high. 500 Ohms should be sufficient. I could go as high as a 1K resistor, but then the output starts getting a little weak. Shouldn't be a huge problem because the output goes to a NMOS driver anyway.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Draining current into output pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=721#post-4184</link>
			<pubDate>Wed, 06 Apr 2011 16:28:43 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">4184@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;It is safe to 'sink' current into an output pin.&#60;br /&#62;
An output pin can normally both source (act as a +V source, 'producing' current) or sink (act as a 0V or Ground sink, 'consuming' current) for current.&#60;br /&#62;
(Open Collector only actively 'sinks' to ground)&#60;/p&#62;
&#60;p&#62;BUT, 33mA is beyond the maximum of the electrical spec for the STM32F103.&#60;br /&#62;
The datasheet says ABSOLUTE MAXIMUM 25mA on an I/O pin.&#60;br /&#62;
It further specifies operating characteristics based on 8mA, for normal voltage characteristics (Low &#38;lt;= 0.4V), and 20mA for &#34;weaker&#34; drive voltage characteristics (Low &#38;lt;= 1.3V).&#60;/p&#62;
&#60;p&#62;I might be willing to try it just to quickly test something, but I would want to put something in to sink that much current, like a transistor or MOSFET (but I am a bit conservative on these things :-)&#60;/p&#62;
&#60;p&#62;(full disclosure: I am not a member of the LeafLabs staff)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Silntknight on "Draining current into output pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=721#post-4180</link>
			<pubDate>Wed, 06 Apr 2011 15:17:16 +0000</pubDate>
			<dc:creator>Silntknight</dc:creator>
			<guid isPermaLink="false">4180@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;If a pin is configured as an output, is it safe for current to current to flow into the pin? I have an optoisolator and the anode is connected to a +5V source constantly. The cathode is connected to the pin. When the pin is held low, 33mA of current (max) will flow into the pin. When the pin is high, no current should flow. This is to compensate for my stupidity in ordering inverted logic NMOS gate drivers.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
