i am making a poject in which i have to connect an lcd, a 4x4 keypad, gsm modem, servo motor with arduine, but the problem is that there are not so many pins in arduino. So how shall i interface all these things together?
Do some research on keypads. You should find that a 4x4 will get by with a lot less than you think. Also, a typical LCD 16x2 or 20x4 can sue I2C bus and thus use only two signal pins. This is a battle you will probably win.
what about the Vcc that is needed for every single component, we have only 2 power Vcc pins in arduino
Check the current demand. The motor is likely to require its own power. Arduino can be expected to handle the rest.
can i use 8051 for lcd and keypad and then interface 8051 output with arduino
calculated the power consumption and No of pins required by each device. IF 4x4 doesn't work in sense of pin Use below shield
can i use 8051 for lcd and keypad and then interface 8051 output with arduino
Yes, you can use any processors as a co-processor, so far it's not obvious that such complication is required thought. If it turns out that you do need more pins why not just get a bigger Arduino?
Just roughly
lcd: maybe 2 but max 5-6
4x4 keypad: 8
gsm modem: 2
servo motor: 1
That's about 17 pins but could be less if the LCD is a serial device.
Rob
An 8051? Are you mad? That's 10x as complicated as using an Arduino; if you really needed more IO then just buy a bigger board like a mega, or use a couple of shift registers or similar. Or a 74HC138+8x74HC245 if you need loads of pretty-fast IO.
Anyway, you can share pins between multiple devices in some circumstances. What I do when interfacing both an LCD and a matrix keypad is to share the 4 LCD data lines with the 4 LCD row pins, separated by about 6k8 each. There's a schematic and board design linked here, but the basic principle is that:
- you set the 4 pins as outputs
- when writing to the LCD, the arduino signals will be dominant, so that's fine
- when scanning the keypad, you drive one of the shared pins at a time
I'd allocate it approximately as follows (or see the schematic+board I linked above):
- modem on D0/D1 (UART)
- D8, D9: LCD EN, RS
- D10: LCD backlight PWM
- D4-D7: shared LCD data and keypad rows
- A0-A3: keypad columns
- D11: servo PWM
- A4, A5, D2, D3, D12, D13: all spare!
D2 and D3 (interrupts!) are nice to keep free because they can support a rotary encoder, which is a great user interface element. See again the linked schematic.