More digital inputs on Arduino....possible?

I know that we have a total of 18 Digital Inputs on the ATmega168 Arduino available...

(taking into account that Analog pins 0-5 can be used as Digital Inputs, and that DI0 and DI1 are reserved for Tx and Rx),

but is there any way to get more digital inputs into a single arduino than the already present 18?


sorta, you can use multiplexers to switch different signals into 1 pin like a rotary switch, or use P in S out shift registers to sample 8-16 digital inputs and stream them serially into the arduino

Also check out "port expanders" like the MCP23008.

Good answers from both of you. thank you for replying…

And little clones (ModernDevice RBBB) are so inexpensive, that if you want to monitor LOTS of signals, soon.... why not just have 2 (or more!) Arudinos "upstream" of your main Arduino, or a bigger "host", and use them to "pre-digest" the signals.

For instance, suppose I had a big warehouse with 30 PIRs all separately wired back to a security office. Two "upstream" Ardy's could "watch" the PIR outputs, most of which, at "interesting" times would be saying "all quiet". If they saw movement detected, they could send the number of the PIR to the "upstream" Ardy over a serial link.