Post a Comment
Back to Projects
< PrevNext >
  Welcome Guest !
Learn Basics

PIC Basic - Interfacing With an LCD Screen JHD162A

  PRO129

This project is first part of a series of projects designed to experiment and understand how PIC microcontroller can be effectively used to interface with external circuit and get data from and control external devices. Once you have completed hands on experiment with this series you should able to design a minimal robot or other such relatively complex programmable control system.

To see a list of all basic PIC projects planned in this series please click here. To get a basic understanding of PIC microcontrollers and how to use them please click here. This link covers the basic FAQ of PIC for newbies as there is a lot of literature available on the web for advanced users.

In this project we will integrate PIC with a basic LCD with 16 charactor width and having two lines. LCD is a very important tool in PIC programing, as it can be used for debugging embedded programs easily. The other option available is to use a serial port and spit out these information on to a PC. But I prefer LCD as your board is not tied down to a PC.

Typically the type of LCD used here has 16 pins, of which two are used for back-light (to see in the dark). Two are used for power supply. one is used for controlling the contrast of the screen. Rest 11 pins are used for send and receiving data to the LCD screen. Of the 11, eight pins are used for sending/receiving one byte (8 bits) of data at a time. Of the emaining three one is used for flaging as read/write operation. second identifies the data as a command or display data and the third is used as a clock/strobe to tell the device that data is ready to read. This LCD uses HD44780 driver chip and follows protocol specified in its datasheet for communication.

Though there are 8 pins for transmitting data we can also configure the LCD to transmit/receive data 4 bits, 2bits or 1 bit at a time. Before we start sending data for display there is an 8 step process to initialise and configure the LCD. During this process the specified delays need to be applied between the steps to correctly setup the LCD. (see below programm code for details). In this project we are using 4 bit (4 wire) transfer method.

As we started using more wires to connect together these components it was observed that reliability of the connections are very important for getting the LCD working. Hence it is recommended to use a general purpose PCB and solder the components os that project can be done easily without much frustration. It is also recommended to perform an end-to-end ( chip base to LCD pins) connectivity check to ensure no broken connections.

Youtube Demo
Also go through the datasheets for PIC16F84A to get a good understanding of other details of the microcontroller.
The C compiler used for this project is Hi-TECH light
Click to view PIC code
The compiled HEX file. (this can be directly burned into your PIC)
click here


List of parts used in the project
Ref Part type Part Name Value Count Info
 Bat1BATTERYPACKBattery Pack 12V AA12V1 See Picture
 C1,C2CAPACITORCapacitor 27pF27pF2 See Picture
 C3,C5ELECCAPACITORElectrolytic Capacitor 220uF220uF2 See Picture
 C4ELECCAPACITORElectrolytic Capacitor 0.1uF0.1uF1 See Picture
 Cr1CRYSTALCrystal 4.0 MHz4.0MHz1 See Picture
 IC1ICPIC 16F84A1684IC1 See Picture
 IC2ICIC LM78057805IC1 See Picture
 LCDDISPLAYLCDLCD 16x2 JHD162AJHD162ALCD1 See Picture
 POT1POTPot Meter 10K10K1 See Picture
 R1RESISTORResistor 10K10K1 See Picture
 R2RESISTORResistor 470Ohm470Ohm1 See Picture


Approximate cost for building this project is Rs 527.00


Note: In addition to the above components you may also require a breadboard and power supply / batteries for building this project.


Post a comment or question
Post Type:
Comment:
Please login to post a comment or question
Click here to login or register
Posts from the Users
Posted by: Ganesh Waghmode
Date: 2013-03-05 16:31:12
Type: Comment
GOOD PROJECT
Posted by: Krishna K
Date: 2012-12-05 14:40:03
Type: Comment
pls send me pdf file of this project..i am intrested in doing it..URGENTLY Required
Posted by: Bhavana Yalavarthi
Date: 2012-09-27 21:06:08
Type: Comment
i wants to work on this project but i m anable to download this can you please mail its pdf file(soft copy) of it to my email id yalavarthi111@gmail.com
Posted by: Surabhi Choudhary
Date: 2012-08-20 23:42:32
Type: Comment
i wants to work on this project but i m anable to download this can you please please mail its pdf file of it my email id is tanshuchoudhary@gmail.com
Posted by: Marc Paradis
Date: 2012-06-03 19:20:13
Type: Suggestion
That's nice, but why you didnt post the code, so we can learn to program? thanks!
Posted by: Uattend Attend
Date: 2011-07-22 15:22:30
Type: Comment
PIC micro controllers are mostly used in mostly projects.Pic microcontrollers are really amazing product in micro controllers.Another amazing product is uattend that will automatically mark your attendance and time. Time Clocksand attendance software are available at Uattend.
Posted by: Efkids Moderator
Date: 2011-04-01 07:48:47
Type: Comment
pot meter is used for changing the contrast of the display. you can try with reisters between 1 and 10 K and figure out which one best suits you
Posted by: Anonymous
Date: 2011-03-31 12:55:41
Type: Comment
wat there is no pot meter available is there any replacement?
Posted by: Efkids Moderator
Date: 2011-03-28 19:00:19
Type: Suggestion
We are not sure if JHD162A uses HD44780 driver as the chip is cosealed. But it is using an identical driver with almost same functioning. The code provided is tested on JHD162A, os it obviously works
Posted by: Anonymous
Date: 2011-03-28 11:21:03
Type: Comment
I would like to ask one thing you have been using JHD162A LCD but the C code which is available involves HD44780 LCD .So whether that same code will work with JHD162A lcd...
Posted by: Anonymous
Date: 2011-03-28 00:38:39
Type: Question
I am unable to download pic code...plz email me ...my email id is srbh.chadha@gmail.com
Posted by: Anonymous
Date: 2011-02-23 10:21:42
Type: Comment
nice please keep continue like this projects........
Posted by: Anonymous
Date: 2010-11-10 18:38:39
Type: Comment
excellant project to learn the working of PIC
Posted by: Anonymous
Date: 2010-10-17 01:36:36
Type: Comment
super project
Social Likes
Join EFKids Club


text image
* Enter the text above for captcha
Join EFKids Club to get notified when new projects are added.


Electronics For Kids Copyright 2010 - 17 .   EFKids
About EFKids