3
  • I upload a blank sketch: pin 13 LED is on. Why?
  • I connect pin 13 to GND: it turns off until I remove the connection
  • I connect multimeter between pin 13 and GND: measures 0.14V and LED turns off until multimeter is removed
  • I press hard reset: LED blinks a few times, turns off for a second then turns on
  • I upload a sketch that on setup sets pinMode(13, INPUT): pin 13 LED is on
  • I upload a sketch that on setup sets pinMode(13, OUTPUT): pin 13 LED is off 0.01V
  • I upload a Blink example: Everything works fine, LED cycles from 4.84V to 0.01V

Why is the LED on unless I set pinMode to output? Have I broken my UNO or is this normal? I swear it wasn't like this a few days ago.

7

The LED is driven by an op-amp (see the schematic). When the pin is configured as input the op-amp has an undefined input (floating input). Thus it may or may not turn on the LED. If you configure it to an output the op-amp is driven in a known way.

enter image description here

Why is the LED on unless I set pinMode to output? Have I broken my UNO or is this normal?

It's perfectly normal.


I think they did this to stop the LED "loading" the SCK pin (pin 13), particularly if you have it configured as an input and are trying to measure something, the 1k resistor and LED would throw out the measurement.

You could conceivably have a pull-down resistor from SCK to GND, but that would load the pin as well.

  • Nice answer - especially with the schematics – Heiko Rupp Nov 30 '15 at 11:23
1

Apparently it's normal. Although random. Sometimes the default voltage of the pin is high enough to make the LED light up because of the op-amp. Sometimes it isn't. Source: https://electronics.stackexchange.com/a/39707

0

If SCK is set as an input then pin 5 of the op amp goes high (pnp transistor input stage) and the op amp output goes high turning on the LED.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.