Controlling a Character LCD With an Arduino
by baharini in Workshop > Science
100614 Views, 99 Favorites, 0 Comments
Controlling a Character LCD With an Arduino
Hello! Today I will be introducing Character LCDs and showing how to connect them to an Arduino.
It is all very simple and uses only 6 PINS TO INTERFACE WITH!
Note: the image is not mine and comes from http://www.micro-examples.com/public/microex-navig/doc/078-lcdscope.html
It is all very simple and uses only 6 PINS TO INTERFACE WITH!
Note: the image is not mine and comes from http://www.micro-examples.com/public/microex-navig/doc/078-lcdscope.html
Parts Needed
You will need the following components to perform this project:
1x '''Arduino (any kind will do)'''
1x '''HD44780 character LCD'''
'''lots of non-stranded wire'''
One 10k Potientiometer
1x '''Arduino (any kind will do)'''
1x '''HD44780 character LCD'''
'''lots of non-stranded wire'''
One 10k Potientiometer
LCDs are pretty usefull things.
They can be used for a project which needs to display something small, to huge machinery.
After all, they are always used for the same purpose.
I will be using a HD44780 Character LCD, with a 16x2 display. (2 lines, 16 characters per line)
They come in all sizes, from 8x2 to 40x4.
they have a 8x5 font and can use up to 8 custom characters.
These LCDs have 16 pins, but only 11 of them are for communication. we will use 6 of them for 4 bit mode.
These LCDs can be run in 4 or 8 bit mode, depending on how many pins you have.
4 bit mode is usefull for saving pins, but only has a refresh rate of 74ms
8 bit mode is usefull for a fast refresh rate (5ms), usefull for displaying custom character animations.
The image shows a few Custom Characters.
Note: the image is not mine and comes from http://www.micro-examples.com/public/microex-navig/doc/078-lcdscope.html
They can be used for a project which needs to display something small, to huge machinery.
After all, they are always used for the same purpose.
I will be using a HD44780 Character LCD, with a 16x2 display. (2 lines, 16 characters per line)
They come in all sizes, from 8x2 to 40x4.
they have a 8x5 font and can use up to 8 custom characters.
These LCDs have 16 pins, but only 11 of them are for communication. we will use 6 of them for 4 bit mode.
These LCDs can be run in 4 or 8 bit mode, depending on how many pins you have.
4 bit mode is usefull for saving pins, but only has a refresh rate of 74ms
8 bit mode is usefull for a fast refresh rate (5ms), usefull for displaying custom character animations.
The image shows a few Custom Characters.
Note: the image is not mine and comes from http://www.micro-examples.com/public/microex-navig/doc/078-lcdscope.html
Connections
Connect the LCD according to this picture:
Test Code 1: Hello World
First, open the file i have added to this step.
Second, copy and paste the file into the Arduino IDE.
Lastly, click the UPLOAD TO I/O board button, or CTRL+U
if everything went to plan, it should now say "Hello World!".
Second, copy and paste the file into the Arduino IDE.
Lastly, click the UPLOAD TO I/O board button, or CTRL+U
if everything went to plan, it should now say "Hello World!".
Downloads
Test Code 2: Using 2 Lines
NOTE: For this to work, you will need Arduino - 0017.
open and upload this next program.
it will now say:
Hello
World
open and upload this next program.
it will now say:
Hello
World
Downloads
Test Code 3: Custom Characters
NOTE: to use this feature, you will need Arduino - 0017 or higher.
Now what we will need to do is download LCD CUSTOM CHAR CREATOR.exe (download below)
Also open the Arduino IDE and copy and paste Arduino_custom_char_example.txt into the IDE.
Open up LCD CUSTOM CHAR CREATOR.exe and type ",0x" into the "Insert before entries" box.
Then click on the pixels to create a character. (I made a smiley)
Then, copy the hex code (highlited in the picture to this part in the IDE:
Now what we will need to do is download LCD CUSTOM CHAR CREATOR.exe (download below)
Also open the Arduino IDE and copy and paste Arduino_custom_char_example.txt into the IDE.
Open up LCD CUSTOM CHAR CREATOR.exe and type ",0x" into the "Insert before entries" box.
Then click on the pixels to create a character. (I made a smiley)
Then, copy the hex code (highlited in the picture to this part in the IDE:
uint8_t custom_hex1[8] = {0x00,0x0A,0x00,0x11,0x0E,0x00,0x00,0x00};
NOTE: on the program, it has a comma at the beginning, so just highlight the text after the first comma, and press CTRL+C to copy.
Then click UPLOAD TO I/O BOARD (Or CTRL+U)