I need to be able to control turning on and off an RGB LED utilizing the Raspberry Pi. I also should be able to turn it on and off using an Android device.
The design is made up to utilize three different components: Raspberry Pi / LED Hardware, Web Service, and Android device.
All the gear that was used was:
- Raspberry Pi – Model B
- 5mm High Brightness Full-Color LED
- 3 x Transistors – 2N3904
Some of the constraints I also have to work with are:
- Each of the 3.3V GPIO pins can handle a maximum current of 16mA. They might be able to do more, but from what I read, it would not be for long.
- The Pi takes about 700mA of the total power without anything plugged in (USB, HDMI, etc), so depending on the power adapter used, there might not be enough power. In this case, I used a 2A plug.
- Since each color will require more than 16mA of power to turn on, I need to utilize transistors and the 5V pin from the Pi. I will use the GPIO to handle closing the circuit on an NPN transistor. I believe I need to use NPN due to the fact that the LED has a common anode.
The R1 resistors are a complete bit of voodoo to me. I just don’t know enough to do the calculations correctly, so I know they are under powered. I also took readings and they are no where near high enough to be a concern. The best I could come up with was that the β / H(fe) for each is about 60 or 54. That is probably wrong though, but I’m not sure how to follow the white sheet correctly. I also wasn’t sure what or how to find what the voltage drop is (I hear .7V or .9V), which goes into the calculation. I checked with the multimeter afterwards and all pieces were very low.
For more detail: Controlling a RGB LED attached to a Raspberry Pi through Android