I would like to make Keypad switch for lights in my house. What I want to achive is, that when I will enter correct code, 4 of 220v lights will turn off, and one small one will turn on.
I have
arduino Mega 2560
Keypad http://www.ebay.com/itm/2PCS-4x4-Matrix-16-Key-Membrane-Switch-Keypad-Keyboard-for-Arduino-/261408494765
How should I connect all pins together and how should program look like?
To get started have a look at the Arduino keypad library found at Arduino Playground - HomePage. Then you're going to want to look at understanding how relays work and how you control them. There is a good starting point at http://arduino-info.wikispaces.com/ArduinoPower. Cheers