Difference between revisions of "LCD2004 Module"

From Wiki
Jump to: navigation, search
Line 1: Line 1:
 
==Introduction==
 
==Introduction==
LCD2004, or 2004 character-type liquid crystal display, is a kind of dot matrix module to show letters, numbers, and characters and so on. It's composed of 5x8 dot matrix positions; each position can display one character. There's a dot pitch between two characters and a space between lines, thus separating characters and lines. The number 2004 means on the display, 4 rows can be showed and 20 characters in each. <br>
+
LCD2004, or 2004 character-type liquid crystal display, is a kind of dot matrix module to show letters, numbers, and characters and so on. It's composed of 5x8 dot matrix positions; each position can display one character. There's a dot pitch between two characters and a space between lines, thus separating characters and lines. The number 2004 means on the display, 4 rows can be showed and 20 characters in each.<br>
 +
Generally, LCD2004 has parallel ports, that is, it would control several pins at the same time. LCD2004 can be categorized into eight-port and four-port connections. If the eight-port connection is used, then all the digital ports of the SunFounder Uno board are almost completely occupied. If you want to connect more sensors, there will be no ports available. Therefore, the four-port connection is used here for better application.<br>
 +
 
 +
 
 +
 
 
===Pins of LCD2004 and their functions===
 
===Pins of LCD2004 and their functions===
 
VSS: connected to ground<br>
 
VSS: connected to ground<br>
Line 10: Line 14:
 
D0-D7: to read and write data<br>
 
D0-D7: to read and write data<br>
 
A and K: Pins that control the LCD backlight. Connect K to GND and A to 3.3v. Open the backlight and you will see clear characters in a comparatively dark environment. <br>
 
A and K: Pins that control the LCD backlight. Connect K to GND and A to 3.3v. Open the backlight and you will see clear characters in a comparatively dark environment. <br>
 +
==Components==
 +
- 1 * SunFounder Uno board<br>
 +
- 1 * Breadboard<br>
 +
- 1 * LCD2004<br>
 +
- 1 * Potentiometer (50kΩ)<br>
 +
- 1 * USB cable<br>
 +
- Jumper wires<br>
 +
==Experimental Principle==
 +
 +
 +
 +
Connect K to GND and A to 3.3 V, and then the backlight of the LCD2004 will be turned on. Connect VSS to GND and the LCD2004 to the power source. Connect VO to the middle pin of the potentiometer – with it you can adjust the contrast of the screen display. Connect RS to D4 and R/W pin to GND, which means then you can write characters to the LCD2004.  Connect E to pin6 and the characters displayed on the LCD2004 are controlled by D4-D7. For programming, it is optimized by calling function libraries.<br>
 +
==Experimental Procedures==
 +
''<font color="red">Note:</font> before connecting circuit, need to plug the pin headers onto a breadboard, and then put the LCD2004 on to it for easy soldering.''<br>
 +
 +
 +
 +
Step 1: Build the circuit (make sure the pins are connected correctly. Otherwise, characters will not be displayed properly):<br>
 +
 +
 +
 +
Step 2: Copy the follwing code to the Arduino IDE ,click to the upload icon to upload the code to the control board.<br>
 +
<pre>
 +
 +
 +
</pre>
 +
Step 3: Select correct Board and Port<br>
 +
Step 4: Upload the sketch to the SunFounder Uno board<br>
 +
''<font color="red">Note:</font> you may need to adjust the potentiometer on the LCD2004 until it can display clearly.''<br>
 +
==Experimental Phenomenon==
 +
You should now see the characters "SunFounder", "hello, world!", "LCD2004" and "20 row 4 col" rolling on the LCD.<br>

Revision as of 08:46, 6 May 2017

Introduction

LCD2004, or 2004 character-type liquid crystal display, is a kind of dot matrix module to show letters, numbers, and characters and so on. It's composed of 5x8 dot matrix positions; each position can display one character. There's a dot pitch between two characters and a space between lines, thus separating characters and lines. The number 2004 means on the display, 4 rows can be showed and 20 characters in each.
Generally, LCD2004 has parallel ports, that is, it would control several pins at the same time. LCD2004 can be categorized into eight-port and four-port connections. If the eight-port connection is used, then all the digital ports of the SunFounder Uno board are almost completely occupied. If you want to connect more sensors, there will be no ports available. Therefore, the four-port connection is used here for better application.


Pins of LCD2004 and their functions

VSS: connected to ground
VDD: connected to a +5V power supply
VO: to adjust the contrast
RS: A register select pin that controls where in the LCD’s memory you are writing data to. You can select either the data register, which holds what goes on the screen, or an instruction register, which is where the LCD’s controller looks for instructions on what to do next.
R/W: A Read/Write pin to select between reading and writing mode
E: An enabling pin that reads the information when High level (1) is received. The instructions are run when the signal changes from High level to Low level.
D0-D7: to read and write data
A and K: Pins that control the LCD backlight. Connect K to GND and A to 3.3v. Open the backlight and you will see clear characters in a comparatively dark environment.

Components

- 1 * SunFounder Uno board
- 1 * Breadboard
- 1 * LCD2004
- 1 * Potentiometer (50kΩ)
- 1 * USB cable
- Jumper wires

Experimental Principle

Connect K to GND and A to 3.3 V, and then the backlight of the LCD2004 will be turned on. Connect VSS to GND and the LCD2004 to the power source. Connect VO to the middle pin of the potentiometer – with it you can adjust the contrast of the screen display. Connect RS to D4 and R/W pin to GND, which means then you can write characters to the LCD2004. Connect E to pin6 and the characters displayed on the LCD2004 are controlled by D4-D7. For programming, it is optimized by calling function libraries.

Experimental Procedures

Note: before connecting circuit, need to plug the pin headers onto a breadboard, and then put the LCD2004 on to it for easy soldering.


Step 1: Build the circuit (make sure the pins are connected correctly. Otherwise, characters will not be displayed properly):


Step 2: Copy the follwing code to the Arduino IDE ,click to the upload icon to upload the code to the control board.



Step 3: Select correct Board and Port
Step 4: Upload the sketch to the SunFounder Uno board
Note: you may need to adjust the potentiometer on the LCD2004 until it can display clearly.

Experimental Phenomenon

You should now see the characters "SunFounder", "hello, world!", "LCD2004" and "20 row 4 col" rolling on the LCD.