Professional Documents
Culture Documents
Submitted by:
An LED or Light Emitting Diode, is a solid state optical p n-junction diode which emits
light energy in the form of photons.
The emission of these photons occurs when the diode junction is forward biased by
an external voltage allowing current to flow across its junction, and in Electronics we
call this process electroluminescence.
The actual color of the visible light emitted by an LED, ranging from blue to red to
orange, is decided by the spectral wavelength of the emitted light which itself is
dependent upon the mixture of the various impurities added to the semiconductor
materials used to produce it.
7-segment Display
Light emitting diodes have many advantages over traditional bulbs and lamps, with
the main ones being their small size, long life, various colors, cheapness and are
readily available, as well as being easy to interface with various other electronic
components and digital circuits.
But the main advantage of light emitting diodes is that because of their small die
size, several of them can be connected together within one small and compact
package producing what is generally called a 7-segment Display.
The 7-segment display, also written as “seven segment display”, consists of seven
LEDs (hence its name) arranged in a rectangular fashion as shown. Each of the
seven LEDs is called a segment because when illuminated the segment forms part
of a numerical digit (both Decimal and Hex) to be displayed. An additional 8th LED is
sometimes used within the same package thus allowing the indication of a decimal
point, (DP) when two or more 7-segment displays are connected together to display
numbers greater than ten.
The difference between the two displays, as their name suggests, is that the
common cathode has all the cathodes of the 7-segments connected directly
together and the common anode has all the anodes of the 7-segments connected
together and is illuminated as follows.
1. The Common Cathode (CC) – In the common cathode display, all the cathode
connections of the LED segments are joined together to logic “0” or ground. The
individual segments are illuminated by application of a “HIGH”, or logic “1” signal via
a current limiting resistor to forward bias the individual Anode terminals (a-g).
2. The Common Anode (CA) – In the common anode display, all the anode
connections of the LED segments are joined together to logic “1”. The individual
segments are illuminated by applying a ground, logic “0” or “LOW” signal via a
suitable current limiting resistor to the Cathode of the particular segment (a-g).
Then for a 7-segment display, we can produce a truth table giving the individual
segments that need to be illuminated in order to produce the required decimal digit
from 0 through 9 as shown below.
In this example, the segments of a common anode display are illuminated using the
switches. If switch a is closed, current will flow through the “a” segment of the LED to
the current limiting resistor connected to pin a and to 0 volts, making the circuit. Then
only segment a will be illuminated. So a LOW condition (switch to ground) is required
to activate the LED segments on this common anode display.
But suppose we want the decimal number “4” to illuminate on the display. Then
switches b, c, f and g would be closed to light the corresponding LED segments.
Likewise for a decimal number “7”, switches a, b, c would be closed. But illuminating
7-segment displays using individual switches is not very practical.
7-segment Displays are usually driven by a special type of integrated circuit (IC)
commonly known as a 7-segment decoder/driver, such as the CMOS 4511. This 7-
segment display driver which is known as a Binary Coded Decimal or BCD to 7-
segment display decoder and driver, is able to illuminate both common anode or
common cathode displays. But there are many other single and dual display drivers
available such as the very popular TTL 7447.
This BCD-to-7 segment decoder/driver takes a four-bit BCD input labelled A, B,
C and Dfor the digits of the binary weighting of 1, 2, 4 and 8 respectively, has seven
outputs that will pass current through the appropriate segments to display the
decimal digit of the numeric LED display.
The digital outputs of the CD4511 are different from the usual CMOS outputs
because they can provide up to 25mA of current each to drive the LED segments
directly allowing different coloured LED displays to be used and driven.
In this simple circuit, each LED segment of the common cathode display has its own
anode terminal connected directly to the 4511 driver with its cathodes connected to
ground. The current from each output passes through a 1kΩ resistor that limits it to a
safe amount. The binary input to the 4511 is via the four switches. Then we can see
that using a BCD to 7-segment display driver such as the CMOS 4511, we can
control the LED display using just four switches (instead of the previous 8) or a 4-bit
binary signal allowing up to 16 different combinations.
Most digital equipment use 7-segment Displays for converting digital signals into a
form that can be displayed and understood by the user. This information is often
numerical data in the form of numbers, characters and symbols. Common anode and
common cathode seven-segment displays produce the required number by
illuminating the individual segments in various combinations.
LED based 7-segment displays are very popular amongst Electronics hobbyists as
they are easy to use and easy to understand. In most practical applications, 7-
segment displays are driven by a suitable decoder/driver IC such as the CMOS 4511
or TTL 7447 from a 4-bit BCD input. Today, LED based 7-segment displays have
been largely replaced by liquid crystal displays (LCDs) which consume less current.
LED dot matrices are very popular means of displaying information as it allows both
static and animated text and images. Perhaps, you have encountered them at gas
stations displaying the gas prices, or in the public places and alongside highways,
displaying advertisements on large dot matrix panels. In this experiment, we will discuss
about the basic structure of a monochrome (single color) LED dot matrix and its
interface with a microcontroller to display static characters and symbols.
The LED matrix used in this experiment is of size 5×7. We will learn how to display still
characters in a standard 5×7 pixel format. The figure below shows which LEDs are to be
turned on to display the English alphabet ‘A’. The 7 rows and 5 columns are controlled
through the microcontroller pins. Now, lets see in detail how it works.
Suppose, we want to display the alphabet A. We will first select the column C1 (which
means C1 is pulled low in this case), and deselect other columns by blocking their ground
paths (one way of doing that is by pulling C2 through C5 pins to logic high). Now, the first
column is active, and you need to turn on the LEDs in the rows R2 through R7 of this
column, which can be done by applying forward bias voltages to these rows. Next, select the
column C2 (and deselect all other columns), and apply forward bias to R1 and R5, and so
on. Therefore, by scanning across the column quickly (> 100 times per second), and turning
on the respective LEDs in each row of that column, the persistence of vision comes in to
play, and we perceive the display image as still.
A standard 5x7 LED dot matrix display structure
The table below gives the logic levels to be applied to R1 through R7 for each of the
columns in order to display the alphabet ‘A’.
Scanning across the columns and feeding with appropriate row values
You should have noted that across each row, one pin is sourcing the current for only
one LED at a time, but a column pin may have to sink the currents from more than one
LED. For example, the column C1 should be able to sink the currents from 6 LEDs while
displaying the alphabet ‘A’. A microcontroller’s I/O pin cannot sink this much of current,
so external transistor arrays are required. I am using ULN2003A IC which has seven
built-in Darlington transistor arrays (see below). The inputs of ULN2003A are active
high. This means the input pins must be supplied with logic high in order to bring the
corresponding output pins to ground. The schematic of the Darlington transistor array
inside the ULN2003A chip is shown below.
Circuit Setup
The circuit setup for this experiment is quite simple. You need seven 330 ? resistors in
series with rows R1 through R7 to limit the current through the LEDs. Then the rows are
driven by RB0 through RB6 pins of PIC18F2550. The columns are connected to the five
outputs of ULN2003A. The corresponding five input pins of ULN2003A IC are controlled
by RA0 through RA4 pins of PIC18F2550. The microcontroller will, therefore, scan across
the column by sending appropriate bits to PORTA. For example, setting RA0 to 1 and
clearing RA1 through RA4 bits, will select the first column. The microcontroller will wait
for about 1 ms before switching to the next column. At each column, the microcontroller
will output the corresponding row value at PORTB to turn on the appropriate LEDs in the
column that are required to display the specific character. The switching between
columns is fast enough to deceive the human eyes and a steady character is displayed.
.
Circuit diagram for interfacing a 5x7 LED dot matrix with PIC18F2550
Circuit setup showing a StartUSB board with a 6x7 LED dot matrix (the sixth column is discarded here)
Software
The major part of this experiment is the software routine to scan the columns and feed the rows with
appropriate values. The column-specific row values for display characters can be either defined in
RAM or stored in the program memory in case the on-board RAM is not sufficient enough. In micro C,
the variables are saved in RAM and constants are stored in program memory. So, if your PIC does not
have enough RAM, you can define a constant array to store the row values so that a part of the
program memory is occupied by it to free up the on-board RAM. PIC18F2550 has quite a bit of RAM
(2 KB), so I have used RAM to store the row values for alphabets A through Z. Here’s how I define it
in micro C,
I have written a simple program in micro C to display the alphabets A through Z sequentially, and
some special characters too. You can watch the video below to see how they look like on the dot
matrix display’
General characteristics
Each pixel of an LCD typically consists of a layer of molecules aligned between
two transparent electrodes, and two polarizing filters (parallel and perpendicular), the axes of
transmission of which are (in most of the cases) perpendicular to each other. Without the liquid
crystal between the polarizing filters, light passing through the first filter would be blocked by the
second (crossed) polarizer. Before an electric field is applied, the orientation of the liquid-crystal
molecules is determined by the alignment at the surfaces of electrodes. In a twisted nematic (TN)
each pixel, light can be allowed to pass through in varying amounts thus constituting different
levels of gray. Color LCD systems use the same technique, with color filters used to generate
red, green, and blue pixels.[3]
LCD in a Texas Instruments calculator with top polarizer removed from device and placed on top, such that
the top and bottom polarizers are perpendicular. Note that colors are inverted.
The optical effect of a TN device in the voltage-on state is far less dependent on variations in the
device thickness than that in the voltage-off state. Because of this, TN displays with low information
content and no backlighting are usually operated between crossed polarizers such used. For this
purpose, TN LCDs are operated between parallel polarizers, whereas IPS LCDs feature crossed
polarizers. In many applications IPS LCDs have replaced TN LCDs, in particular in smartphones such
as iPhones. Both the liquid crystal material and the alignment layer material contain ionic compounds.
If an electric field of one particular polarity is applied for a long period of time, this ionic material is
attracted to the surfaces and degrades the device performance. This is avoided either by applying
an alternating current or by reversing the polarity of the electric field as the device is addressed (the
response of the liquid crystal layer is identical, regardless of the polarity of the applied field).
Displays for a small number of individual digits or fixed symbols (as in digital watches and pocket
calculators) can be implemented with independent electrodes for each segment.[4] In contrast,
full alphanumeric or variable graphics displays are usually implemented with pixels arranged as a
matrix consisting of electrically connected rows on one side of the LC layer and columns on the
other side, which makes it possible to address each pixel at the intersections. The general
method of matrix addressing consists of sequentially addressing one side of the matrix, for
example by selecting the rows one-by-one and applying the picture information on the other side
at the columns row-by-row. For details on the various matrix addressing schemes see passive-
matrix and active-matrix addressed LCDs.