Saturday 15 September 2007

Transistor equivalent circuit

When to use a relay


Transistors cannot switch AC or high voltages (such as mains electricity) and they are not usually a good choice for switching large currents (> 5A). In these cases a relay will be needed, but note that a low power transistor may still be needed to switch the current for the relay's coil!

Advantages of relays:

  • Relays can switch AC and DC, transistors can only switch DC.
  • Relays can switch high voltages, transistors cannot.
  • Relays are a better choice for switching large currents (> 5A).
  • Relays can switch many contacts at once.
Disadvantages of relays:
  • Relays are bulkier than transistors for switching small currents.
  • Relays cannot switch rapidly, transistors can switch many times per second.
  • Relays use more power due to the current flowing through their coil.
  • Relays require more current than many chips can provide, so a low power transistor may be needed to switch the current for the relay's coil.

A transistor inverter (NOT gate)


Inverters (NOT gates) are available on logic chips but if you only require one inverter it is usually better to use this circuit. The output signal (voltage) is the inverse of the input signal:
  • When the input is high (+Vs) the output is low (0V).
  • When the input is low (0V) the output is high (+Vs).
Any general purpose low power NPN transistor can be used. For general use RB = 10kohm and RC = 1kohm, then the inverter output can be connected to a device with an input impedance (resistance) of at least 10kohm such as a logic chip or a 555 timer (trigger and reset inputs). If you are connecting the inverter to a CMOS logic chip input (very high impedance) you can increase RB to 100kohm and RC to 10kohm, this will reduce the current used by the inverter.

Using a transistor switch with sensors


The top circuit diagram shows an LDR (light sensor) connected so that the LED lights when the LDR is in darkness. The variable resistor adjusts the brightness at which the transistor switches on and off. Any general purpose low power transistor can be used in this circuit.

The 10kohm fixed resistor protects the transistor from excessive base current (which will destroy it) when the variable resistor is reduced to zero. To make this circuit switch at a suitable brightness you may need to experiment with different values for the fixed resistor, but it must not be less than 1kohm.

If the transistor is switching a load with a coil, such as a motor or relay, remember to add a protection diode across the load.

The switching action can be inverted, so the LED lights when the LDR is brightly lit, by swapping the LDR and variable resistor. In this case the fixed resistor can be omitted because the LDR resistance cannot be reduced to zero.

Note that the switching action of this circuit is not particularly good because there will be an intermediate brightness when the transistor will be partly on (not saturated). In this state the transistor is in danger of overheating unless it is switching a small current. There is no problem with the small LED current, but the larger current for a lamp, motor or relay is likely to cause overheating.

Other sensors, such as a thermistor, can be used with this circuit, but they may require a different variable resistor. You can calculate an approximate value for the variable resistor (Rv) by using a multimeter to find the minimum and maximum values of the sensor's resistance (Rmin and Rmax):

Variable resistor, Rv = square root of (Rmin × Rmax)

For example an LDR: Rmin = 100ohm, Rmax = 1Mohm, so Rv = square root of (100 × 1M) = 10kohm.

You can make a much better switching circuit with sensors connected to a suitable IC (chip). The switching action will be much sharper with no partly on state.

No comments: