Go Down

Topic: Pin 13 led circuit conflicts? (Read 2044 times) previous topic - next topic

Boz

Can anyone give me examples or explain how the LED on pin 13 can conflict or mess up a project using that pin?

What about a status led on a PWM pin what would or could be the loss or conflict?

I know I have seen problems talked about before but looking for pin 13 in search here is like looking up the word the on the internet.

retrolefty


Can anyone give me examples or explain how the LED on pin 13 can conflict or mess up a project using that pin?

The main problem when using pin 13 for external circuit needs is if it is used as a input pin then the device or component driving the signal would have to be able to source enough current when trying to drive the signal HIGH to power the on-board pin 13 led/resistor. I think most designs use a 1k ohm resistor so there would be a 3-4 ma current source requirement for the signal.

What about a status led on a PWM pin what would or could be the loss or conflict?

As long as the pin is used in output mode the fact that the pin has a status resistor/led should not be a problem. As long as total pin current load is kept at around 20-30ma max there should be no problem. If the pin is used as a input pin then same concern as the pin 13 situation above.

I know I have seen problems talked about before but looking for pin 13 in search here is like looking up the word the on the internet.

?


CrossRoads

Pin 13 has a 1K resister to an LED to ground in parallel with the shield connector; i.e. the signal does not go thru the LED/resister and then go out the connector.
If the pin is an output, the LED uses up about 3mA of the outputs drive capability.
If the pin is an input, then there is a 3mA load on whatever is driving the pin.
This should not be a problem for standard logic interfacing.

Same for PWM - an LED/resister in parallel with the shield connecter should not cause a problem.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Boz



I know I have seen problems talked about before but looking for pin 13 in search here is like looking up the word the on the internet.

?



Thanks Again Lefty, I should probably just put you and few others like westfw, grumpy mike, on some kind of retainer so I can repay you for all the help you guys supply.

The search term "pin 13" in the arduino forum search returns so much signal to noise because pin 13 is more commonly talked about in posts than any other pin on the arduino, that it is practically useless to try to search for that term, GRIN.

MarkT

Quote
This should not be a problem for standard logic interfacing.


No, it _is_ a problem if interfacing to CD4000 series CMOS which can only drive about 0.5mA.  74HC series can just manage it (4mA).
[ I won't respond to messages, use the forum please ]

retrolefty

Quote
Thanks Again Lefty, I should probably just put you and few others like westfw, grumpy mike, on some kind of retainer so I can repay you for all the help you guys supply.


Your welcome, and not a problem, just as I rely on Coding Badly, PaulS, and many others for software advice.

Lefty



CrossRoads

0.5mA, I am not used to dealing with such wimpy parts.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

EmilyJane

Some of the more modern boards isolate the LED from the pin through the use of a MOSFET driver. So far, I haven't run into any problems with pin 13 on these boards.

Quote
The main problem when using pin 13 for external circuit needs is if it is used as a input pin then the device or component driving the signal would have to be able to source enough current when trying to drive the signal HIGH to power the on-board pin 13 led/resistor. I think most designs use a 1k ohm resistor so there would be a 3-4 ma current source requirement for the signal.


If you want to get a little more technical, noting that the forward voltage drop of a red LED is typically 1.7V, the current consumed by it will be equal to the minimum logic HIGH input voltage for the processor, e.g. 3V for 5V Vcc, minus 1.7V, divided by the series resistor value, typically 1K.

Vih(min) - Vf(typ) / 1000 = 1.3mA

So, if your driver can supply 3V @ 1.3mA you should be okay. This is at DC, of course. If you are driving the pin at any frequency above zero, things like the non-linear conductance and the impedance of the LED start to come into play. Easier just to avoid using pin 13, usually. :D

retrolefty

#8
Aug 12, 2011, 08:39 pm Last Edit: Aug 12, 2011, 08:41 pm by retrolefty Reason: 1
Quote
Easier just to avoid using pin 13, usually.



That's our usual advice to newcomers, as well as avoiding using pins 0 and 1. The pin 13 thingee has a long and interesting history. Originally the pin 13 led design wired the shield connector pin 13 after a series resistor rather then directly to the avr chip pin, leading to tutorials showing connecting a led directly to shield pin 13 and ground. Of course that caused pin & LED damage to people using such tutorials with newer boards and confusion has continued ever sense.  :D

And it doesn't help the situation that pin 13 is the SCK signal used by the ICSP six pin connector.

http://arduino.cc/en/uploads/Main/arduino_NG_schematic.png

Lefty

EmilyJane

I have one of those early boards. :)

CrossRoads

And I think the tutorials are still wrong for later boards ...
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

EmilyJane

Quote
And I think the tutorials are still wrong for later boards ...


Well, you know, arduino is Italian for "cast in stone"?  XD

retrolefty

But still, Italy does make some kick ass luxury sports cars, Varoom-Varoom.  ;)

EmilyJane


But still, Italy does make some kick ass luxury sports cars, Varoom-Varoom.  ;)


Agreed!

Boz

Well as I told lefty, another discussion in a different section about possible shield ideas lead me to consider adding LED status circuits to each of the digital lines on my Cidekick project http://arduino.cc/forum/index.php/topic,67044.msg493322.html#msg493322 but I was trying to figure out how an isolation circuit would work for each pin or if it was even needed.

The idea was an LED shield that would show the status of each pin high or low and I was thinking RGB for the pwm pins rather than just fade.

The whole idea would only work if it it could be electronically transparent, meaning not affecting other circuits or uses to display the status and if it was low component count.

I would also only use it on outs and make it disconnect on pins being used as input.

Any thoughts, circuits, caveats?

Go Up