# 5v to ground on digital pins

Hey all, what type of resistor would i need in order to take one of the Arduino Digital outputs to 0v (ground) instead of 5v? I'm hooking up a 4pin 5mm LED and i am using a common Anode for the, well common (will be 12v) and using the other 3 pins (R/G/B) for the digital pins 3,4 and 5 on the Arduino. But i will need to ground those 3 pins on the LED and i know that 5v is diffault that comes from the Arduino's digital output pins.

Any help would be great, Thanks! David

But i will need to ground those 3 pins on the LED

This is known as sinking current. The other way is known as sourcing current, both are possible.
The maximum current you should source or sink is about 30mA so calculate your resistor accordingly.

However:-

well common (will be 12v)

So when not sinking current the voltage on the output pin will be 12V, and that will kill the arduino so you need a transistor to sink the current for you. Remember to include a base resistor to limit the current out of the arduino.

Would either of you mind drawing what you are talking about out? Im a visual learner! Also, would a ssr eliminate the need for resisters and such?

Thanks,

David

Take a look at part like ULN2003, ULN2803. You connect the input to an arduino pin. You connect the ground to arduino ground. (Do not connect 'com' to anything. )You connect the output to a resister to the cathode or your LED, the anode to +12V. This part can handle the higher voltage that results when no current flows thru the LED. When the output goes low, the 12V is spread along the LED (~2V), the transister (~1V) and the resister (12-2-1 = ~9V).
9V/resister = current flow thru string of three elements.
Or, 9/desired current = resister value needed.
Thus, for 10mA: 9/.01 = 900 ohm. Use a standard value that is close.
Adjust the equation for your actual LED (forward voltage drop varies by color) and the transister you use.

You don't need a ssr - and you would still need a resister if you used one, the resister keeps the diode from burning up due to excess current.

You don't need a ssr - and you would still need a resister if you used one, the resister keeps the diode from burning up due to excess current.

Most SSR use an internal series resistor for their internal LED, that's why the common input spec is 3-30vdc. However the biggest reason to not use a SSR here is that almost all of them are designed to handle AC voltage only on their output, not DC as once triggered on one would not be able to command the SSR off.

Lefty

Can i not simply add a resister value to drop the 5v from the arduino down to 0v without all the needed hardware?

I will be powering 84 leds with RGB in an array.

``````Solution 1: 4 x 21 array uses 84 LEDs exactly
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms
+----|>|----|>|----|>|----|>|---/\/\/----+  R = 180 ohms

The wizard says: In solution 1:
each 180 ohm resistor dissipates 72 mW
the wizard thinks ¼W resistors are fine for your application
together, all resistors dissipate 1512 mW
together, the diodes dissipate 3696 mW
total power dissipated by the array is 5208 mW
the array draws current of 420 mA from the source.
``````

and this is what it looks like: Its an array and once an object gets close enough it turns into an "X"

David

Can i not simply add a resister value to drop the 5v from the arduino down to 0v without all the needed hardware?

No.

You need some form of current limiting device.

http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

Then ill just use 3 5v relays to trigger a ground then.

David

The wizard says: In solution 1:
each 180 ohm resistor dissipates 72 mW
the wizard thinks ¼W resistors are fine for your application
together, all resistors dissipate 1512 mW
together, the diodes dissipate 3696 mW
total power dissipated by the array is 5208 mW
the array draws current of 420 mA from the source.

180 R - 20mA -3.6 V each resistor, Using 5 V, 1.4 per LED Vdrop @ 20mA
Total Power 5.2 W assuming 5V @ 420 mA = 2.1 W Humm ... not equal... What voltage source you are using ? I hope it is NOT the Arduino board ? It won't cut-it !! For that many LED's , use a better PSU, use a transistors array just like CrossRoads sudjested.

He has 12V source, needs 420mA of current for 21 strings at 20mA each.
A single NPN or MOSFET transistor could handle that if they are all in parallel.
Or a pair of ULN2008/2803 outputs in parallel for some margin.