No input but output

Hi guys. Input does not exist. But if i run this coding, I got this output on my serial monitor. Other analogPin is same. So I think it is arduino problem. My arduino is Arduino Ethernet with Arduino USB 2 Serial Converter. How can i fix this problem? Thank you for reading my question. Any advice or comment are welcome.

int analogPin = 1;

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

void loop() { float reading = analogRead(analogPin); float voltage = reading / 204.6; Serial.print("Reading="); Serial.print(reading); Serial.print("\t\tVolts="); Serial.println(voltage); delay(500); }

ing=222.00 Volts=1.09 Reading=222.00 Volts=1.09 Reading=222.00 Volts=1.09 Reading=222.00 Volts=1.09 Reading=222.00 Volts=1.09 Reading=222.00 Volts=1.09 Reading=222.00 Volts=1.09 Reading=220.00 Volts=1.08 Reading=219.00 Volts=1.07 Reading=220.00 Volts=1.08 Reading=221.00 Volts=1.08 Reading=221.00 Volts=1.08 Reading=221.00 Volts=1.08 Reading=221.00 Volts=1.08 Reading=221.00 Volts=1.08 Reading=221.00 Volts=1.08 Reading=222.00 Volts=1.09 Reading=222.00 Volts=1.09 Reading=221.00 Volts=1.08 Reading=222.00 Volts=1.09

I don’t have your board pokipoki, but I will give you my thoughts anyway: Try using int analogPin = A1; instead of 1. The analogRead() function works on analog pins.

Also, if an unconnected pin is read, the result will be a (semi) random number.

Can you provide more information about what you have hooked up?

Also, please read the post at the top of the post list, called “How to use this forum”, as it has suggestions (well, rules actually) about how to attract help in your post. Especially the part about code tags.

int analogPin = 3; // potentiometer wiper (middle terminal) connected to analog pin 3

// outside leads to ground and +5V

int val = 0; // variable to store the value read

Is straight from the Language Reference page.

OP has told us the analogue pin has no connection so is floating.

What happens when 10k R is put from input to ground, and then 5v?

Weedpharma

weedpharma: Is straight from the Language Reference page.

OP has told us the analogue pin has no connection so is floating.

What happens when 10k R is put from input to ground, and then 5v?

Weedpharma