Sinking digital pins

I am trying to use the attiny84A to drive Leds and I want the Leds connected to an external power supply different then the one driving the attiny84. I assumed that the LOW output in the digitalWrite command would do the job. Is it necessary to set the pin to INPUT and use the read command? Just using the digitalWrite LOW command doesn't work.

Hi,
What voltage is the LED supply?
Your suggested method of driving will only work if the LED supply is 5V.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

And as @Delta_G pointed out the gnd of the Attiny and the LED power supply will have to be connected.

Tom... :slight_smile:

bobdeutsch:
I am trying to use the attiny84A to drive Leds and I want the Leds connected to an external power supply different then the one driving the attiny84.

Why? Even if it is a 5V supply as required, the attiny will still have to pass the current.

aarg:
Why? Even if it is a 5V supply as required, the attiny will still have to pass the current.

I understand the OP is direct driving the LEDs with the digital outputs.
While the LED supply is 5V, the logic levels of the attiny will be able to turn the LEDs ON and OFF.
If the LED supply is higher than 5V, the LEDs will not be turned OFF with a 5V logic HIGH.
Tom.. :slight_smile:

bobdeutsch:
Is it necessary to set the pin to INPUT and use the read command?

You want to set is to OUTPUT! This is not about where the current goes, but where the inforamtion goes. INPUT means the Arduino is passively reading the digital state (with high impedance, virtually not current flowing at all). OUTPUT means the Arduino outputs a logic level, either LOW or HIGH.
The current will be determined by the outer circuit and you have to make sure yourself that you are not exceeding the 20mA max current of the Arduino (e.g. with a current limiting resistor).

Problem has been solved. Thank all of you!

bobdeutsch:
Problem has been solved. Thank all of you!

Hi,
What was it and what was the solution?
This thread could help someone else with a similar query, please give us some closure.
Also a circuit diagram will help.
Thanks.. Tom.. :slight_smile: