graphical lcd display 128x64 free sample
In this project, I will show you how to interface a 128X64 Graphical LCD with Arduino UNO. This particular LCD Module is based ST7920 LCD Controller. So, we will first see a little bit about the Graphical LCD Module and its LCD Controller ST7920.
In the previous Arduino project, I have interfaced a Nokia 5110 LCD Module with Arduino. It is also a graphical LCD which can display some basic bitmap images and graphics. But the issue with Nokia 5110 LCD Module is its resolution.
At 84 x 48 pixels, the Nokia 5110 LCD can be used for implementing a menu-based user interface. Due to its small size, the resulting menu will be limited to 3 or 4 items per page.
If we want a bigger display with more real estate to work with, then the obvious choice is to go for the bigger and better 128×64 Graphical LCD Module.
As a demonstration, after making all the hardware connections, I will display a bitmap image on the Graphical LCD Module. If you are interested in implementing a simple 16×2 Alpha-Numeric LCD with Arduino, then check out this tutorial.
At first glance, the 128×64 Graphical LCD Module seems like a bigger brother to the famous 16×2 LCD or 20×4 LCD Modules, with their similar construction and almost similar pin layout.
But there is a significant difference between those two. 16×2 or 20×4 LCDs are essentially character displays. They can only display alpha-numeric characters and some simple custom characters that are confined to a 5×8 matrix.
By using different combinations of pixels, we can basically display characters of various sizes. But the magic doesn’t end there. You can display images and graphics (small animations) as well. In a 128×64 LCD Module, there are 64 rows and 128 columns.
There are several versions of the Graphical LCD in the market. Even though the usage, application and implementations are almost identical, the main difference lies in the internal LCD Controller used to drive the dot matrix display.
Some of the commonly used LCD Controllers are KS0108, SSD1306, ST7920, SH1106, SSD1322, etc. The pin out of the final LCD Module might vary depending on the LCD Controller used. So, please verify the LCD Controller as well as the pin out before making a purchase.
The Graphical LCD Module I purchased consists of ST7920 Controller. It is manufactured by Sitronix and supports three types of bus interfaces i.e., 8-bit mode, 4-bit mode and Serial interface.
If you have used 16×2 LCD Display earlier, then you might be familiar with both 4-bit as well as 8-bit parallel interfaces. The serial interface is something new and we will explore this option in this project.
As I already mentioned, double-check with the manufacturer about the pinout of the Graphical LCD Module. The following table describes the pinout of the 128×64 LCD Module that I have.
Now that we have seen a little bit about the Graphical LCD and its controller ST7920, let us now proceed with interfacing the 128×64 Graphical LCD with Arduino. I will implement a simple circuit to demonstrate how easy it is to interface the LCD and Arduino using very few external components.
So, connect the RS, RW and E of the LCD to Digital IO pins 10, 11 and 13 of Arduino UNO. Also, in order to select the Serial Interface Mode, the PCB pin must be connected to GND.
The remaining connections are similar to a traditional 16×2 LCD. VCC and GND are connected to 5V and ground of the power supply. VO is connected to the wiper of a 10KΩ POT while the other two terminals of the POT are connected to 5V and GND respectively.
Instead of displaying characters of different fonts (yes, there are libraries using which you can implement various fonts), I will straight away display an image in the form of bitmap. Before writing the code, you need to convert the bitmap image into byte arrays.
I have used the above “The Office” logo. Remember that the resolution of the 128×64 LCD is, well 128×64 pixels. So, the maximum image size should be 128×64. So, using Microsoft Paint, I have brought down the resolution of the above image to 128×64 pixels and also saved it as Monochrome Bitmap Image.
A simple project for interfacing the 128×64 Graphical LCD with Arduino is implemented here. Instead of displaying plain characters, I have displayed a bitmap image on the LCD to show its capability.
In this tutorial we will see how to interface and graphical LCD(GLCD) with PIC16F877A. In this tutorial we will look at interfacing KS0108 controller based JHD12864E display. There are many displays out there based on KS0108 or compatible display controller. They all work the same way, but make sure to check the datasheet for the pin diagram before doing the connection.
We will look at the working of the display, the hardware setup and programming with PIC16F877A. You may use any other AVR,8051,PIC,ARM controller as well. We have it tested and working on 8051, AVR, PIC and ARM. We have similar tutorials on these MCUs as well.
Unlike a 16 x 2 display, this does not have a character map for ascii values stored on its ROM. However it allows us the flexibility of creating fonts like Arial, times new roman etc. We could also display bit-map images on it and stretching it little further we can make GUI"s and little animation, but that"s for another day. So lets get started.
This light, thin, low-power graphic LCD display (CFAG12864U2-TFH) is an LED backlit, 128x64 graphic display module. It"s visible in all lighting situations, from darkness, normal office lighting, and up to bright sunlight. Making it an excellent daylight readable LCD solution.
Since this graphic LCD is a transflective, positive-mode display, the backlight may be turned off when there is sufficient ambient light to read the display. Turning the backlight off will further reduce the already low power consumption. This display is well suited for compact hand-held devices, or any application where a lot of display in a very small area is needed.
This LCD display has an integrated controller and voltage generating components mounted on the flexible tail. The tail connects to a standard 18-conductor 0.5mm pitch ZIF (Zero Insertion Force) connector:Typical top contact: TE Connectivity 1-1734839-8 (DigiKey P/N A100297TR-ND)
This type of connector is mounted like any normal SMT component during your board"s standard reflow cycle. The display can then be connected to the PCB at final assembly without soldering or tools.
In this tutorial i am going to teach you how to interface graphical lcd 128×64 with 8051(89c51,89c52)microcontroller. 128×64 means that lcd has 128 coulombs and 64 rows. Which means you can make your desired image or text in 128×64 matrix square. Graphical lcds comes in many sizes, they also differ in characteristics. Some can be directly connected to your PC and you just need to learn simple commands to send pictures and text to lcd, these graphical lcds comes with free software with them. Some are just simple lcds and you need to control them with some intelligent unit like microcontroller etc. In this tutorial we are going to control the same simple graphical lcd using 89c51 microcontroller. We will display text on graphical lcd using 8051 microcontroller.
I am going to interface jhd12864e graphical lcd with 8051 microcontroller.To learn about full pin description and internal organization of pixels of jhd12864e graphical lcd please go through the simple tutorial. This will lead you to easily understand the code written below.
The above tutorial is very important to understand the GLCD code below. If yon don’t know about the GLCD working then you can not understand the 8051 microcontroller with GLCD code below. Pin out of GLCD jhd12864e is given below.
I am going to print my website name “microcontroller-project.com” on glcd. First i decided text font to display on GLCD. II finalized the character height to 8 rows and 5 to 6 coulombs in width. You can display text according to your desire. Since you have lot of available space from 128 coulombs to 64 rows. Combine pages to make font greater and greater(If you don’t know what is page in graphical lcd please go through the upper tutorial).
Now when you are done with initializing glcd and selected glcd half and page. Its time to make/display text or image on glcd. Each page of GLCD is organized in rows and coulombs (8×64 in dimension) 8 rows and 64 coulombs. Each coulomb in a page has 8 dots aligned vertically. We send an eight bit data to make these dots ON or OFF. 0 is OFF and 1 is ON. A simple command like FF=11111111 makes all dots of coulomb ON & F0=11110000 makes first four dots OFF and last four ON. You make your desired text or image by making these pixels ON or OFF. The combination of all coulombs makes a picture.
For example to display the ‘M‘ character on Glcd the data send to GLCD is below. Data is send to glcd 8-bit at a time. 8-bit data is in hexadecimal format. If we translate hexadecimal to binary it will represent the below character. Last command is not displaying any thing. Its actually the gap for another character to appear a head of ‘M‘.
Circuit diagram of the project is simple. Connect Port-1 of 8051(89c51,89c52) microcontroller with data pins of graphical lcd. Port-3 pin 0 is connected to rs(register select) pin of graphical lcd. Port-3 pin 1 is connected to rw(read-write pin of graphical lcd). Port-3 pin 2 is connected to en(enable) pin of lcd. Port-3 pin 3 and 4 are connected to cs1(chip select 1) and cs2(chip select 2) to 128×64 graphical lcd. Port-3 pin 5 is connected to reset pin of 128×64 graphical lcd. Rest of the connections are for 8051 microcontroller initialization. Circuit diagram of the project is below.
Coming to code of GLCD project. it is written in c language using keil uvision 3 software to compile and create hex code. First the header file reg51.his included(it is to be included in every project made in keil for 8051 microcontroller). Then single bits of Port-3 are defined. These pins are used to control jhd12864e graphical lcd. delay() function is generating some delay for us to be used where necessary. lcdcmd() function is sending commands to glcd. lcddata() function is sending data to glcd. The main function is controlling all the displaying and control functions. Each command is commended with its function.
Note: Some graphical lcds select cs1, cs2(chip select) on 1 and some with 0. If you are using this code be sure that 0 selects your cs1 & cs2. If not 0 then switch cs1 & cs2 in the code just make cs1=1 where it is 0 and cs2=0 where it is 1.
ST7920 is a so-called LCD which stands for Liquid Crystal Display. This screen is made up of segments that can be turned on or off. These segments are placed as an "8" in some screens like a digital clock, in others as pixels.
With LCD it looks like the boxes can become black. Technically this is not true. The light is transmitted differently making it appear black. More details on Wikipedia
The U8g2 library is specially made to easily control monochrome displays in an universal way. U8g2 allows you to draw graphic elements such as lines, rectangles, circles on the screen. Text is also no problem.
An overview of all available functions can be found on the U8g2 reference page. Currently U8g2 supports over 200 different displays. The big advantage is that you don"t have to find out how to control each individual display.
breadboard. If you put the display into the breadboard you"ll see that the pin labels are no longer visible. To solve this I"ve created a pin overlay. Print this PDF and cut out the overlay. You can now place this exactly at the bottom of your display and see the pin labels again.
The next step is to provide 5V to the LCD. To do this, we use the "Vcc" and "GND" pins on the far right of the display. Connect these to the + rail and- rail on the breadboard.
Now we have to tell the display how we are going to provide the data. We are going to use the SPI (Serial Peripheral Interface) protocol. The name already reaveals it a bit, the data is serial. With the PSB pin we can set the data transfer mode.
If we make the PSB pin high, the display expects parallel data, withLOW serial. In our case we have to make the PSB pin LOW by connecting it to the - rail.
The last step is to connect the CS (chip select) wire. On the display it is labeled RS which stands for Register Select and it will be connected to pin 10 on the Arduino.
1 //U8G2_ST7920_128X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18 /* A4 */, /*cs=*/ U8X8_PIN_NONE, /*dc/rs=*/ 17 /* A3 */, /*reset=*/ 15 /* A1 */);
NHD-12864WG-CTFH-V#N | Monochrome Graphic Module | 128x64 Pixels | Transflective LCD | Side White Backlight | FSTN (+) Positive Display | Built-in Negative Voltage
Newhaven 128x64 graphic Liquid Crystal Display module shows dark pixels on a white background. This transflective LCD Display is visible with ambient light or a backlight while offering a wide operating temperature range from -20 to 70 degrees Celsius. This NHD-12864WG-CTFH-V#N display includes built-in negative voltage. It has an optimal view of 6:00, operates at 5V supply voltage and is RoHS compliant.
Easily modify any connectors on your display to meet your application’s requirements. Our engineers are able to perform soldering for pin headers, boxed headers, right angle headers, and any other connectors your display may require.
Choose from a wide selection of interface options or talk to our experts to select the best one for your project. We can incorporate HDMI, USB, SPI, VGA and more into your display to achieve your design goals.
NHD-12864AZ-FL-YBW | Monochrome Graphic Module | 128x64 Pixels | Transflective LCD | Yellow/Green Backlight | STN (+) Positive Yellow/Green Display | Non-Stocked
Newhaven 128x64 graphic Liquid Crystal Display module shows dark pixels on a bright yellow/green background. This transflective LCD Display is visible with ambient light or a backlight while offering a wide operating temperature range from -20 to 70 degrees Celsius. This NHD-12864AZ-FL-YBW display has an optimal view of 6:00, operates at 5V supply voltage and is RoHS compliant.
Easily modify any connectors on your display to meet your application’s requirements. Our engineers are able to perform soldering for pin headers, boxed headers, right angle headers, and any other connectors your display may require.
Choose from a wide selection of interface options or talk to our experts to select the best one for your project. We can incorporate HDMI, USB, SPI, VGA and more into your display to achieve your design goals.
Can you control the backlighting by using PWM on the backlight voltage pin? It"s connected to Vss by default which applies the entire 5v to the pin, but if I can PWM the pin and apply a lower voltage will that dim the display? In essence I"m looking for a way to dim the display using an MCU. Also, when dimmed does it draw less current? (I"m thinking it does, less photons means less work which means less current).
Also, I"m assuming that a lot of current is most likely drawn from that backlight pin so I plan on placing a transistor between the MCU and the LCD which I will drive from the MCU via PWM.
Thanks for sharing your library. I ported it to the XMEGA style and it worked except that I need to add a reset in lcd_init(). I initialized the control port with RESET low, and then I promptly set it high.
The current version of this graphic display (GDM12864H) has a unique feature that I have not seen in any other 128x64 graphic LCD. Its pixels (and pitch) are square (0.39x0.39mm) so your circles appear as circles -- no more ellipses!!!
Thanks for posting. Please explain why you have 2K ohm connected to the V0 and VEE pins? This LCD has built-in DC converter to drive the LCD already?
Someone noted above that the voltage needs to be fairly low (~-4V) to see the darkness of the pixels. If you hook a pot up, be sure to wipe it to both extremes to see if you can atleast see a big black box when the LCD has power, then you know atleast your contrast works and you"re getting power!
astromme - I am currently working on a project with this serial graphic display and I am interested in using the MSP430 could I get a copy of the adapted Arduino ks0108 library? Thank you, this would be greatly appreciated.
You should look on the product page"s documents. There"s links to get it working with an Arduino microcontroller. Also, there is an article on Arduino if you did an online search with example code and a hookup guide => http://playground.arduino.cc/Code/GLCDks0108.
I recently bought this LCD to use with a Maple Mini board. What Library should I use with it? I found the KS0108 Graphics LCD library on the Arduino page. That seems to be more useful than the LiquidCrystal library which doesn"t seem to work with this 20-pin LCD.
The one i ordered off sparkfun nearly a month ago was of the " small fraction of the glcds out there will need a reset pulse" variety? it took me a few days and several hours to realize, i had to waste another pin. The solution was to go into the library and un-comment part of the code as described at the bottom http://www.arduino.cc/playground/Code/GLCDks0108/
I"m looking for a similar specs LCD, but with a white or blue backlight.. I"m planning on adding it next to my motorcycle OEM screen, and being green would quite likely be an ugly mismatch.
Make sure that you have a 100 to 330 ohm resister in series with the LCD backlight. Some of the documentation is not clear on this, but the resister must be there or the LED backlight will act like a dead short as soon as the voltage rises above the LED forward bias - usually about 2.0V.
So, stupid question, the LCD screen says it needs 9V to work. Is that supplied by the circuits on the board, or do you need to create a step-up dc converter to change 5V into 9V?
While the microcontroller was running, i had to take the display off my test board, because (stupid as i was) i mounted the V0 pot-meter under it. When i connected it back it was working!
On the page Csloser links to, he recommends a pull down resistor. Could anyone comment on the importance of this? Could this be the cause of my one line LCD?
I grabbed the software and loaded it. The backlight works and at first I saw a few lines on the display itself (these faded). When I ran the software from that web page, nothing came out on the display. I played with the contrast potentiometer a little, but I still see nothing. The program is running (I added some Serial output for debugging).
I forgot to mention that the LCD voltage, in my experience, should be around -4V for the display to be readable. Close to -5V will turn all of the pixels fully on and above -3V they will be totally transparent. Other units may behave differently but this is how mine works.
I intended to drive this LCD with an ATmega168, which now appears to be an astonishingly bad idea if the uC has only 1K RAM and you need that to drive the LCD. True? Or am I missing something completely obvious to the non-novice? It looks like I need a separate uC (like the DiosPro) to drive the LCD, with the 168 uC controlling the DiosPro via the UART? Happy to take advice....
You don"t have to devote any ATmega168 RAM to the LCD. This component has its own video RAM, one bit per pixel, 512 bytes total. I think you have to write whole bytes at a time (8 pixels), and it doesn"t know how to draw a letter "A" by itself, but the App Note from Kronos Robotics says they have a higher-level Dios library to deal with such operations.
FSTN, Transflective (positive), 6:00 view, Operating Temp: -20C to +70C, Storage Temp: -30C to +80C, 1/64 Duty, 1/9 Bias, 3.0V LCD, 3.2V LED, RGB LED Backlight.
FSTN (Film-compensated Super-twisted Nematic) provides a sharper contrast than STN by adding a film. The cost is approximately 5% higher than STN. FSTN works great for indoor and outdoor applications and is mainly used in graphic displays and higher end products. The Transflective polarizer is a mixture of Reflective and Transmissive. It provides the ability to read the LCD with or without the backlight on. It will work for all lighting conditions from dark with backlight to direct sunlight which makes it the most common choice. There is no cost difference between Transflective, Transmissive and Reflective.
Focus LCDs can provide many accessories to go with your display. If you would like to source a connector, cable, test jig or other accessory preassembled to your LCD (or just included in the package), our team will make sure you get the items you need.Get in touch with a team member today to accessorize your display!
Focus Display Solutions (aka: Focus LCDs) offers the original purchaser who has purchased a product from the FocusLCDs.com a limited warranty that the product (including accessories in the product"s package) will be free from defects in material or workmanship.
Ordinary LCDs can only display simple text or numbers within a fixed size. But in 128×64 graphical LCD display, there is 128×64 = 8192 dots, which is equivalent to 8242/8 = 1024 pixels. So, it can display not only simple text or numbers within a fixed size but also simple graphics.
In the above code, which is an example of Arduino, after installing the relevant library, we first need to uncomment the line that is related to the specific LCD settings (line 66, U8GLIB_ST7920_128X64_4X u8g (10);). Then upload the code to Arduino.
Orient Display is a company that specializes inmanufacturing graphic LCD, graphic display modules and many more. The company was founded in 1996 by specializing in fields of production, R&D, quality controls. Thanks for the management and employee’s continuous hardworking and enormous effort and shareholder continuous investment over years, Orient Display factory is now the world’s lead LCD graphic displays manufacturer in flat panel industry and is listed as a public company in China stock market.. Now, Orient Display factory has 3 plants that can produce graphic LCD modules. Factories have complete quality and environment management system, ISO9001, ISO/IATF16949, ISO14001, IECQ QC080000. It is also No.1 in the world for automotive capacitive touch screen which took around 18% market share in the world automotive market.Orient Display has extensive graphic LCD displays (liquid crystal display) standard product lines in dot matrix format of graphic resolution including 122×32, 128×64, 128×128, 160×32, 160×64, 160×160, 192×48, 192×64,202×32, 240×64, 240×160, 240×128, 282×128, 320×240 etc. The sizes range from 1.0” LCD to 5.2” LCD display.
Orient Display graphic LCD display modules includedifferent options of polarizer in reflective (saving power),transmissive (better contrast) or transflective (sunlight readable and battery powered) types.
Orient Display graphic LCD display modules have the selection of different display technologies from low-cost TN (twisted nematic), HTN (high performance twisted nematic), to higher end yellow green STN (super twisted nematic), blue STN, gray STN, FSTN (Film compensated STN), vertical alignment LCD to even higher quality wide viewing angle and automotive grade FFSTN, ASTN to meet different requirements.
Orient Display graphic LCD display modules also have different kinds for package technologies from traditional COB (Chip on Board), to TAB (Tape Automatic Bonding), to highly compacted COG ( Chip on Glass) and COF (Chip on Film).
Orient Display graphic LCD display modules have the options of different colors of backlight, yellow green, pure green blue, red, orange, amber and RGB (Red-Green-Blue) to make the monochrome LCDs more colorful.
Orient Display graphic LCD display modules have most available interface choices, I2C, SPI, parallel 6800, 8080, MCU etc. With our strong technical capability, some of our graphic LCD products are with Arduino shield which are more convenient for our customers.
Orient Display graphic LCD display modules have touch panel options. The 2.7” JAZZ 128×64 dot matrix graphic LCD display series has option of RTP (Resistive Touch Panel). Most of Orient Display graphic LCD displays can be custom made either with RTP or CTP (Capacitive Touch Panel).
Orient Display graphic LCD displays have been widely used in industry instrument, meters, machinery equipment, home appliances, white goods, smart home monitors, thermostats, automation, hand held medical devices, automotive, POS systems, audio/visual display systems, marine, aerospace, toys etc.