From the course: Arduino: Prototyping

Connect the display - Arduino Tutorial

From the course: Arduino: Prototyping

Start my 1-month free trial

Connect the display

- [Presenter] So, we understand the product brief, and we've done some planning for our proof of concept prototype to explore game play. Now we have to get the prototype up and running. The display is the most complicated part, so let's get that going first. Then we can add other elements as the prototype evolves. Looking at the schematic, in addition to the LCD we see we'll need a resistor to connect the display's backlight. And we'll need a potentiometer to control the LCD contrast. These need to be placed on the breadboard and connected to the Arduino. This early prototype is a proof of concept and doesn't need to be compact, so we can use a full breadboard which gives us more room to work with. Okay, let's jump in and start wiring things up. Here we are, ready to wire up the prototype. You can see we've got the LCD, potentiometer, some neat jumper wires here, resistor, and flying jumpers. So let's start by putting the main components on the breadboard. LCD first, in the middle. Making sure to leave some room above it for the jumper wires. And we have the potentiometer here, also put that in. Now we're going to place connections from the power and ground rails to the LCD using neat jumper wires. I use red wires for positive voltage and black for ground. The color doesn't matter, they just make connections easier to identify. The ground rail will be connected to the Arduino ground and is on the edge of the board. All of our ground connections will be made to this rail. LCD pins are numbered from one to 16, with the pins at the top there, and one, five, and 16 are all connected to ground. So let's start by doing that. There is pin number one, between the ground and the pin. And pin number five. And finally, pin number 16. We also need to connect one side of our potentiometer to ground, so we can do that now. Now, LCD pin number two connects to positive power, so we can do that. Sometimes it's a little fussy getting wires in the breadboard holes. And the other side of the potentiometer also gets connected to power. We can do that. LCD pin 15, to the backlight, also needs to connects to positive, but through a 220 Ohm resistor. This limits the current so the backlight doesn't burn out. We can use the resistor as the jumper wire between the positive rail and the LCD. That completes all of our power connections. Now we'll start connecting the LCD to the Arduino. First we'll connect the RS, or register select pin, from LCD pin four to Arduino pin 12. Then we'll connect the enable pin from LCD pin six to Arduino pin 11. Now we'll attach the data lines from the LCD to the Arduino. We start with LCD pin 11 or D four, to Arduino pin five. Then we connect LCD pin 12 to Arduino pin four. Then LCD pin 13 to Arduino pin three. And finally, LCD pin 14 to Arduino pin two. Next we'll add the contrast control to the LCD by connecting the potentiometer's middle pin to LCD pin number five. We go from the middle pin to the D zero or LCD pin five. Finally, to bring power to the breadboard, connect a jumper from ground on the Arduino to the ground rail on the breadboard. Then connect a jumper from five volts on the Arduino to the positive rail on the breadboard. Now's a good time to look over your connections to make sure they're all correct. As a simple test of your wiring, you can connect a USB cable to the Arduino from your computer. You should see the backlight come on. If not, remove the USB cable and recheck connections. Success. Since the backlight works, we can test the contrast control by turning the potentiometer all the way in one direction until each character position shows a dark square. If you don't see this, try turning the potentiometer in the opposite direction. Reduce the contrast until the squares are just invisible. That's it, now we're ready to start programming.

Contents