Think beyond.... Make it true...

  • Software Project

    JAVA projects, Dot net projects, web development projects & Andriod projects, android application developing projects

    Read More
  • Electrical Project

    Power electronics projects, drives projects, control system projects, convertors, invertors & power electronics simulation and hardware projects

    Read More
  • Embedded Project

    8051, PIC, ARM, ARM CORTEX, MSP430, & ATMEGA microcontroller projects and RTOS (Real time operating system) projects, embedded linux projects and sensor interfacing projects

    Read More
Showing posts with label IO interfacing. Show all posts
Showing posts with label IO interfacing. Show all posts

Monday, August 26, 2013

LIGHT EMITTING DIODE Interfacing tutorial



        Light Emitting Diodes (LED) is the most commonly used electronic components, generally for display digital states. Typical uses of LED's include alarm devices, timers and confirmation of user input such as a mouse click or keystroke, events etc. LED's are very cheap and easily available in a variety of shape, size and colors.

        89C51, which belongs to the family of 8051 series of micro-controllers  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 micro-controller for both beginners and advanced user.
To connect a led refer the methods of connection here

        You can use 10-15 mA as a safe LED current which will provide decent light intensity and conserve battery power. Determine the Series resistor using Ohms law with an excess voltage value and current value for LED. Red LED's generally need 1.5V to 1.9V to light any extra voltage must be dropped with a series resistor else the LED will draw extra current in an attempt to lower the supply voltage down to the 1.5V level. The typical supply voltage source for micro-controller is 5V.

Then, 5 - 1.7 = 3.3V of excess voltage.
Let’s design the LED to use 10mA
Ohms law Resistance R = V / I
3.3 / 10mA = 330 Ohms, Place a 330 ohm resistor in series with the LED.

Circuit Diagram

Interfacing Switch and LED with 8051

Interfacing Switch and LED with 8051

            This article is meant for beginners in the field of micro-controllers  When I started with micro-controllers as everyone I also need to learn how to interface a switch with micro-controller.


A switch is an electrical component that can break an electrical circuit, interrupting the current or diverting it from one conductor to another. A switch may be directly manipulated by a human as a control signal to a system, or to control power flow in a circuit.




A switch requires a pull-up or pull-down resistor to produce a definite high or low voltage when it is open or closed. A resistor placed between a digital input and the supply voltage is called a "pull-up" resistor because it normally pulls the pin's voltage up to the supply. 



Software Tools:

1.      RIDE Compiler (Evaluation version) 
2.      WINISP Down loader      (Free version ) 

Hardware:

1. P89C51
2. Push button switch
3. micro-controller board

Program:

#include<reg51.h>
sbit LED=P0^7; //port declaration
sbit SW1=P0^0;
sbit SW2=P0^1;
void main()
{
while(1)
{
if(SW1==0 || SW2==0) //if the SW1 or SW2 is pressed
{
LED=1;
}
else
LED=0;
}
}


Mob    :       +91-9790766717
                   +91-9500087478
Web    :       www.masterychip.com
Mail     :       projects@masterychip.com




Followers

Disclaimer

The documents, software, tools and links are provided to enhance the ability of an electronics student, hobbyist or professional by sharing information. The information, links etc. should be used by the website visitor, at his or her own risk and responsibility. There may be concept, design and link errors in the pages.

My Creative Work, ideas and documents can be used for Product Design and Development by R&D Engineers, Hobbyists, Students and even firms for creating useful products. These cannot be used for reprint, replication or publishing online or offline.

Translate