Tag Archive : relays

Transistors vs. Relays

You don’t often think of a transistor as a switch or relay, but they are very useful for switching power on and off to a load, where higher current is needed. When used as an ON/OFF switch, the transistor is not operated in linear mode, but operated in ‘saturation’ or in ON/OFF mode. For some applications, a cheap transistor is more suitable than a mechanical relay for ON/OFF switching.

As an example, your Raspberry Pi or Arduino General Purpose I/O (GPIO) only provides a limited output current. Usually in the range of 10 to 50 milliamps, but it could vary. If you wanted to drive a small 5 volt buzzer or motor, that was rated at 500 milliamps, you could not directly drive it, even if the voltage output of the GPIO was 5 volts. The voltage would be sufficient, but the current demand of the load would burn out the GPIO driver.

Since a relay can accomplish the same thing, you might ask, why use a transistor instead of a relay? Let’s explore the differences between a transistor operated as a switch and a relay. The differences will affect your choices when designing digital electronics. (This comparison is between mechanical relays and transistors. There exists a class of relays that are marketed as ‘solid state’. This just means that they are transistor based relays or switches.)

Isolation

The transistor will not provide isolation of the GPIO output to the load device. Sometimes isolation is needed, such that the ground and drive lines are isolated electrically. The relay provides some isolation if wired using a separate power supply with a separate and isolated ground from the ground used by the GPIO. This is because the relay contacts are not physically or electrically connected to the input drive lines that energize the relay coil.

Speed

Transistors will be much faster when turning on and off. The action of moving a mechanical device, like a relay, inherently takes some time. Whereas, transistors react much quicker. The speeds are different by orders of magnitude in most cases.

Longevity & Durability

Transistors are much more durable and have longer life spans than mechanical relays. Mechanical devices tend to wear out over time. This does not mean transistors do not have expected life spans, but they are much greater than the lifespans of mechanical relays.

Cost

When a transistor can be used, the cost is usually lower than a relay. This is not always the case, but in general and for some applications the cost will be lower.