Electronic – arduino – Why won’t the arduino board read an analog pin correctly

arduinoinputvoltage

I'm working with an Arduino Uno board. I have a series of voltage dividing circuits off to the side of a breadboard to give me four different voltages. I'm connecting to my laptop.

I am using the example given on the Arduino website just to test to make sure the pin is reading properly and that the chip is making the decisions necessary from there. But looking at the serial monitor, I got gibberish. So I switched to an if/then statement, saying if the voltage went high (and put the threshold as low as it can go – 1) to turn on a LED on pin 13.

I even added on my own LED and resistance, since the one on the board didn't seem to be working. But this one isn't turning on unless the voltage is 2.5 V or greater. I've switched out the extra LED and resistance to try to create the most ideal situation to turn on the LED, but still nothing until the voltage going into the input pin is over 2.5V. But on the site and in the datasheet, it says that it SHOULD read anything from 0 to 5. I'm trying to read voltages ranging from 13 mV to 780 mV. Small, but according to the datasheet, not too small.

Does anyone have suggestions? Should I just throw an op amp or something on the end to bump up the voltage?

Best Answer

Try this code:

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.println(analogRead(0));
  delay(1000);
}

Load the serial monitor, set it to 9600 baud, and see what you get.