Hey guys I have a project that will require 20 I/O pins with serial communication from a computer to control each of the pins. I would like something as small as possible would a arduino micro or uno work for this project or will i need to go bigger like a mega. I have looked at all the pinouts but am confused to know of which pins I can use as digital I/O or not. Thanks
If you require 20 I/O pins then use Arduino Mega. If it’s too big then use Nano, Micro or Pro Mini (you need a serial thingy to program the Mini) with I/O expanders like PCF8574P with I2C communication or MCP23S17 with SPI communication.
There are a couple of options
- Easiest = Use an Arduino with a greater number of pins (e.g. MEGA2560)
- Easy = Use an add-on board (e.g. Teensy)
- Harder = Use shift registers (see Is there a way to have more than 14 Output pins on arduino?)
Further discussion on these options here.