![]() We will use an HM-10 Bluetooth module as an example here. Now type “255,255,255” and check if the LED turns on (white). Start the Serial Monitor ( Tools > Serial Monitor) and set it to “Newline” and “9600 baud”. Select your type of Arduino ( Tools > Board) and it’s port ( Tools > Port) and click the upload button to compile the code and upload it to the Arduino. ” and use the that piece of code instead of the code for the common-cathode LED (comment that out). Please note: if using a Common-Anode RGB LED: In the code, find the comment “ // if you're using a common-anode. Next, download this example sketch: BT_rgb_led.ino and open it in the Arduino IDE. If using a Common-Anode RGB LED: replace the black wire with a red one and connect that to 5V: Resistors are 220 ohm (180 or 330 will work also). Setup the RGB LED with the Arduinoįirst, build the circuit according to the example given below: This tutorial is based on this instructable. If not, you might want to follow a basic tutorial and/or install the Arduino software (the IDE). This tutorial assumes you already have some experience with Arduino. A HM10 BLE Bluetooth module is connected to an Arduino Uno. Wire the first led's cathode to the next led's anode, and one resistor per pair.In this example we will control a RGB LED from an Android App via a Bluetooth connection. Note, the schematic below only shows one led bar, you would just add the rest in the same fashion. A 1kΩ base resistor is used between the transistor base and the MCU pin. So this simplifies the equation to 3mA * 25 series chains, only 75mA that needs to be switched.Īny common small signal transistor like the 2n3904 can handle 75mA without issue. Each series of resistors, in this case two, would use the same 3mA of current. Not per led, but per series, as current is equal in a series path. Since you have 330Ω resistors, adjusting for that would give 3mA per Series. Where Vcc is 5v, Forward Voltage is 1.95v per led, since we have two in series, 1.95v * 2, and Desired Current is 2mA. Taking into account the common Led resistor calculation: Other switching devices (like a relay) are probably more expensive and slower.Ĭonsidering the information given (50 Red Leds Noted at 1.95V, 5v Source, 2mA current, 330Ω resistors), the following would work. ![]() Of these, I think reducing the LED current or using a larger transistor is probably the most likely solution. use a bigger transistor ( TIP121 is very easy to find).use the same LEDs, but drive them with less current.So the answer is no: you can not switch 50 LEDs with one 2N3904. Looking at the datasheet I see the maximum collector current for 2N3904 is \$ 200 mA \$. If you have 50, then the maximum current is \$20mA \cdot 50 = 1000mA \$. A reasonable estimate of the maximum current of these is \$20mA\$. ![]() But let's assume you are using the usual nothing-special variety. To answer that, we'd need to know first what kind of LEDs. So, the question then is this: Can a single 2N3904 switch 50 LEDs? There are transistors of all sorts, and some can switch truly huge loads. Is this viable?Ī transistor is basically a switch that can disconnect ground or 5V. I did have a thought that I could have some sort of electronic switch that can disconnect ground or 5V. sorry for my rather haphazard comments!). ![]() I realise after thinking about it that I don't need to have a resistor in series with each LED for this now as they are either all on or all off (hmmm. On another part of this project, I use the light bars as level meters, and each separate LED is controlled via a shift register, thus the separate resistor. I had mentioned in a comment in an answer below that I was using a 330 ohm resistor with each LED. The LEDs come in the form of this LED light bar array (or at least very similar). I am using an external power supply that is wired into a custom board with a 5v voltage regulator so I am powering the LEDs directly from this regulator. Is this the approach I want to take? I presume I would need a higher power transistor? I don't want individual control, I just want to be able to turn them all on or all off. I want to be able to turn on 50 red LEDs with one pin of an Arduino. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |