Analog Read Questoin

Status
Not open for further replies.

Palbert

Member
Since the range of the analogRead() function ranges from 0 to 1023, if I were to supply the Arduino with +9V, would 1023 represent 9V input or would it be 5V? I'm assuming it would be 9V but I want to be sure.

Thanks.
 
You can only read 0-5V... If you need to read 9V then you need to scale it down with a potential divider 5k1 and 3k9 is quite close..
 
Since the range of the analogRead() function ranges from 0 to 1023, if I were to supply the Arduino with +9V, would 1023 represent 9V input or would it be 5V? I'm assuming it would be 9V but I want to be sure.

The 1023 equals the supply voltage. Some parts run at 3.3 volts so 1023=3.3 volts. Or with a 5 volt supply 1023=5V.
The Arduino has a maximum supply of 5.4volts so don't go to 9 volts!
 
If you were to supply the pin with 9volts directly without proper current limiting the protection diodes will fail and you'll likely fry the I/O port.
 
Sorry for the late response but thanks everyone. I just changed the functionality of the circuit I was using from analog to digital so there was no frying of the I/O port
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…