Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] led glow when output zero..

Status
Not open for further replies.

lockman_akim

Advanced Member level 1
Joined
Jul 12, 2010
Messages
466
Helped
76
Reputation
152
Reaction score
68
Trophy points
1,308
Location
Malaysia
Activity points
3,523
i was never know about this since i know µC..i mean we can use output pin as ground..hahaha..it really ashame rite..but can it work for real circuit? my LED can go blow or not when output is 1?
 

Attachments

  • glow zero.jpg
    glow zero.jpg
    58.1 KB · Views: 168

Of course it works, it's a standard way to do it. Just be sure that the micro can drive enough current. It will of course not work in a 3V system as you are using a blue LED. Actually today with many very low power circuits and low impedance MCU i/O you can use I/O to power all kinds of stuff. If you want to drive or sink current to the MCU, that depend.
 
The connection you are showing works fine in real world, this is called sinking current (you can either sink or source current) so the led lights when the pin has a value of 0 and turns off when the pin is on (5v).

Alex
 
i think sourcing is not a better option sinking would be better.when micro controller output is high its voltage level is 5v and when it is low output is gnd if you connect 5v to led with a suitable resister (330 ohms) then cathode is connected to micro controller .
when microcontroller out put is high voltage is equals to led voltage no glow
when microcontroller out put is low voltage is difference so current is sinked in micro out put this is good for professional desing
 
i quite confuse now..
sinking mean LED "on" when ouput = 0? or vice versa?
 

sinking is when you have 0 at your pin (led in on) , you sink (pull) current from the led which is connected to a positive supply and you let the current flow.
If you have a led connected to the gnd then you have to source (give current ) to the led to make it light

Alex
 
between sinking and sourcing, which is more good?
 

Attachments

  • btween this two.jpg
    btween this two.jpg
    65.7 KB · Views: 174

you have to read the datasheet of your micro controller, i think avr can source or sing the same current but there are other micro controllers that can sink more current.
Also CPLD can sink more current (than it can source)

Alex
 

Hi,
The method is fine. Here you'd need to sink current ie pull the output to gnd instead of sourcing current ie pulling current from +v to load. Here you have the LED anode connected to the +v and the cathode connected to the PIC pin. When the PIC outputs 0, it sinks current, ie, pulls current from +v to gnd via LED, turning it on. Since you're using LED and 330R resistance, there's no question of PIC not being able to supply current as it can do so upto 15-20mA in the IO line.

Hope this helps.
Tahmid.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top