The circuit uses an AT89C51 microcontroller to control LEDs connected to its ports. The AT89C51 is an 8-bit microcontroller with 4KB of flash memory and 128 bytes of RAM. LEDs are connected to port P0 and turned on/off by the microcontroller setting the port pin high or low. Resistors are used to limit current flowing to the LEDs from the microcontroller's 5V output. Seven segment displays can also be interfaced by connecting segments to a port and driving each digit's pattern to display numbers.
1 of 20
Downloaded 351 times
More Related Content
Ppt on interfacing led and 7 segment with 8951
2. The circuit mainly consists of
AT89C51 microcontroller. AT89C51
belongs to the family of 8051
microcontroller. It is an 8-bit
microcontroller. This
microcontroller has 4KB of Flash
Programmable and Erasable Read
Only Memory and 128 bytes of RAM.
This can be programmed and erased
maximum 1000times. It has two 16
bit timers/counters. It supports
USART communication protocol. It
has 40 pins. There are four ports are
designated as P0, P1, P2, P3, P4.
3. Light Emitting Diodes are the semi
conductor light sources. Commonly used
LEDs will have a cut-off voltage of 1.7V
and current of 10mA. When an LED is
applied with its required voltage and
current it glows with full intensity. The
Light Emitting Diode is similar to the
normal PN diode but it emits energy in the
form of light.
4. The Anode is connected through a resistor to
GND & the Cathode is connected to the
Microcontroller pin. So when the Port Pin is
HIGH the LED is OFF & when the Port Pin is
LOW the LED is turned ON.
5. In this circuit, LEDs are connected to
the port P0. Port P0 will not have
internal pull- ups, while the other ports
have internal pull-ups. The controller is
connected with external crystal
oscillator to pin 18 and 19 pins. Crystal
pins are connected to the ground
through capacitors of 33pf.using an LED
you must use a resistor to limit the
current flow. If you just connect an LED
directly to a pin of the micro controller
you run the risk of damaging the micro
controller by allowing too much current
flow into or out of the pin.
6. Light Emitting Diodes are the semi
conductor light sources. Commonly used
LEDs will have a cut-off voltage of 1.7V and
current of 10mA. When an LED is applied
with its required voltage and current it
glows with full intensity. The Light Emitting
Diode is similar to the normal PN diode but
it emits energy in the form of light. The
colour of light depends on the band gap of
the semiconductor. The following figure
shows how an LED glows?
7. Thus, LED is directly connected to the AT89C51
microcontroller. The negative terminal of the LED is
connected to the ground through a resistor. Value of
this resistor is calculated using the following formula.
, where V is the input voltage.
R= (V-1.7)/10mA
Generally, microcontrollers output a maximum voltage
of 5V. Thus the value of resistor calculated for this is
330 Ohms. Thus this can be connected either to the
cathode or anode of the LED.
8. LED Interfacing with 8051 Circuit Applications:
LEDs are widely used in many applications like in
seven segments.
They are used in dot matrix displays.
They can be used for street lights.
They are used as indicators.
They can be used in traffic lights.
They are used in emergency lights
They can used to make electronic designs.
12. Seven segment displays are used to indicate
numerical information. Seven segments display
can display digits from 0 to 9 and even we can
display few characters like A, b, C, H, E, e, F, etc.
These are very popular and have many more
applications. Before going to start this concept, get
an idea about how to interface LEDs with 8051
Microcontroller.
13. Interfacing 7 Segment Display to 8051 Circuit
Principle:
Seven segment displays internally consist of 8
LEDs. In these LEDs, 7 LEDs are used to indicate
the digits 0 to 9 and single LED is used for
indicating decimal point. Generally seven
segments are two types, one is common
cathode and the other is common anode.
In common cathode, all the cathodes of LEDs are
tied together and labeled as com. and the anode
are left alone. In common anode, seven segment
display all the anodes are tied together and
cathodes are left freely. Below figure shows the
internal connections of seven segment Display.
16. Interfacing 7 Segment Display to 8051 Circuit
Design:
Here, common cathode seven segment is used to
display the digits. In this circuit, pins a to h of the 7
segment are connected to the PORT 2 of the
microcontroller and com pin is connected to the
ground through the 330 ohm resistor. This resistor is
used to drop the voltage. Since we are using
common cathode seven segment we need to send
LOGIC 1 to the segments to glow.
Figure shows structure of common cathode seven
segments. Here dot is used for indicating the decimal
point. Here all the cathodes of LEDs are connected to
the Gnd pin. The operating voltage of this LEDs is 2
to 3V but from controller we will get 5V so to drop
the remaining voltage we have to connect a to g pins
to the controller through the resistor.
18. Digit Drive Pattern:
To display the digits on 7 segment, we need to glow different
logic combinations of segments. For example if you want to
display the digit 3 on seven segment then you need to glow the
segments a, b, c, d and g. The below table show you the Hex
decimal values what we need to send from PORT2 to Display the
digits from 0 to 9.
Digit Dp g f e d c b a
Hex
value
0 0 0 1 1 1 1 1 1 0x3f
1 0 0 0 0 0 1 1 0 0x06
2 0 1 0 1 1 0 1 1 0x5b
3 0 1 0 0 1 1 1 1 0x4f
4 0 1 1 0 0 1 1 0 0x66
5 0 1 1 0 1 1 0 1 0x6d
6 0 1 1 1 1 1 0 1 0x7d
7 0 0 0 0 0 1 1 1 0x07
8 0 1 1 1 1 1 1 1 0x7f
9 0 1 1 0 0 1 1 1 0x67
19. Interfacing 7 Segment Display to 8051
Circuit Applications:
Seven segments are widely used in digital clocks to
display the time.
These are used in electronic meters for displaying
the numerical information.
Used in Instrument panels
Used in digital readout displays.