Is 0 equivalent to Ground?

Hi

Electronics newbie here. A few queries regarding Atmega8.

  1. Does a 0 on the Digital Output pin of Atmega8 equivalent to Ground?

If I connect a LED + Resistor betwen D-Out pins 1 & 2, with Pin 1 outputting '1'
& pin 2 outputting '0', will it light the LED?

If so, is it safe to do so instead of using Ground?
(I read something about considering the sink current & such!)

  1. Will the following work?

My aim to control the gradual dimming & brightening of individual LED's.

Thank you.

Andy_Cool:

  1. Does a 0 on the Digital Output pin of Atmega8 equivalent to Ground?

Yes, with the proviso that the pin has some output resistance and a current rating of 40mA.

Andy_Cool:
If I connect a LED + Resistor betwen D-Out pins 1 & 2, with Pin 1 outputting '1'
& pin 2 outputting '0', will it light the LED?

Yes, provided the LED is connected the right way round.

Andy_Cool:
If so, is it safe to do so instead of using Ground?
(I read something about considering the sink current & such!)

Yes. That is essentially how multiplexed LED displays are driven.

Andy_Cool:
2. Will the following work?

My aim to control the gradual dimming & brightening of individual LED's.

Yes. Just be sure that you respect the 40mA absolute maximum current per pin limitation (for both the low outputs and the high outputs), and the current limitations per port and per device (e.g. 200mA Vcc or ground current for an atmega328p).

Thanks for replying, dc42.

The max current sink capacity for the Digital Pin of Atmega8 is 40 mA?
What is the source capacity?

Considering the above image, will it work without any problem?
How many Ohms resistor should I use on each pin?

Lastly, I would be grateful if you can tell me how to use NPN tansistors (BC548)
as switches in the above diagram? (including the resistor values)

Thanks.

Andy_Cool:
The max current sink capacity for the Digital Pin of Atmega8 is 40 mA?
What is the source capacity?

Also 40mA.

Andy_Cool:
Considering the above image, will it work without any problem?
How many Ohms resistor should I use on each pin?

That depends a little on your LEDs. Look up the forward voltage of the LED from its datasheet, also the maximum forward current. The decide on the forward current you want to use per LED. The absolute maximum is 20mA each because you are driving 2 of them from a single pin. Subtract the forward voltage from 5V, divide by the required forward current (Ohm's law), and that gives you the resistance.

Andy_Cool:
Lastly, I would be grateful if you can tell me how to use NPN tansistors (BC548)
as switches in the above diagram? (including the resistor values)

See <b>Electronics Components: Use a Transistor as a Switch</b> - dummies. If you want to switch the positive supplied to the LEDs, you need PNP transistors. The BC548 is only suited to switching low currents. BC337 is better for switching medium currents.

Thank you very much. I will let this info sink & post back here
when I bump into an obstacle.
Thanks again.