Not enough digital pins on Arduino

Hi all,

I am currently trying to make a 'credit card' payment system using RFID tags.

I am using an LCD screen (uses 6 I/O pins), an RFID RC522 reader (uses 7 I/O pins) and a buzzer (1 I/O pin). I want to add a membrane switch module to input the price of objects; however, I do not have enough digital pins to do so, as the membrane switch requires 8 pins.

What should I do???

Thanks in advance :slight_smile:

Get a Mega.

You could use an I2C LCD and/or I2C port expanders.

Or get a shift register. Or the simplest way: analog pins may be used as digital.

EDIT: summing error - there won't be enough pins even with analog pins. Does the RFID reader really need all 7 pins?

Smajdalf:
Or get a soft register. Or the simplest way: analog pins may be used as digital.

I think with 14 pins in use, the OP must already be using the analog pins.

Whandall:
You could use an I2C LCD and/or I2C port expanders.

Yes to this. The i2c LCD backpacks are only about $1 USD and will free up 4 pins.

--- bill

Smajdalf:
Does the RFID reader really need all 7 pins?

Usually five IIRC. SPI plus a possible "interrupt".

+1 for I2C display. If only because it make the wiring so much easier, just four wires (power + I2C).

No I2C RFID readers around? That'd be able to share the I2C pins with the display. Major savings in pin connections.

The buttons can be matrixed (on 6 pins) or on an I2C port extender (a PCF8574 will do great), again sharing the pins with the I2C display.

No I2C RFID readers around?

I saw plenty out there. You can get even get the OP’s RC522 modules with I2C ready to go. See https://forum.arduino.cc/index.php?topic=553760.0

Update: Sorry everyone, the RFID reader only uses 5 I/O pins. Does this mean that I could use the analogue pins as digital pins?

alexoort:
Update: Sorry everyone, the RFID reader only uses 5 I/O pins. Does this mean that I could use the analogue pins as digital pins?

See reply #3 and #4

RFID and Display are both SPI.

need to sketch out the pins so you know what requires a dedicated pin and what is shared.

alexoort:
Does this mean that I could use the analogue pins as digital pins?

A0-A5 are digital pins, that happen to be able to read analog inputs as well. A6 and A7 are analog-in only.