Instead you need to add additional devices such as an n-channel MOSFET and a few resistors or an opto-isolator and a few resistors and so on. This means that a 3.3 V or 5 V micro controller is unable to directly control the transistor. This requires you to supply it a range of 0 V to a few volts below the supply level (12 V). To switch the anode (or positive side), for a device operating at a higher voltage (say 12 V), you would use a logic level p-channel MOSFET. This is typically quite easy for micro controllers which go to 3.3 or 5 V. This will require the gate to go to a few volts above 0 V for the transistor to be on and 0 V for it to be off. To switch the cathode (or ground or 0 V side) you can use a logic level, n-channel MOSFET. Most voltage regulators will have a common ground, a high voltage input and a low voltage output. When you connect a lot together (for example, an LED or LED strip and a micro controller) they will likely have a common ground, but different supply voltage. Lots of electronics will have different voltage requirements. In my experience it is easier to switch the negative side. It is the switching and amplification configurations possible with each kind of BJT that is part of what motivated the preference for positive supply voltages.Īnd for switching purposes, a BJT transistor needs to be used in common emitter configuration, which, for NPN used with positive supply, means switching the low-side (cathode) side of the LED. NPN transistors (in silicon) have had a better price/performance ratio than PNP transistors, as explained by this random article here: ( ). NPN transistors easier to manufacture than PNP. This, in combination with customary use of positive-voltage power supply rather than negative, leads to favoring separate cathodes for LEDs. It's preferable for that wire to be at Ground voltage rather than plus supply voltage, so that if it shorts to the chassis or other wires there's less hazard. A wire which completes the circuit for a remote device often must travel some distance through mechanically stressful conditions. I can suggest a couple of reasons why common anode are favored: Of course with common anode strips you could use fat PMOS devices too. The idea here is to have a few fat NMOS devices sinking many LEDs currents and many weak sources (I/O pins) driving a few LEDs each. In this case it can be best to have more devices in common cathode and fewer on a common anode. Modern CMOS ICs are much more symmetrical (an ATMEGA328 in an Arduino can source or sink 20mA) since they use bigger PMOS than NMOS to balance the fundamental differences, but the convention of common anode is well established.ĮDIT (More info): If on the other hand you're building a matrix, you'll have to have both current source and sink transistors. A 74LS00 is specced to sink 4-8mA, but source only 0.4mA. This was particularly true of the TTL logic used in the 74LS series chips (still widely used as interface chips). Older ICs used to be designed exclusively using N transistors for speed reasons, and so were much better at sinking current than sourcing it. Thus the best solution is to connect a common anode to the positive supply and sink current from each LED using NMOS transistors. You need PMOS/PNP transistors to source current (pull up) effectively, but they'll still be weaker at sourcing than an equivalent N-transistor would be at sinking. NMOS / NPN transistors are stronger in general, more common as discrete and are better at sinking current than sourcing. With either common anode or common cathode you'll have one terminal connected directly to a supply for all LEDs and the other side having the dropper resistor and a control transistor per pin (or IC outputs that are transistors on the inside) either sinking or sourcing a current. The reason common anode is more common is because its easier to sink current than to source it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |