This guide assumes you already have some prior/intermediate knowledge of developing on Raspberry Pi's and utilizing GPIO. It also assumes you will be using a breadboard
for wiring things up.
If this is your first time, I suggest you start here first: Raspberry.Pi.Hacking.pdf
HD44780 Schematic
Raspberry Pi Pinout
Connecting up the LCD (Power)
1. Connect VSS from the LCD into -/Ground on the breadboard.
2. Connect VCC from the LCD into +/Positive on the breadboard.
3. Connect VO from the LCD into -/Ground on the breadboard.
4. Connect LEDA from the LCD to +/Positive on the breadboard.
** Note: By connecting the middle pin of a 10k potentiometer to VO, you will be able to adjust the brightness of the LCD.
Though this has not been used in this guide..
Powering LCD from Raspberry Pi (5V)
1. Connect Pin 6/Ground from the Raspberry Pi into -/Ground on the breadboard.
2. Connect Pin 2/5V from the Raspberry Pi into +/Positive on the breadboard.
NOTE: Make sure you are using 5V, not 3.3V for the LCD!
Wiring the Buttons to the Raspberry Pi
You have to be careful on this part of building the circit, there is a chance of causing damage to the pins if they are accidentally setup as an output when using
buttons. If you drive the pin LOW, the output is connected directly to Ground. Pushing the button after will create a short circuit between 3.3v and Ground.
Your Pi will NOT like this... =)
NOTE: To keep the Pi happy, you can put a 1k limiting resistor between the pin and the GPIO pin on the Raspberry Pi.
This resistor will ensure the pi can handle the current being drawn from it in case of accidents and/or user errors...
Before connecting up any wires, make sure you have double checked the datahseets for the buttons you will be using for proper pin configuration.
1. Pin 1 from the button connects to 3.3V on the breadboard with a 10k resistor
2. Pin 1 from the button connects to GPIO # corelating to the buttons function.
3. Pin 2 from the button connects to -/Ground on the breadboard.
4. Repeat steps 1-3 for each button using the mappings above.
You will need 6 Buttons total.
Button Schematic Example
When a GPIO pin is set to be an IN/input, it is put into a "floating" state and has no defined voltage level.
So when wiring the buttons, they need to be wired so they will have a HIGH or LOW change of state when pressed.
This is done by using a 10k pull down resistor into -/Ground. By using a 10k resistor will create a path to -/Ground and the pin
will read LOW when the button is not pressed. When the button is pressed and you have the other side connected to 3.3V, there will
be a lower resistance path to -/Ground and the pin will then read HIGH.
Using a large 10k resistor will make sure only small amounts of current are pulled from the Raspberry Pi when the button is pressed.