| Electronics > Beginners |
| How to wire this setup? |
| << < (5/12) > >> |
| Youkai:
KL27x what is the purpose of "Rb" in your diagram? Will too much current flow from the Arduino pin without it? How would I pick a value for that resistor? |
| KL27x:
B is for base. Without a base resistor, there is nothing limiting the current drawn from the Arduino pin. You should limit the base current to something around, say, 1/10th or 1/20th the current which is drawn by the LED strip. This is the energy "tax" for using a bipolar transistor. You might get away with less. The "Hfe" of the tranasistor can be found in the datasheet. An Hfe of 100 technically means that the transistor could switch up to 100x the base current; and there are transistors that go even higher. But due to variation between devices and other stuff I never bothered to learn, myself, I understand it is common practice to simply shoot for a base current of 1/10th the current of the load, when using a BJT as a switch. You could alternatively use N channel MOSFETS. A gate resistor is often used to prevent ringing, and to prevent temporary high draw from the Arduino while charging the gate. But it can often be omitted. OTOH, a pulldown resistor on the gate would be desirable, but not strictly mandatory, as well. So while it is totally possible to use an NFET driven directly by the Arduino without any additional resistors, it is common to use a gate resistor AND a pulldown resistor for a FET in this type of usage. You can decide if you would need those, yourself. I often drive (small!) FETs directly from a micro pin but there are often minor annoyances that can occur when leaving out the pulldown resistor... e.g., the LED strip might be energized before the Arduino starts to do what it is supposed to, and the LED strips might temporarily blink on when you first plug in the power because the gate of the FET happens to be floating high. Omitting a pulldown resistor on a FET gate can also leave the FET much more susceptible to death by static electricity when it's not plugged in. Common values for something like this might be 10R for the series resistor, 100K for the pulldown. The max current one of your Arduino pins is probably around 25mA, plus or minus 10mA. So your LED strips should be max of maybe 250-500mA draw if you want to switch them with single BJT. But don't use this 25mA max as what you will get without any base resistor. If you don't limit the current with a resistor, the pin will suffer internal voltage drop and heating and will not necessarily work as you think it will. Ohms law, voltage/resistance = current. Voltage from your Arduino is 5V, minus the drop across the B-E junction, which you can fudge at 0.6V. So 4.4V. Figure the current you need and you get your resistance. 4.4V/desired base current in amps = resistance in ohms. |
| Youkai:
There is a lot of good information there. Thank you. The current draw of my LED says it's 38mA (I'll round to 40 for the math). Attached is a picture of the "data sheet" from the assortment of transistors I got. My LED only needs 30mA or 0.0038A. So I could use the "smallest" transistor which is rated for 0.2A correct? Using your rule of thumb (10% of current) I want 4mA from the Arduino pin at 4.4v. That means an 1100 ohm resistor correct? According to the data sheet the transistor has an hFE of 200. So does that mean 200:1 amplification. I can't even get 200 times less current than 38mA from my Arduino pin can I? So would I just pick a resistor that reduces the current from Arduino to 1mA? Or do I use the standard 10% rule and a resistor on the emitter to prevent it from drawing too much current? Thanks again for all your help! |
| Youkai:
I worked on a new version of the diagram with your help. Hopefully this version is clearer/more correct. Also it has a little more detail. Please let me know if you see any errors or issues with the way I drew it. I do have some questions about the verbiage in the diagram. I tried to follow KL27x phrasing but I'm a little confused. Are (Vin, Vdd, Power) not all effectively the same terms? Is there some reason they are not all just labeled "Vin"? I guess it probably has something to do with the "type" of device they are? Same goes for (Ground, Vout, Vss). I guess in the case of the Buck I understand why there is Vin/Vout/Ground. But for the Arduino and the Servo it seems that Vdd/Power and Vss/Ground are the same thing. Any reason not to label them similarly? Also is the labels from the power rails and to the ground even necessary; or are they just on there for clarity? |
| Brumby:
That is a LOT easier to read. Well done. :-+ |
| Navigation |
| Message Index |
| Next page |
| Previous page |