I'm trying to get my head around how to properly use NPN transistors to limit the needed current from my Raspberry PI GPIO.
I want to drive a Luxeon Rebel LED from Phillips (https://www.sparkfun.com/products/9637), and I have drawn up this kind of circuit for it:
I'm not that experienced with transistors, so I might be doing something very foolish here. But my thinking was that if I have a 9V battery, and I would like to use GPIO pin on my raspi, something like this might work.
I calculated the resistor value for the LED1 with the information from the sparkfun website information (typical forward voltage of ~3V) -> R = (9V - 3V) / 0.2A. So I got 30 Ohms from there.
The battery and raspi ground would be connected. Is there something I am doing in a stupid or even dangerous way ? I want to understand how properly use NPN transistor for this kind of purpose..