Arduino Forum

General Category => General Discussion => Topic started by: TobiasRipper on Apr 09, 2014, 06:28 am

Title: [pro mini] Can you use a DIGITAL pin to read analog input? voltage**
Post by: TobiasRipper on Apr 09, 2014, 06:28 am
As opposed to a contrary question here of (can analog pin read digital) I am wondering the opposite, while building an all analog module, Can the Digital Pins of an Arduino Pro Mini read analog values (voltage)?

thank you.
Title: Re: [pro mini] Can you use a DIGITAL pin to read analog input? voltage**
Post by: CrossRoads on Apr 09, 2014, 06:33 am
Sure, sort of - will only get a 0 or 1 back tho. If level is in the 'middle', reading may be indeterminate.
Depending on the Promini model purchased, A6 & A7 may be available as analog inputs only as well.
Title: Re: [pro mini] Can you use a DIGITAL pin to read analog input? voltage**
Post by: TobiasRipper on Apr 09, 2014, 06:36 am
Well its actually related to the potentiometer question I had - the voltage off the potentiometer is not binary,
Title: Re: [pro mini] Can you use a DIGITAL pin to read analog input? voltage**
Post by: CrossRoads on Apr 09, 2014, 06:42 am
With Vcc = 5V:
voltages up to 0.3 x Vcc (1.5V) will return a 0
voltages above 0.6Vcc (3V) will return a 1.
voltage in between - anybody's guess.
Title: Re: [pro mini] Can you use a DIGITAL pin to read analog input? voltage**
Post by: TobiasRipper on Apr 09, 2014, 06:50 am
Ah and theres no way of telling it to read it like an analog within code?
Title: Re: [pro mini] Can you use a DIGITAL pin to read analog input? voltage**
Post by: CrossRoads on Apr 09, 2014, 06:54 am
Not unless you go in thru an analog input pin to go the ADC converter.
Or use an external ADC.
http://www.digikey.com/product-detail/en/MCP3201-CI%2FP/MCP3201-CI%2FP-ND/305922
Title: Re: [pro mini] Can you use a DIGITAL pin to read analog input? voltage**
Post by: TobiasRipper on Apr 09, 2014, 07:04 am
I see.. well thank you