Вы находитесь на странице: 1из 3

LED INTERFACING WITH 8051(C)

Synopsis:
This tutorial/project is LED interfaced with microcontroller (C) AT89S52. The
blinking (ON/OFF) of LED should be controlled with predefined time delay by
microcontroller. AT89S52, which belongs to the family of 8051 series of
microcontrollers, is very commonly used by a large community of hobbyist and
engineers. Its simplicity and ease of programming with inbuilt features easily
makes its position in the top preferred list of microcontroller for both beginners
and advanced user. LED is a particular type of diode which converts electrical
energy into light. LED stands for Light Emitting Diode. They are very cheap and
easily available in a variety of shape, size and colors. They find multiple
applications as indicators during experimentations to check the validity of results at
different stages.

Annotation:
The principle of operation of LEDs is simple. The commonly available LEDs have
a drop voltage of 1.7 V and need 10 mA to glow at full intensity. The following
circuit describes how to glow a LED. The AT89S52 microcontroller can sink
(absorb) or source (give out) a small amount of current. A series resistor is
also required to limit the current. LEDs anode directly connected to GPIO pins of
microcontroller and cathode is connected to ground which is sink mode. In this
mode controller supply current. When controller pin high (1) LED will glow and
pin will low (0) LED does not glow. However the output of the controller is not
sufficient enough to drive the LEDs, so the LED will not glow at full illumination.
In source mode operation is vice versa which means supply provided to the
controller. The fig 1 shows the pins of LED. The fig 2 shows the mode of LED
connection with controller.

Resister value calculation:


The value of resistance R can be calculated using the equation,
R=(V-Vd)/Id

Where V input voltage,


Vd LED voltage
Id LED current

R= (V-1.7)/10 mA

Since most of the controllers work on 5V, so substituting V= 5V, the value of
resistance comes out to be 330 ohm. The resistance 220 ohm, 470 ohm is
commonly used substitute in case 330 ohm is not available.

Fig 1: LEDs Pin diagram


Fig 2: LED Connection mode with Controller

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

Вам также может понравиться