arduino with indepent adc input port

Hello, i really like arduino, specially arduino UNO R3, i have always wanted to make a plc board using arduino uno, mainly with more digital inputs and just 2 adc inputs, but the problem is that i can´t do it with arduino uno because all ADC port (A0..A5) are digital or analog, that port can´t be both of them(for example A0,A1 and A2 are digital inputs, A4 and A5 analog inputs), that ´s why i dicided to use pics, 16f886, it has independent ADC inputs, but i really want to try using an arduino board, so is there an arduino board that has indenpendent ADC inputs or some kind of variety of atmega 328, thanks in advance :slight_smile:

One solution is to use a port expander such as the MCP23017 or 23s17 (I2C or SPI versions). With the MCP23017 you can expand the available digital io ports to 16*8 (128) ports (theoretically). There is a retail io shield for UNO or it's fairly trivial to expand using the device itself.

read the last paragraph here https://www.arduino.cc/en/Tutorial/AnalogInputPins

Yes, you can use A0 and A1 and A2 as analog inputs and A4 and A5 as digital inputs (or outputs). What makes you think that you can't?

An Arduino Nano has two additional analog inputs (A6 and A7); those pins can't be used as digital input or digital output.

parksplit:
Hello, i really like arduino, specially arduino UNO R3, i have always wanted to make a plc board using arduino uno, mainly with more digital inputs and just 2 adc inputs, but the problem is that i can´t do it with arduino uno because all ADC port (A0..A5) are digital or analog, that port can´t be both of them(for example A0,A1 and A2 are digital inputs, A4 and A5 analog inputs),

By default, A0-A5 are digital IO pins for the pc0-pc5 IO lines of Port-C Register. They can be used as --

  1. A0-A5 as digital IO lines.
  2. A0-A5 as analog channels for the internal ADC of the MCU.
  3. A0-A3 as digital IO lines and A4-A5 as analog channels.
  4. A0-A1 as digital IO lines, A2-A3 as analog channels and A4-A5 as SDA-SCL lines of I2C Bus.

In summary, A0-A5 lines can be used as digital IO lines, analog channels, I2C Bus, and in all permissible combinations.

Thanks for your replies, i really confused things, you all were right it is possible to use A0..A5 as digital or analog at the same time:

Here is a video demostration, sorry for the mess i just made it fast because of time:

which make me do another question but i think is for another post or topic, in video everytime i press digital input button (A3 as digital input) analog read shown in lcd changes like if it was some kind of noise, btw it sows number like 9000, it is because i didn´t clear lcd, and why it stays in 1017 analog read, shoudn´t it be 1023?

parksplit:
Thanks for your replies, i really confused things, you all were right it is possible to use A0..A5 as digital or analog at the same time:

Here is a video demostration, sorry for the mess i just made it fast because of time:

https://www.youtube.com/watch?v=epYucYhFINg&feature=youtu.be

which make me do another question but i think is for another post or topic, in video everytime i press digital input button (A3 as digital input) analog read shown in lcd changes like if it was some kind of noise, btw it sows number like 9000, it is because i didn´t clear lcd, and why it stays in 1017 analog read, shoudn´t it be 1023?

see my comment #2

Thanks Juraj, i´ll have to add some restriction reading analog when pressing digital input A0..A3, as it says:

"...to add a short delay before using analogRead() to read other analog pins."

I don't know what is connected to your analog pins; I don't do videos.

But you are aware that if it's a matter of reading a HIGH/LOW signal, you can use digitalread?

A4 and A5, each of them havea 10k potentiometer