analog read

hi,
i have connected a sensor to a analog pin A5 of atmega8 but irrespective of change in sensor value the serial monitor shows 1023 always.
what can go wrong with it ?my sensor changes value as it is required.

Do you have a voltmeter to measure the voltage?

What kind of sensor is it?
can you post your code and schematic?

It might need a pull down resistor of e.g. 10K.

Show us a link to your 'sensor'.
Show us how you are wiring it up for power, ground and to your arduino.
Show us your code.

Without these things it's anyone's guess what may be wrong.

Lefty

amar:
hi,
i have connected a sensor to a analog pin A5 of atmega8 but irrespective of change in sensor value the serial monitor shows 1023 always.
what can go wrong with it ?my sensor changes value as it is required.

Five seconds with a multimeter will tell you (and us) if the problem is the Arduino or the sensor.

Without that... nobody can help you.

fungus:

amar:
hi,
i have connected a sensor to a analog pin A5 of atmega8 but irrespective of change in sensor value the serial monitor shows 1023 always.
what can go wrong with it ?my sensor changes value as it is required.

Five seconds with a multimeter will tell you (and us) if the problem is the Arduino or the sensor.

Without that... nobody can help you.

the value at A5(analog pin) shows 3.28v but MCU shows it as 1023 only.....

Code. Schematic. Observations.