Analog input varies from 0-1023? Why?

I was wondering why the analog input varies from 0-1023.
Can’t it be more? Why this number?

The analog input is an 8bit analog to digital converter. the “8bit” portion lets you know what your resolution is. The equation is 2^n where “n” is the number of slots you have. 2^8 = 1024. Basically you have to fit the analog signal into a discreet digital value. Think about it like the pixel resolution on a digital camera. Arduino reads from 0 to 5v so you spread the 1024 “slots” over 5V giving you 5V / 1024 = .0048V. So you can read a voltage change of about 5mV Essentially, more money = more bits.

-Chase

Because the AVR has a ten bit analogue-to-digital converter.
210 = 1024 (despite what others may say :wink: )
More bits would mean a slower conversion or a more expensive device.
10 bits is a reasonable compromise
If you need more, you can add external devices.

You can vary the resolution for lower input voltages by applying different voltages to the Vref pin.

Wow I fail at math, thank you for the correction. Now I am confused, why is it advertised as 8bit when it looks like 10?

-Chase

I’ve never seen the A/D advertised as 8 bit.
It is 10 bits.

Remember also that although there are six (or eight) analogue inputs, there is only one A/D, shared between the inputs via an analogue mux.

AH! the PWM is 8bit, that is what I was thinking of.

-Chase

the PWM is 8bit

Yup, that one catches a lot out too, when they find their motor speed or dimmer cycles round four times for each turn of the pot :slight_smile:

Haha thanks! :wink:
I got a little confused when Chase said that 8 bits create a value from 0-1023 :wink:

Thank you very much people!

Sorry again about that! Ill use the fact that it was early as my excuse.

-Chase

Haha no problem at all xD