0% found this document useful (0 votes)
29 views10 pages

Flashing of LED: Name: Akshat Saxena Roll No: 181CS113

The document describes a project to produce a flashing LED using an 8051 microcontroller. It uses an AT89S51 microcontroller to generate the blinking effect. The methodology section explains how the microcontroller is used to blink one LED by toggling a pin high and low. The program and expected output are provided. Next, it describes how two LEDs can be made to blink alternately using two pins and a similar program. The conclusion confirms the experiment was successful in producing the blinking LED outputs.

Uploaded by

ASHOK KUMAR M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views10 pages

Flashing of LED: Name: Akshat Saxena Roll No: 181CS113

The document describes a project to produce a flashing LED using an 8051 microcontroller. It uses an AT89S51 microcontroller to generate the blinking effect. The methodology section explains how the microcontroller is used to blink one LED by toggling a pin high and low. The program and expected output are provided. Next, it describes how two LEDs can be made to blink alternately using two pins and a similar program. The conclusion confirms the experiment was successful in producing the blinking LED outputs.

Uploaded by

ASHOK KUMAR M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Flashing of LED

Name: Akshat Saxena


Roll No: 181CS113
Objective of the task

The project is designed as a LED flasher, which produces a flashing effect when LEDs are
arranged properly.

The objective of the task is to use 8051 processor to produce the blinking effect.

The microcontroller used here is AT89S51.


Methodology (Blinking 1 LED)
The microcontroller used here is AT89S51 In the
circuit, push button switch S1, capacitor C3 and
resistor R3 forms the reset circuitry. When S1 is
pressed, voltage at the reset pin (pin9) goes high and
this resets the chip. C1, C2 and X1 are related to the
on chip oscillator which produces the required clock
frequency. P1.0 (pin1) is selected as the output pin.
When P1.o goes high the transistor Q1 is forward
biased and LED goes ON. When P1.0 goes low the
transistor goes to cut off and the LED extinguishes.
The transistor driver circuit for the LED can be
avoided and the LED can be connected directly to
the P1.0 pin with a series current limiting
resistor(~1K). The time for which P1.o goes high
and low (time period of the LED) is determined by
the program. The circuit diagram for blinking 1 LED
is shown below.
Program

START: CPL P1.0


ACALL WAIT
SJMP START

WAIT: MOV R4,#05H


WAIT1: MOV R3,#00H
WAIT2: MOV R2,#00H
WAIT3: DJNZ R2,WAIT3
DJNZ R3,WAIT2
DJNZ R4,WAIT1
RET
Expected output
A single LED will blink,as
shown in the Image below.
Methodology (Blinking 2 LEDs alternatively)

This circuit can blink two LEDs alternatively.


P1.0 and P1.1 are assigned as the outputs.
When P1.0 goes high P1.0 goes low and vice
versa and the LEDs follow the state of the
corresponding port to which it is connected.
Here there is no driver stage for the LEDs and
they are connected directly to the
corresponding ports through series current
limiting resistors (R1 & R2). Circuit diagram is
shown below.
Program
START: CPL P1.0
ACALL WAIT
CPL P1.0
CPL P1.1
ACALL WAIT
CPL P1.1
SJMP START

WAIT: MOV R4,#05H


WAIT1: MOV R3,#00H
WAIT2: MOV R2,#00H
WAIT3: DJNZ R2,WAIT3
DJNZ R3,WAIT2
DJNZ R4,WAIT1
RET
Expected outcome

2 LEDs will blink as shown in the image


below.
Conclusion

Therefore the above experiment was carried out successfully and the output was tested.
Reference

http://www.circuitstoday.com/blinking-led-using-8051

https://electrosome.com/led-blinking-8051-microcontroller-keil-c-tutorial-at89c51/

You might also like