You are on page 1of 35

Displays and Keypads

Interfacing and programming


• 7-Segments Displays
• Dot-matrix Displays
• Alphanumeric Displays
• LCD Displays
• Keypads
Interfacing to 7-Segment Numeric Displays

Input: 0V =OFF, or 5V = ON = 5V

0 (GRND) Input: 0V= ON, or 5V = OFF


https://www.sparkfun.com/datasheets/IC/74HC4511.pdf
Interfacing to 7-Segment Numeric Displays
With built-in BCD to 7-Segment Decoders

http://thelearningpit.com/lp/doc/7seg/7seg.html
Theory of LED dot matrix display
http://embedded-lab.com/blog/?p=2478
 In a dot matrix display, multiple LEDs are wired together in rows and columns.
 This is done to minimize the number of pins required to drive them.
 For example, a 7×5 matrix of LEDs (shown below) would need 35 I/O pins, one for each LED pixel.
 By wiring all the anodes together in rows (R1 through R7), and cathodes in columns (C1 through C5), the
required number of I/O pins is reduced to 12.
 Each LED is addressed by its row and column number. In the figure below, if R4 is pulled high and C3 is
pulled low, the LED in fourth row and third column will be turned on.
 Characters can be displayed by fast scanning of either rows or columns.
Interfacing Display to the Raspberry Pi:
 Raspberry Pi GPIO current output
3mAmp
 Display may requires up to
200-300mAmp.
 ULN2003A
Current Driver from
3mAmp to 500mAmp. Raspberry
GPIO

GPIO
PIN Display
Scanning across the columns and
feeding with appropriate row values
For example: to Display ‘ A ‘ , see the
figures below.
5x7 Dot Matrix (LTP 747R)
Four Segments 5 x 7 Alphanumeric Displays

http://pdf1.alldatasheet.com/datasheet-pdf/view/64648/HP/HDLX-2416.html
Least Significant Digit
Most Significant Digit
LAB Exercises

Q) Connect the 5x7 Dot Matrix display as shown the below


circuit to obtain the following patterns.
Pattern.1 Pattern.2
Q) Connect the Alpha Numeric display to obtain the letter ‘e’ on D2.

Q) Connect the Alpha Numeric display to obtain the following arrow


and move it from the left most display to the right most one.
Basic 16x2 Character LCD - RGB Backlight (LCD-10862)
 Power supply
 The three control lines are referred to as Enable (EN), Register Select (RS), and Read/Write
Control (RW).
 Data Lines: 4 or 8- D0-D7
 Color Lines: 4 lines: RGB LEDs Cathode, Red LED Anode, Green LED Anode and Blue LED Anode

Control
Lines

Data
Lines

Color
Lines

LCD-10862
Display the following text message "Welcome" on the first
line of Explorer 16 LCD and "COE 410" on the second line
import LCD
import Rpi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
# LCD Initialize Function
LCD.init()
while True:
LCD.prints("Welcome ",LCD.Line1)
time.sleep(1) # 1 second delay
LCD.clear_disp()
LCD.prints("COE 410 ",LCD.Line2)
time.sleep(1) # 1 second delay
LCD.clear_disp()
Interfacing Keypads
Keypad Interface
Keypad layout and Connection
Step 1. Understating the connection:
The figure below shows the layout of a 4x4 keypad and
the connection to Raspberry Pi GPIO in BCM Mode:
Step 2:
LAB Exercises

You might also like