Multiplexing input/output consoles to one Arduino?

I need to interface a 4x4 keypad and a lcd as input and output consoles with the same Arduino uno. I have done each interface but separately. Knowing that the lcd occupies 6 digital pins and the keypad occupies 8 digital pins, there is no capacity in the board to connect them together unless it is done a multiplexing. Right? So, I was thinking to use something like a 4052 (CMOS 4 channel multiplexer) for the sampling and share 4 pins between them and one more pin for the switching. To use the I2C bus also crossed to my mind but seems that it is more elaborated. some recommendations? Thank you!

Or a 74HC165 parallel to serial chip for the keypad
and a 74HC595 serial to parallel chip for the LCD.
http://arduino-info.wikispaces.com/Popular-ICs

Palliser:
I need to interface a 4x4 keypad and a lcd as input and output consoles with the same Arduino uno. I have done each interface but separately. Knowing that the lcd occupies 6 digital pins and the keypad occupies 8 digital pins, there is no capacity in the board to connect them together unless it is done a multiplexing. Right? So, I was thinking to use something like a 4052 (CMOS 4 channel multiplexer) for the sampling and share 4 pins between them and one more pin for the switching. To use the I2C bus also crossed to my mind but seems that it is more elaborated. some recommendations? Thank you!

The I2C buss is simple and there are a ton of lcd library's with support for i2c GPIO's (pick a chip based upon the library). There are plenty of I2C GPIO chips that can handle all the keypad work and let you just poll or attach an interrupt to process the button press (never seen an arduino lib for these but it's pretty trivial to read a register on int or by polling).

Or a 74HC165 parallel to serial chip for the keypad
and a 74HC595 serial to parallel chip for the LCD.
http://arduino-info.wikispaces.com/Popular-ICs

...just fixed the link in there... sorry!

Take a look at the Arduino libraries for ShiftIn and ShiftOut: http://arduino.cc/en/Tutorial/ShiftOut

DISCLAIMER: Mentioned stuff from my own shop...

The LCD and Keypad libraries both support mulitiplexing. You simply share any (or all) of the LCD data pins with the keypad row pins and there's no need for additional hardware. I've had this working many times. I'm not sure about the LCD control pins. You'll have to check the library to find out, or you can just try it.

There's no reason most libraries couldn't support some muxing. All the library has to do is reset its (muxable) pins each time before use, instead of just once in setup(). Then just tell the sketch authors which pins they can share.

I took the liberty to browse the Internet and found a very interesting article that solves the problem of sharing the Arduino pins between the lcd and the keypad using a 7408 (quad 2-input AND gates). The link:

this is not a perfect code, it just works.
by making the enable pin of lcd low you can prevent the key pad from making changes in the display.
the pins being shared are 9,10,11,12.
it requires no extra components.
it displays the key pressed on the keypad on the second line of the lcd display.

#include <LiquidCrystal.h> 
#include <Keypad.h>
const int rs = 8, en = 13, d4 = 12, d5 = 11, d6 = 10, d7 = 9;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};
byte rowPins[ROWS] = {9, 10, 11, 12}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {5, 6, 7}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup() { 
 lcd.begin(16,2); 
 Serial.begin(9600);
 lcd.print("hello world");
}
void loop() { 
digitalWrite(en,LOW);                    //disable the lcd for multiplexing

 char key = keypad.getKey();             //get key press
  if (key != NO_KEY){
    lcd.begin(16,2);                    //begin to type on lcd
    lcd.print("hello world");
    lcd.setCursor(0,1);
lcd.print(key);
delay(200);
  } 

}