1
\$\begingroup\$

I have a setup that demands that I use all my I/O's on my Arduino Uno R3 board - including the serial pins 0 and 1.

So I've initialized those pins as inputs, but when I make a reading on pin 0 it reads high although it's not connected to anything. My multimeter tells me 4.8V steadily on the pin all the time.

All my other pins I've not initialized any serial communication, and I've tried running the board on a battery (so no computer connection).

I have Adafruit's Waveshield connected to it, but as far as I'm concerned it shouldn't interfere with pin 0 in any way.

I've made a simple drawing showing the concept of what I'm doing. It's all there is to it, just the size of 12 buttons and 12 lamps. In order to get enough I/O's, I had to implement an IO expander (mcp23016) on the I2C bus, but it's the same principle as on the drawing.

So when I have everything hooked up, all seems to be good except for the pin 0 on the Arduino board. All other readings (both on the Arduino and the expander) works fine. The weird thing is: when I measure voltage on pin 0, it gives me 4.8V; on pin 1 it gives me 1V and on the other pins it gives me 0V. So something is obviously different from the serial pins.

Are there any internal pull ups or downs on them or could it be the many 10k resistors I use? Do they need to be smaller or bigger perhaps?

Perhaps it's just a bad soldering, but I've been checking for hours and hours and I really can't see any issue on the hardware part.

concept schematic

\$\endgroup\$
5
  • 5
    \$\begingroup\$ They are going to yell at you for that drawing. A proper schematic would go a long way. \$\endgroup\$
    – mikeY
    Jul 18, 2013 at 21:47
  • \$\begingroup\$ *Yell* <- that's me yelling about the drawing. \$\endgroup\$
    – JYelton
    Jul 18, 2013 at 22:43
  • \$\begingroup\$ J-"YELL"-ton, amirite? \$\endgroup\$
    – dext0rb
    Jul 18, 2013 at 22:52
  • \$\begingroup\$ @dex Exactly. :) \$\endgroup\$
    – JYelton
    Jul 19, 2013 at 1:45
  • \$\begingroup\$ Epic drawing (yell!). \$\endgroup\$
    – Rev
    Jul 19, 2013 at 7:09

2 Answers 2

2
\$\begingroup\$

If it's set as an input pin then trying to measure the voltage on it is largely unproductive unless, of course you believe it may be still set as an output - then you would need to attach a load to it to see if the voltage it is producing is "real" or just some leakage current from an unconnected input making a high impedance voltmeter show something like 4.8V.

Try connecting a 1k resistor to ground from this pin - does it still show logic 1 or perhaps it's now at logic 0.

Some IO pins will default (on some MCUs) to having an inbuilt high resistance pull-up of the order 100k and this may also be happening. This (on some MCUs) can be programmed to be (a) not there at all, (b) pull-up or (c) pull-down. I believe some MCUs can program a lower resistance or a higher resistance. Maybe this is also happening?

\$\endgroup\$
2
  • \$\begingroup\$ The arduino supports an internal pull-up on inputs but it is not enabled by default. Use pinMode(pin,INPUT_PULLUP) to enable it. \$\endgroup\$
    – Craig
    Jul 18, 2013 at 22:55
  • \$\begingroup\$ +1 for "largely unproductive". I would have used stronger terminology :-) \$\endgroup\$ Jul 19, 2013 at 5:29
0
\$\begingroup\$

The serial pins on the Arduino's main Microcontroller (ATMega328p), are connected to the Serial IC (A FTDI FT232 USB to Serial IC, or on newer boards, a ATMega16U running usb to serial programming) through two resistors. These resistors are placed between the ATMega328p and the Serial IC, but not between the ATMega328p and the Pin 0 and Pin 1 header. This allows a serial device connected through the Arduino Header (typically a shield) to override the Serial IC.

In your case, what this means is that unless there is a signal driving the pin High or Low, the Serial IC's serial port will drive the pins instead. And if the signal has a resistor weaker than 1kΩ, the Serial IC will still take precedence over that signal.

I suggest using Pin 0 as an output instead.

See Uno Rev 3 Schematic, at the bottom, for RN4A and RN4B, 1kΩ resistor network.

\$\endgroup\$

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.