D0 as INPUT is always HIGH

I set D0 as an INPUT and it always reads HIGH. D0 is being used to read a switch that is normally LOW. After scouring the forum and other places here's what I've found/done:

  • made surethat there is a 10K pull down to GND on the D0 line
  • made sure that the Serial library is not invoked (D0 is shared as RX)
  • included code immediately prior to reading D0 to set the pinMode
  • made sure that the internal pull up is not enabled
  • tested D0 as an output (HIGH and LOW) - it works properly in the output state
  • this happens on both my UNO R2 and R3 versions

One source (Arduino Rx always HIGH - Raspberry Pi Forums) stated "The arduino RX pin is high because the output from the USB / serial chip is high when it is not receiving anything. This is connected to the arduino pin through a 1K resistor so that any direct connection to that pin can pull the pin to ground. So to stop this happening you can disconnect this resistor or put a switch in it."

YIKES, this can't be true, otherwise there would be a caveat in the Arduino Reference section.

Unfortunately all pins have been assigned and I'm unable to easily swap to another pin. And, the switch has to be normal unpressed) LOW.

If DO is always HIGH on the UNO, then will a Duemillanove or a clone that doesn't use the 16U2 for USB control?

Any thought on how to resolve this issue?

DO / D1 is connected via 1k / diode to Ucc
Use a pull-down resistor or select other pin(s)

I am using a 10K pull down resistor on D0. The resistance of the membrane switch measures ~56 Ohm, so that shouldn't drop the Vh too low.

bpospick:
Any thought on how to resolve this issue?

Use a different pin, eg. have you used all the analog pins?

Have you disabled the serial port? You can't use any Serial functions at all in your sketch, D0 is disconnected if you do. You can call Serial.end() to return to normal.

On then Nano clone with CH340G USB-serial chip, D0 is connected to 5V (if you have 5V version) via 330 ohm resistor and LED on one branch, and to TXD pin of CH340G via 1K resistor.

PeterAlic:
On then Nano clone with CH340G USB-serial chip, D0 is connected to 5V (if you have 5V version) via 330 ohm resistor and LED on one branch, and to TXD pin of CH340G via 1K resistor.

OP was using an Uno 6 years ago :smiley: