12 Apr 2017

Interfacing LED to 8051 Microcontroller

  • What is LED?- LED is abbreviation of Light Emitting Diode. It’s nothing, but just a combination of semiconductors which emits light when current pass through it . Over the years, semiconductor technology has advanced to bigger heights, Light Emitting Devices have also been a part of this revolution and as a result, Now we have LED’s which give better illumination with low power consumption.
types of LEDS 0
  •  Types of LED– There are many types of LEDs available in the market.. As you can see on above pic there is different LEDs according to our requirement and there has been many other are too available depending upon different parameters . And LEDs are choose according to parameters like space required by it, size, intensity, colors, etc. Typical LEDs are in size of 3mm, 5mm and 8mm. Nowadays HPLEDs(high power LEDs) are running in market which emits higher luminous intensity. High power LED’s has very high heat dissipation so LED’s need to mounted along with a cooling system known as heat sink.
LED-labelledLED_Symb
  • Operating parameters & circuit symbol – Above figures show basic elements inside the LED and circuit symbol which helps in interfacing LED with 8051. Typical current ratings ranges from around 1 mA to above 20 mA and voltage is at about colors.
  • 1.9 to 2.1 V for red, orange and yellow,
  • 3.0 to 3.4 V for green and blue,
  • 2.9 to 4.2 V for violet, pink, purple and white.
  • 5 V and 12 V LEDs are incorporate a suitable series resistor for direct connection to a 5 V or 12 V supply.
Red_and_green_traffic_signals,_Stamford_Road,_Singapore_-_20111210
  • Applications-       LED is everywhere because it’s an indicating component used in many areas. Just look around, if u can’t find even single LED, you are not on earth. Typical and most even application of LEDs are shown in above photo.
  •  

    https://youtu.be/KTEDawIIk5s (for video lecture)

     

    Program of  led interfacing with 8051

     

    #include<reg51.h>  // this is the header file used                programming of AT89C51
    void delay(int x,int y); // delay function
    sbit a=P2^0;  // access pin P2.0 as a name a
    sbit b=P2^1;  // access pin P2.1 as a name b
    sbit c=P2^2;  // access pin P2.2 as a name c
    sbit d=P2^3;  // access pin P2.3 as a name d
    sbit e=P2^4;  // access pin P2.4 as a name e
    sbit f=P2^5;  // access pin P2.5 as a name f
    sbit g=P2^6;  // access pin P2.6 as a name g
    sbit h=P2^7;  // access pin P2.7 as a name h
    void main()
        {
            while(1)             //super loop (infinite loop)
              {
                    a=b=c=d=e=f=g=h=1;  // leds on
                    delay(100,100);     // halt for some time
                    a=b=c=d=e=f=g=h=0;  // leds off
                    delay(100,100);     // halt for some time
               }
       }
    void delay(int x,int y)       // delay function
       {
            int i,j;
            for(i=0;i<x;i++)
              for(j=0;j<y;j++);
       }
     The way you implementing and what are the ports using for connecting to 8051.

No comments:

Post a Comment

commnet here