Introduction: Arduino- Controlling LED's With a 4x4 Keypad
Today, I am going to show you how to create and use a 4x4 keypad controlling LED's.
Step 1: Materials
- Arduino Uno Board
- USB cable x1
- Jumper wires x20
- LED's x8
- RGB LED x1
- 220Ohms Resistor x11
- 4x4 keypad x1
Step 2: Connecting the Keypad to the Arduino Board.
D2 - Pin1
D3 - Pin2
D4 - Pin3
D5 - Pin4
D6 - Pin 5
D7 - Pin 6
D8 - Pin 7
D9 - Pin 8
Now, you have to connect
D 9-13 with LED's on the board in series. (As show in picture)
Step 3: Connecting the LED's and Resistors
Make sure one side of each resistor is connected to ground.
On the other side of the resistor, connect the negative side of the LED.
ADDING THE RGB LED
Make sure each leg is connected with a resistor. (except for the ground leg).
and from the resistor, a jumper wire is connected to the other jumper wires that is already hooked up with the LED's that have been mentioned earlier.
Step 4: Schematic
Here is the schematic:
Step 5: Using the Keypad
*from left to right on the board: RGB LED, LED #1,2,3,4... etc.
Pressing Pin #1 - will light up LED 1 and 5
Pressing Pin #2- will light up LED 2 and 6
Pressing Pin #3- will light up LED 3 and 7
Pressing Pin A- will light up LED 4 and 8
*pressing pin #1,3 and 4 will individually light up the RGB LED.
Pressing Pin #4- will turn off LED 1 and 5
Pressing Pin #5- will turn off LED 2 and 6
Pressing Pin #6- will turn off LED 3 and 7
Pressing Pin B- Will turn off LED 4 and 8
Step 6: Using the Keypad Part 2
Pressing Pin C and D- will turn on all the LED's (including RGB)
Pressing Pin 7 and * - will turn off all the LED's (reset)
Pressing Pin #9 and #- will light the LED's from left to right
Pressing Pin #8 and #0- will light the LED's from right to left
Step 7: Arduino Code
Here is the code.
Just open this file and your ready to go!
In the picture above, (make sure each led pin is together with one being LOW and the other being HIGH)