Led part-2

20
1 TECHVILLA www.techvilla.org.in

Transcript of Led part-2

Page 1: Led part-2

1

TECHVILLA

www.techvilla.org.in

Page 2: Led part-2

OUTPUT DEVICES INTERFACING Hardware information. Different compiler information. PRACTICAL1 : LED interfacing. PRACTICAL2: SSD interfacing. PROJECT: microcontroller based led pattern generation

www.techvilla.org.in

Page 3: Led part-2

HARDWARE INFORMATION

LEDs Seven segment displays.

www.techvilla.org.in

Page 4: Led part-2

LIGHT EMITTING DIODE

www.techvilla.org.in

Page 5: Led part-2

WHAT IS AN LED? An led is a pn junction opto-semiconductor that emits a monochromatic(single

color) light when operated in a forward biased junction. Instead of a filament they use a semiconductor diode which emits narrow-

spectrum light. Depending on the composition & condition of the semiconducting material used

(Silicone, germanium), they come in either Infrared for sensing heat, Visible for every day use, or Near-Ultraviolet for spotting stains at a crime-scene.

An LED consists of a chip of semiconducting material that has been “doped” with impurities in order to create a p-n junction.

A p-n junction is basically a junction between an anode and a cathode. Current flows easily from the p-side to the n-side, but never in the reverse order. The wavelength and color of the LED depends on the band-gap energy of the

materials forming the p-n junction

www.techvilla.org.in

Page 6: Led part-2

WORKING PRINCIPLE

www.techvilla.org.in

Page 7: Led part-2

LED CHARACTERISTICS

Page 8: Led part-2

LED CHARACTERISTICS Forward bias of approximately 1 volt is needed to give significant

forward current. The commercially used LED’s have a typical voltage drop between

1.5 Volt to 2.5 Volt or current between 10 to 50 milliamperes. Series resistance is determined by the following equation. Rseries = (Vsupply – V)/I

Vsupply – Supply Voltage

V – LED forward bias voltage

www.techvilla.org.in

Page 9: Led part-2

SEVEN SEGMENT DISPLAYS

www.techvilla.org.in

Page 10: Led part-2

WHAT IS A SEVEN SEGMENT DISPLAY? A Seven-Segment Display (SSD) is simply a figure eight

grouping of LEDs [some include a decimal point (DP)]. Each Segment is labeled (a) through (g). SSDs are available in two configurations

Common Cathode (all LED cathodes are connected) Common Anode (all LED anodes are connected)

www.techvilla.org.in

Page 11: Led part-2

TYPES OF SSD

www.techvilla.org.in

Page 12: Led part-2

SEVEN SEGMENT DISPLAY CODES

www.techvilla.org.in

Page 13: Led part-2

SEVEN SEGMENT DISPLAY CODES

www.techvilla.org.in

Page 14: Led part-2

LED INTERFACING WITH AVR Leds require around 50mA,so we usually require a

current-limiting resistor. The resistance of the resistor is calculated using the

well known formula V=IR.

www.techvilla.org.in

Page 15: Led part-2

ATMEGA16 INTERFACING WITH LEDS

www.techvilla.org.in

Page 16: Led part-2

C PROGRAMMING#include <avr/io.h>#include <util/delay.h>Int main(){ DDRX = 0xFF; // x – can be PORTA/B/C/D while(1) { PORTX = 0xff; } return 0;}

www.techvilla.org.in

Page 17: Led part-2

SSD INTERFACING WITH AVR

www.techvilla.org.in

Page 18: Led part-2

C PROGRAM#include <avr/io.h>#include <util/delay.h>Int main(){ DDRX = 0xFF ; // x can be A,B,C or D while(1) { PORTA = 0b00110000; // display number 1 _delay_ms(1000); // delay 1 sec

www.techvilla.org.in

Page 19: Led part-2

PORTA = 0b01011011; // display number 2_delay_ms(1000);PORTA = 0b01001111; // display number 3_delay_ms(1000); PORTA = 0b01100110; // display number 4_delay_ms(1000);

www.techvilla.org.in

Page 20: Led part-2

PORTA = 0b01110111; // Display letter A_delay_ms(1000);PORTA = 0b00111001; // display letter C_delay_ms(1000);PORTA = 0b01111001; // display letter E_delay_ms(1000);PORTA = 0b01110001; // display letter F_delay_ms(1000);

www.techvilla.org.in