Discussion in "General help Guidance and Discussion" started by    ASLANPETER    Sep 7, 2010.
Tue Sep 07 2010, 01:35 am
#1
Hi Guys,
forgive me, it is surely a silly question but i am stuck. i need to control a led with an output pin of an 8051 micrcontroller. basically the micrcontroller is running a code and when a condition is verified ,an output pin is cleared. this ouput is linked to the anode of a led which should be wired to the VCC via a resisitor. the resistor and LED should be placed on a dedicated bread board which hence should be connected to 5v voltage. what should I do with the GND section on the broadboard?? should i leave it unconnected? will the VCC wire make any sense on its own without GND? or should i rather not to power up the breadboard and connect a resistor leg to the VCC output of the power supply? which is the correct way and why?
thank you


[ Edited Tue Sep 07 2010, 06:23 am ]
Tue Sep 07 2010, 07:43 am
#2
the 'gnd' to the LED's cathode is provided by the 8051's port pin,hence you needn't provide gnd on the breadboard...simply Vcc to the anode through the resistor and a port pin connection to the cathode.
But this is assuming you are using the same supply for both the mico and the LED bb.If not you'll have to connect the gnd terminals of both the supplies at some point.
Tue Sep 07 2010, 07:48 pm
#3
There are two ways you can connect LEDs to controller port.

1. Active High Logic
2. Active Low Logic.

1. Active high logic means LED will be on when port pin is 1 and LED will be off when pin is 0. In this type of arrangement, LED is driver from port pin of controller if port pin does not have enough current then a pullup is used on.

      VCC
       |
       \
       / Resistor
       \
       /
       |   LED
Port -----|>
|---GND
Pin


2. Active low is other way around, when port pin is 0, LED is on and when port pin is 1 LED is off. In this type of arrangement port pin is used as current sinking device, when LED is on current will sink from VCC through resistor and LED then into microcontroller pin. typical connections are like this.

         LED       R
Port -----|<|----/\/\/\---VCC
Pin

Tags interfacing LED to controlleractive low led circuitactive high led circuitled interfacing with microcontroller

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am