Addind pins to the arduino?

Hi everyone, I am trying to make a piano project using the arduino, and for that I am going to need much more pins than 13 that the arduino has.
Does anyone have any idea how can it be done?
Thanks :slight_smile:

do you need digital ins , digital outs, analog ins or analog outs?

if you need digital outs look into shift registers, lots of examples in the playground

if you need digital ins look into shift registers (

if you need analog ins look into analog multiplexers like the MC14067, you'll fine examples on the forum (from 2006 more or less) somebody added 96 analog ins to an arduino

if you need analog outs for pwm look into the tlc5940 from TI, example in the playground

or use an analog multiplexer like the MC14067 to send one PWM signal to many "sample and hold" circuits built with opamps
like you see at page 13 of this

have fun :slight_smile:

I guess I am looking for ins, but what is the difference between digital and analog?
Ive always used the digital because there were just more of them.

If all you want is to read a lot of buttons, look into how keypads are scanned. Just like you can have a matrix of LEDs, you can arrange your buttons into a matrix.

With 10 digital inputs, you can read 25 buttons (electronically aranged in a 5x5 grid). With 20, you can read 100 buttons as a 10x10 grid. This is how commercial electronic music keyboards work.

The Arduino will let you have 20 digital inputs by using the analogs as digital 14-19.

I didnt get it oracle, how can the arduino read 25 buttons using 10 digital inputs?

I didnt get it oracle, how can the arduino read 25 buttons using 10 digital inputs?

Take a look at

You wouldn’t have to actually arange you buttons in a physical grid, just electronically it would be wired in on.

I'm wishing to use the digital inputs on the arduino to increase my analog inputs (peizo sensors). I have read the shift register tutorial but as all the tutorials for digital inputs use examples with switches, I was wondering given that the peizo gives an analog sinewav o/p how would you interface with the shift register? Or is there another option.


Shift registers and keypad scanning are digital techniques. For analog signals, you'll need something else, like a digital mux, or maybe external multiple-input ADCs.


thanks J.
do you have any suggestions for an ADC? I'm thinking of this one

has anyone else used an ADC to increase analogue inputs rather than using a MUX or multiple arduinos.


I don’t have any personal experience with external ADCs (got one from TI in the samples box to work with, haven’t gotten enough free cycles to do so yet).

The one you reference looks fine if 8 bits are enough resolution, but it needs lots of pins to interface to the Arduino, especially if you need more than one.

Microchip (the PIC folks) and TI have I2C interfaced ADC. Someone here on the forum referred to a Microchip model that has 8 analog inputs.


Someone here on the forum referred to a Microchip model that has 8 analog inputs.

Microchip makes the MCP3208 with 8 channels of SAR 12 bit A/D over an SPI interface. It should be around $4 at most reputable retailers.

thanks again. i've checked out the specs for the MCP3208. Am i correct in assuming that for utilising each digital input on the Arduino you will need 1 seperate MCP3208? does anyone have a wiring diagram for how they wired up the ADC and the Arduino?
any help much appreciated.

Best Regards

I found a link to another thread based on MCP3208, i will ask those arduinites if they have a wiring diagram.