Warning: mysql_query(): Unable to save result set in /home/efkids/public_html/cake/libs/model/datasources/dbo/dbo_mysql.php on line 411

Warning: Cannot modify header information - headers already sent by (output started at /home/efkids/public_html/cake/libs/model/datasources/dbo/dbo_mysql.php:411) in /home/efkids/public_html/app/controllers/projects_controller.php on line 163

Warning: Cannot modify header information - headers already sent by (output started at /home/efkids/public_html/cake/libs/model/datasources/dbo/dbo_mysql.php:411) in /home/efkids/public_html/app/controllers/projects_controller.php on line 164
EFKids - PIC Basic - Interfacing With an LCD Screen JHD162A
Post a Comment
Back to Projects
< PrevNext >
  Welcome Guest !
Learn Basics

PIC Basic - Interfacing With an LCD Screen JHD162A


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
 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:
Please login to post a comment or question
Click here to login or register
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 - 18 .   EFKids
About EFKids

Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0