Transistor and external power, which circuit is right

Hey there,

I want to controll a larger number of LEDs with my arduino. So I use an external power source (in this case 12V from a pc power supply) and a transistor to power them up.
But I am not really sure which of these is right; Version 1 or 2? Or are there other mistakes in it? I think it should be V1.

Data:

  • Arduino Uno (5V from the pin)
  • 12V from another power source
  • 3 blue LEDs (should be more later... but thats just more transistors) 3,2V 20-30mA
  • R1 ~90 Ohm
  • R2 = ? Should be around 750-1500 Ohm right?
  • R3 really big one (10-100kO)?!
  • BC547C NPN Transistor

Some advice would be great.

Version 1 is closest to being correct, except for that R3 resistor, it's not required and should be replaced with a piece of wire.

Lefty

I'm old school and get nervous when you hook up an Arduino to voltages above 5VDC.

For my money, I would use a 4n35 opto-coupler to isolate the Arduino from the 12V circuit.

If you need a schematic, I can provide one. Just let me know...

MaJiG:
I'm old school and get nervous when you hook up an Arduino to voltages above 5VDC.

Hopefully only the grounds are connected. The 12V wire shouldn't come into contact with the Arduino.

Thx for the feedback! About the 3rd resistor: read somewhere that this could help block any not wanted V gettin into the arduino but I wasn't sure about it either. I will skip that then. So if got the curcuit... just have to build that then.
Is the picture right then?
Is there anything else I have to be aware of when I build this? Cause I tried to build a (ok some mistakes in it; was more like V2) similar thing earlier and now my old arduino doesn't work anymore... don't want to deal with that again.

PS Don't know how this software work 100% so the resistors are wrong and the LEDs may be pointing the wrong way too :wink: ignore that^^
PPS So fungus: "only the grounds are connected", so I should only connect the 3 cables in the "black" line (from the picture, meaning arduino gnd, transistor emitter, 12V -)? Or do you mean something else?

Is the picture right then?
Is there anything else I have to be aware of when I build this?

Well believe it or not the color of the led can be a factor to keep it from working. If they are blue types that have forward voltage drop values somewhat over 3vdc then your 9 vdc battery may not have enough voltage to allow three of them in series to turn on, even with the transistor turned on. Two however should work in that case, and three of most of the other color types should work, but check the datasheet of the specific leds you use.

Lefty

It's actually 12V the program just had no such thing, so I used the 9V symbol. And the LEDs are blue. But if the rest is fine I am happy.

PS How big has R2 to be? Is 660Ohm enough?