1
\$\begingroup\$

I am trying to design a very simple schematic and trying to understand how the transistor works as switch.

  • Transistor: Datasheet
  • Description: NPN - Pre-Biased 100mA 50V 100mW USM(SC-70-3) Transistors (NPN/PNP) RoHS

Assuming I have the + of a lamp connected to P and the - of the lamp to N, if IO18(connected to a microcontroller) is "low" the light will be off.

If IO18 is set to high, will the lamp turn ON with the way I designed the schematic?

Edit: Why does this transistor have embedded resistors?

enter image description here

\$\endgroup\$

3 Answers 3

1
\$\begingroup\$

Your circuit will function correctly and do what you expect.

The transistor you have is intended to reduce the parts count and save space on your PCB - you only have to place one part instead of three.

You need a resistor in series with the base of the transistor to limit the current through the base. Too much current could damage the transistor (if your microprocessor can deliver enough current.) Alternatively, it prevents damage to the microprocessor by limiting the current drawn from the processor pin.

The resistor from the base to ground is often left out. It takes care of the case where there is no signal on the base. It pulls the base to ground to make sure the transistor stays "open" (and the lamp off.) The outputs of many processors is "high impedance" at power on - the output is neither high nor low, but rather "floating." In that condition, the base of the transistor could pick up enough stray current to turn on the lamp (or do other, worse things) when it shouldn't. The resistor to ground prevents those undefined events from happening.

\$\endgroup\$
0
\$\begingroup\$

Yes, that's correct. If you set your IO18 to a HIGH it will turn the transistor ON and current will flow through your lamp.

(this assume that your two resistors that are shown without values are appropriately chosen.)

\$\endgroup\$
4
  • \$\begingroup\$ So VCC12V is always connected to the + of the lamp while ground is no and thats why lamp is off. When IO18 is high, lamp's - will be connected to ground and its going to turn on. Is that correct? I have edited also the post. \$\endgroup\$
    – Kris
    Feb 1, 2021 at 18:00
  • \$\begingroup\$ The lamp must also be rated at or below 100mA as that is the maximum current the transistor can switch. \$\endgroup\$
    – Justme
    Feb 1, 2021 at 18:03
  • \$\begingroup\$ @justme thanks also Why this transistor has embedded resistors? Where do they help? \$\endgroup\$
    – Kris
    Feb 1, 2021 at 18:09
  • 1
    \$\begingroup\$ @Kris "Why this transistor has embedded resistors?" Simply to reduce component count. \$\endgroup\$ Feb 1, 2021 at 19:02
0
\$\begingroup\$

Basically, this circuit (transistor switch) needs only one resistor connected between the input voltage source and the base. The role of this base resistor is to expand the input voltage range of the transistor that is several hundred millivolts.

Why is there a need of the second input resistor connected between the base and emitter? It is necessary if the input voltage source is of the "open collector" type. Then zero input voltage means open input circuit and the base would be "floating". This is undesirable because all sorts of leaks and induced voltages can turn on the transistor. So, the role of the second resistor is to shunt the base-emitter junction thus zeroing the undesired parasitic voltages.

The collector resistor R34 would be necessary if an LED instead a lamp would connected in the collector. Diode elements, including LED, are voltage stabilizers that keep up a constant voltage drop across them (in the case of LED, it is about 2-3 V). So, the transistor will try to keep 12 V across the LED... while the LED will try to keep 2 V. As a result of this "conflict" between two voltage-type elements in parallel, the current will enormously increase... and some of them will be damaged. R34 prevents this by limiting the current.

In the future, follow this simple rule: There must be at least one resistor in a circuit of series-connected voltage sources and diodes.

\$\endgroup\$
1
  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. \$\endgroup\$
    – Voltage Spike
    Feb 3, 2021 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.