Introduction to the uses of Mechanical, Electrical and
Electronic switches. Understanding the fundamental of electronics from the knowledge of switch.
Photos from internet, Edited by Lim Siong Boon, last dated 31-Oct-09.
My journey of searching the real meaning of electronics,
this topic "switch" is the one worth studying.
The deep understanding in switches,
helps me discover a lot much more about what is happening in electronics.
If you are looking for basic and simple understanding of electronics,
this topic would be the one worth studying.
Practically build up your fundamental in electronics.
Topic Discussion Overview
| 1. Wire Connection
History, old telephone exchange in New York City, during the year 1910.
Long long time ago, circuit connection is achieved using muscular means. The telephone network is one of a major communication system in the early days. To Call your buddy next block, the first step you have to do is to pick up the phone. A human operator will attend to your pick up. Speak to her about the intention to talk to your buddy. The operator will manually plunk in wire connector linking your home telephone to your buddy phone. And Yes, you can now talk to your friend because there are operator doing the switching at the end of your telephone line.
Sounds a lot of manual work. Yes, this is the good old days. The telephone operators in the central telephone exchange house, are making the circuit connection manually. This is what this page is all about. All about switches. All about making a good short circuit.
Not all short circuit is bad. In fact they are the fundamental building blocks in digital electronics. Many electronic design/interface are as simple as a switch.
In the articles that follows, it will be about the various type of electronics components that can help you in the creation of the perfect short circuits.
Various type of connectors
The following connector guide present the typical name for various connectors.
(with courtesy from RS Components)
| 2. Mechanical
1P2T latching type (Form1C)
1P1T latching type (Form1A)
1P1T double break, push button type (Form1X)
2P2T latching type (Form2C)
Summary Table for forms of Switch Contact
Other Type of switch characteristic.
* means most common configuration
(xx) means momentary position,
no bracket means latch position,
off means no connection between throw,
Switch Type (for switch with 2 or more throw)
non-Shorting (typically) - contact is break first before making contact with the next contact.
Shorting - contact is short with the next contact, before breaking with the previous contact.
Various product that uses switches
is a simple type of interface to control electrical stuff using the
means of some mechanical action. In short, a switch is a mechanical to
electrical conversion device.
I can't find any history on the evolution of the mechanical switches. I guess people might have become smarter. Rather than using a jumper wire to make connection manually, human invented switch to make short circuiting task more efficient. Tedious and time consuming work. Plucking the wires in and out takes a lot more effort, compare to toggling switches.
Of course mechanical switches are not suitable for telephone exchange application for the millions of household. However understand the roles of switches in electronics, will definitely increase our awareness for a more complex electronic system. Switches in the form of mechanical, digital circuit, power electronics are commonly use in the electronics design.
The greatest thing to understand about switches is all about the component/device rating. Some people refer it as the power handling capacity, which is the voltage and the current. The voltage it can handle across the switch terminals without destroying itself. Sometimes refer to as the breakdown voltage. The maximum amount of current that can flow through, without destroying itself. Sometimes refer to as the load current the switch can support.
In fact, the whole idea of this "switch" thingy is about understanding the rating and capabilities of the various type of electronics components. I mean it applies to all the electronics devices, including even wires. To me, this is also the most important concept towards understanding of all other electronics. It is so important. Fortunately it is also easy to understand, if you pay enough attention in this topic.
Not just switch have rating. Wire also have it's rating, since we know that switch is in fact another form of wire, or to be precise we call it a conductor.
Like the size of a water pipe, there is a limit on the water flow rate. If the pipe diameter size is small, flow rate will be small too. Larger diameter pipe more water can flow. This is what they mean by the term "current rating". Larger wire size can carry more current. Small wire may also carry the same current at the expense of increase temperature. When it gets too hot, the wire will just burn off, just like what a fuse do.
For further information on choosing your wire for carrying power, click here.
If there is an important message that I want you to bring back after reading this whole article, it will be the following four words.
"Everything have its Limit"
Shifting our attention back to mechanical switch. There are various kind of terms for mechanical switch. Switches can be "momentary" meaning the the switch will spring back to the original position when there is no external push forces, or "latched" meaning that the switch will stay at it's new toggled position when when external push forces is applied.
Switch description such as "double poles double throws" or 2P2T provide more information on how the switches are operated. "Poles" tell us how many sets of switches are connected to a single mechanical trigger. This is often refer to as ganged switches. "Throws" describes the number of switch contact way. If you are still not clear what I mean, refer to the pictures on the left side. Picture indeed tells a thousand words.
Another term used is shorting or non-shorting switch. Non-shorting switch means that the switch will break the contact with the current "throw" position before making contact to the next "throw" position. This type of switch is more commonly in use. Shorting switch means that the switch will break the contact with the current "throw" position after making contact to the next "throw" position. This means that during the switching, two of the "throw" position will be shorted for a very short period. It is used where the connection needs to be connected always and not left floating at any one time. Happen to found out that these are used in switching loads such as loudspeakers, where the source cannot be safely operated without a load.
There are other form of switch description known as the "switch contact forms", some example are Form A, B, C, X, Y, Z, AA, BB, AB. Form A is defined as a normally open switch, while Form B is a normally close. Form X is similar to form A except that it has a double break contact. Form X, Y, Z are double break switches.
For example a switch labeled as "Form 1A" (SPST) indicates that it is a 1 pole normally open switch. "Form 2C" consist of a NO as well as a NC contact, also known as the DPDT or 2P2T switch. Form Y is a normally close 1P1T double break switch. Form AA is a 2P1T normally open switch.
These terms are common description for mechanical switches, and is also widely applied to mechanical and reed relay devices as well.
The main point to note when choosing a switch, is on the mechanics design, and the feel of the button. This is non-technical, and is more about user's experience.
Technically all switch has their maximum rating for handling current. Like a wire, if you choose a thin and fine wire, the wire will get burn or melted when large current flow through it. This is also the principle of how electrical fuse works. You can choose a higher rating switch which can match most type of condition, however they are usually big and bulky. This is the trade-off on choosing an appropriate switches.
There are many more styles of switch, and you may like to refer to the following website for more references.
There are various mechanical switches around us. They are acting as a system interface, which convert mechanical motion into electrical signal. For example, the keyboard which you are typing, the power switch that turns on your TV, the keypad you pressed on your telephone or mobile phone, the lever switch that turns on your rice cooker, microwave oven....etc. They are interface with switches for us to control.
Interfacing a switch for digital input (TTL, CMOS)
The circuit on the left illustrate a simple switch interface. This interface provides a output voltage to indicate the status of the switch. If the switch is press, the output will be a 0V. While it is release, output will be a 5V. This can be a input interface to a digital circuit, for logic '1' or '0'. A useful and basic circuit interface.
Mechanical Glitches from a mechincal switch
Mechanical switch is analog in nature. When a mechanical switch is pressed, two metal plate is in contact with one another. The force is small but is large enough to cause the contact plate to bounce away.
This is like a pencil dropping onto a floor, we can see the pencil hitting the floor and bounced up. The pencil will settle on the floor after a number of bounce.
This bouncing results in intermediate contract between the metal, and can be catches very quickly by the electronics. This also results in what is known as the switch glitches.
This is not too critical for some electronics, but for others, it may result in undesirable results. Designing a mechanical switch which is glitchless can be difficult. A practical way to remove the signal glitches would be through electronics components and design. Microcontroller is very popular in most circuit design, and the firmware can also be written to remove these unwanted input switch glitches.
The oscilloscope's screen capture on the left shows the glitches produce by the following PCB mounted tactile push button switch.
The signal captured is the input signal, when the push button is released. These glitches can sustain its noise for as long as 5-15ms. The slower the switch is release, the longer the glitches can be generated.
The glitch behavior depends very on the mechanical switch design. There are switch which can produce a clean digital on/off signal. However, it is best not to assume that the noise will forever not appear. It is still better to assume the possibility of generating noise to design your input circuit properly.
A simple way to remove such switch glitch noise is to insert a capacitor of let say 100nF between the input signal and reference ground.
Common Switch Information (name, dimension, circuit)
|Toggle Switch (chasiss mount)||Toggle switch dimension and thread size 1/4-40 UNS-2A
Drill 6mm hole for tapping.
Typical Toggle Switch Dimension
Toggle switch drill hole size
|Vandal-Proof Switch (chasiss mount)
silver aluminum metal, 16mm, latching type, red LED ring, 12V, vandal-proof, metalic switch
Thread M16, 1mm pitch
Drill 16mm hole for tapping.
Typical 16mm metalic switch dimension
|Vandal-Proof Switch (chasiss mount),
|Cross section illustration of a pizeo switch
Pizeo switch circuit
Singapore Customized, custom made Electronics Circuits & Kits
| 3. Mechanical
Typical Mechanical Relay connection pin
|This is a very
important section. The introduction to this electrical control switch,
call a Relay. It is basically a device to activate a mechanical switch,
by electrical means. This is unlike a switch which is activated
manually. In another words it is a device that convert electrical
signal to a mechanical energy back to electrical signal again. Similar
to mechanical switch, they can be described as 2P2T, single pole double
How it works? A electrical voltage will be applied to activate a coil in the relay. The coil being powered up, will generate a magnetic force that will attract the lever. This lever will be pulled towards the magnetized coil, causing an action that will switch the mechanical contact.
Why on earth this relay is for? Why is there a need to convert electrical to mechanical to electrical again?
A example would be that you may want to switch on your home 230Vac power remotely from your friend house 1km away. To do this, one possibility is to lay cables thick between your friend's home and your home. The cable must be thick enough to handle the high current and 230Vac voltage. Using a 230Vac rated switch, which is relatively bigger in size, it can be mounted in your friends home in order to do the switching.
Another cool method is that you can deploy a relay to help switching the 230Vac in your own house, while a thinner wire and lower rating switch laid across your friend's house. This is one of the use of a relay. To be exact, the relay helps to control energy from a electrical signal to a mechanical energy to electrical power. Other application can be, controlling a high power motor using tiny switch, or to switch on the house lightings using your computer system digital signal.
The application of relay is important, as it is still widely used in control application. It can be thought of as a amplifier. A powered signal can be produced by using a small signal. This principle is similar to the use of a transistor as a switch. Knowledge in the relay will certainly aid understanding the transistor, commonly seen in circuit interfacing.
Example of an electrical circuit using a relay
There maybe times where you need to activate a relay, for certain logic output. The digital signal from the logic IC might not be able to turn on the relay coil. This is because the logic IC are not design to drive load that requires high current. To drive a high load device such as a relay or motor, a transistor can be interfaced between the logic and the supply to power up the load. The following diagram illustrate the circuit. More information about using a transistor as a switching device, can be found in the later section "Transistor"
(fig.3a) Digital Logic interface to a Relay as output using transistor.
Another common use of relay is to act as a isolator output for communication or I/O between unknown electrical system. This isolated output acts as a mean for electronic hardware to communicate without affecting another electronics system. System design will be simpler, while integration/troubleshooting work will be easier and faster, because system can be isolated easily.
For example, one company may have a robotic application which require mobility and high current discharge. A 12V SLA sealed lead acid battery would certainly meet this requirement. A mobile phone company is following the market trend and will be designing a 3.3V electronics circuits which has the advantage of size and energy efficiency. Another one may choose to deploy 5V system, because they have been using some critical component which requires 5V. How are their design able to communicate or control another system using a different voltage system. They may use communication standard like RS232 to communication between systems. However the design will be considerably too complex if the communication requires only 1 bit of information, either on or off.
The operation of a relay as an isolated output is simple. The system X that activate the relay provides a switch contact to indicate logic 1 or 0 to the receiving system Y. Y provides its own power and interfacing circuit to sense if the switch is close or open. Since there is no voltage interaction between the two system, some people defined this as a "Dry Contact interface". System X activating the relay has provides a "Dry Contact" or a switch contact output without any electrical signal transmitted to system Y. Dry contact does not mean that no electrical current flow. It simply mean that Y will provide it's own electrical circuit to obtain the output signal from X. For further information on detecting switch status, you can refer to the section on mechanical switch.
In this scenario, the relay acts as a output isolator, providing a logic signal without any direct interference to the receiving system Y. Y will interpret the switching action, just like a normal mechanical switch. Implementing such a isolated design, it makes the system modular just like a black box. Certain input will be responded by a defined output result. On site deployment will be easier, and system troubleshooting can be a lot faster.
The important points to note when choosing a relay is to purchase the correct coil voltage rating, and the relay's switch current handling capacity. When the coil is to be activated from a 12V signal from a circuit, you need to get a relay that can be trigger by 12V. There are various input rating typically 5V, 6V, 12V or 24V to choose from. Remember to take note of the voltage system your electronics circuit is running, before any relay purchase. On the switching side, you need to determine how much current will be flowing through the relay. If you need to turn on a high current rated device, make sure you get a relay that can handle the maximum current/power the device can draw from the supply. As a guide, choose a relay switch that have a current rating 2 times the maximum expected current that will be drawn. This would be quite a safe margin to prevent further complication due to temperature or other environment factor. A higher rated relay switch will be bigger. It is a trade off to decide upon. Cost ranges from S$3 to S$20. Relay can wear out and need replacement. There are socket available, so that the relay can be plug in and out for replacement easily. They are available for about S$5 to S$10, with choices like DIN rail mounting, PCB mount, etc...
Compare to current known technology, the relay is able to provide a higher current handling capacity, and higher isolation between system.
The disadvantage is that relay have relatively shorter operating life due to mechanical wear and tear. It also make tick tack noise produce by the mechanical action. The switching could also produce unwanted mechanical glitches. When switching high voltage power, because of the large voltage difference between both end of the contact, arcing will be produced during the switching. This arcing spike can weld the contact bit by bit, and after a period of time the contact can eventually be welded together. The relay will then be useless since it is unable to do switching. Therefore the mechanical relay component is unsuitable for switching high voltage power line.
Although there are a number of disadvantages, it is quite popular because of the ease of using it. Troubleshooting is a bit easier because you can hear or see a relay operating. Unlike a semiconductor devices, measuring instrument or indicator display is require as an aid to troubleshooting.
Mechanical relay selection design article from ECN Asia
Singapore Customized, custom made Electronics Circuits & Kits
| 4. Reed Relay
|Reed relay is a
smaller version of relay. Package is in plastic. It is about the same
size as a 14 pin DIP IC socket. It has a slightly different magnetize
structure, however the principle is the same as a mechanical relay.
Since it is small, this reed relay is suitable for handling signal, and
not high power or high current drawing load. Switching sound is hardly
noticeable. You can still be able to hear some tick tick sound when it
is activate. Switching speed is considerable faster than a relay
because the switch mechanism inside the package is small.
Application for a reed relay can be for output signal isolation purposes or for switching on small current load. Example of small load devices that can be switched on might be LED, DC buzzer, relay, circuit or sensors. Typical current handling capacity is of about 0.5A load.
Reed relay comes in different type of forms. Forms refers to the nature of the switch contact. For further information on "contact forms", refer to the switch section above.
Typically swtch form is a single pole single throw switch (SPST or Form A), Typical input coil voltage is of about range from 3V to 12V. Load coil current is typically 10mA for a 5V reed relay. Cost is about S$2-5
A number of time I encounter product issue with the reed relay, and have to spend a lot of time de-soldering the component out for a replacement. I will recommend building a simple tester to test the reed relay.
For a 1A05 relay, the coil resistance is typically 500Ω. Some new reed relay can measure 500Ω, but after pumping 5V across the coil, the resistance might drop to 100-300Ω or even 0Ω. This might be due to the faulty coiling wire which go shorted inside the reed when the current is applied. Once the short occur, power supply may experience the short circuit. Fuse or transistor in the circuit may get damage due to the short. The output contact of the relay might not work properly, and should be checked as well.
Reed Relay Tester (2009-10-20)
Some part number that you can refer to, for Reed Relay products. Part no. description example "1A05" means the relay is of forms 1A, and is activated by 5V.
DSS41A05B, DSS41A05, DSS41A12, DSS41A24, MSS41A05, MSS41A12, MSS41A24, EGE EDR201A05000, ALEPH DA1A05BWD
CP Clare Be
Singapore Customized, custom made Electronics Circuits & Kits
| 5. Solid State
Typical Solid State Relay connection pin
|This is newer switch
device known as Solid State Relay (SSR) or MOSFET relay. It is a
semiconductor device, to replace the mechanical relay as a reliable
alternative. In solid state relay, the input and switched output have
voltage polarity. Be careful not to connect to the wrong terminal. Some
SSR are design to have the same package and pin layout design as a reed
relay. It looks like a reed relay. You can differential between a reed
and a SSR device by testing it's input terminal. A reed relay is able
to function with a reverse input priority, however a SSR will not be
able to function with reverse input priority.
The solid state relay can be smaller than a mechanical relay. It is a soft start device and does not result in current slug or arcing effect. It has no mechanical switching and is able to do faster switching. This mean that there are no noise, no glitches mechanical switching, lesser wear and tear. All these advantage adds up to longer lasting and more reliable device. The device works with a wider range of input voltage (typical 3V to 12V) and consume relatively less power to turn on the switch.
Like other semiconductor devices, they do have their disadvantages. The component have current leakage when inactive and dissipate heat during operation. Heat sink may be required to prevent overheating. With a heat sink mounted, the whole design could be a lot larger than the mechanical relay alternative. The heat sink itself can be up to 5 times the size of the SSR. If you don't want to mount the huge heat sink to the device, you can try using a SSR that have a much higher current rating, of at least 2 times the capacity of what is required. At least it will not be very hot. If possible, mount it to a metal chassis or metal surface to act as a heat sink to dissipate the heat.
There are various model of SSR in the market which can take AC load 230V/150V and there are models that can handle up to 12Vdc 40A power. Price ranges from S$5 to S$150, depending on the requirement for the load rating. You may try visiting Crydom or Clare for more information on these devices.
In today's competitive market, semiconductor product advances very quickly. Greater performance design might have been already out in the market at this point in time. You can try searching around for new products to keep in touch with the current technology. Free Electronic Engineering Times magazines from Global Sources, provides good information on technology trends as well as the latest electronic product that is rolling out onto the market. It is very likely that the semiconductor devices model for example, solid state relay, integrated circuit IC, transistor, that are presented on this page might be already behind time.
Some part number that you can refer to, for Solid State Relay,
- d1d40 (support 40A DC current)
- CPC1218Y, CPC1510, GI Clare PRMA1B05 (form1B input 5Vdc)
- 61CR, 61G
- LH1500AT, VO1400AEF, VO14642AT
Singapore Customized, custom made Electronics Circuits & Kits
| 6. Transistor
as a switch
Resemble circuit between the transistor and switch
(fig.6a) typical transistor interface, as a switch. Acts a voltage or signal converter, also known as a level shifter.
(fig.6b) switch interface function resembling fig a.
(fig.6c) opto-coupler interface.
(fig.6d) resembling opto-coupler interface, compare fig c.
Using transistor as a switch to drive high current loads
(fig.6e) Digital Logic interface to a Relay as output using transistor.
- npn transistor "BC549" to drive up to 0.1A load
- npn transistor "2N3019" to drive up to 1A load
- npn transistor "tip31a" to drive up to 3A load
(fig.6f) same transistor setup to drive a motor.
The switching setup to drive the coil load On/Off, can generate "spike voltage". This is due to the sudden On/Off switching from the transistor. The same applies when replacing the transistor with a mechanical switch. A diode can be connected across the inductive coil load to divert the spike voltage away from the transistor, as shown in the following diagram. This diode has a name known as a flyback diode. The spike voltage can be high enough to damage the transistor (exceed the transistor's breakdown voltage).
Transistor is often found to be permenantly short
circuit, if the flyback diode is missing, disconnected or not working.
Another symptom could be transistor is permenantly opened circuit,
which happens after some time being short circuit. The short circuit
current could probably burn up the shorted conection.
(fig.6g) flyback diode typically 1N4148 (for small current rating), to divert the spike generated by the inductance away from the npn or n-ch transistor. Refer to diode selection guide for higher current rating.
(fig.6g) flyback diode to protect a pnp or p-ch transistor
Analog Devices, IRF (International Rectifier), MAXIM, National Semiconductor
A switch is a mechanical to electrical conversion device. Transistor is similar to a relay. It converts between electrical system. A voltage logic of 0V 3.3V is able to convert to and from 0V 5V. A voltage logic of 0V 12V is able to convert to and from 0V 9V.
Transistor can be used as a switch or as an amplifier. A transistor as an amplifier needs more brain power. In this section, we will only discuss on using a transistor as a switch. Simple lesson.
As you might have know already, the transistor is actually a semiconductor device. In general, it is a conductive device. Transistor is a variable conducting switch. If you can still remember the main topic of this article. Yes. It is all about switch. Transistor is also a form of switch. The fundamental understanding of using/choosing a transistor, is in fact very similar to selecting a switch or wire. In this section "Transistor as a switch", you should always think of a transistor as a switch. Think of it in the way that transistor can be a substitute for a switch. The switch can be a substitute for transistor. Compare between the transistor and switch, you will see a clearer picture of the transistor operating like a switch.
When I first learn the term transistor as a switch, I didn't understand what my lecturer is trying to say. After some experience with the transistor, I finally become aware and understand that what the book is trying to say. The subject is title "transistor as a switch" for a reason. We have to think of it as if it is a switch.
Similar to a relay, the switching action of the transistor can be activated from a voltage input. Sufficient voltage input to the base of the transistor will make the collector and emitter terminal saturated, also known as Vce(sat). In another word, the collector and emitter terminal will be almost shorted like a switch. Technical it means Vce(sat)=0. In practise, Vce(sat) will never reach 0V. It will be slightly higher than 0V, for example Vce=0.2V. Fig a, shows a typical schematic for a switching transistor. This is very similar to the switch interface in Fig b.
Resistor R1 is chosen so that sufficient current is supplied to the base of the transistor. In most cases 1kΩ would be ok. Over driving the input will burn off the transistor, while under driving will not provide enough current to switch the transistor to fully saturated. For example, an input 3.3V is to turned on the transistor. Assuming the transistor parameter has a turn on voltage Vbe of 0.7V, with minimum requirement Ib of 2.6mA for terminal Vce saturation to occur. R1 should be chosen not more than 1kΩ "(3.3V-0.7V) / 2.6mA". Any resistor greater than that, will not be able to provide enough current to turn on the transistor. A resistance too low for R1 will results in higher current, though likely to damage the transistor. Refer to the transistor datasheet for appropriate R1 value, or you can do a quick experiment to determine the R1 value to implement.
The design value for R2 resistor should be considered based on the input devices the switch signal will be feeding to. A low resistance value for R2 (example: 470Ω) consume more energy. This is because more current will flow through the resistor when the transistor switch is turned on. A higher value R2 (example: 10kΩ) conserved energy, however input response may be slow for certain charging devices. Example would be a ADC (analog to digital converter). The input signal requires faster charge-up/discharge for sampling to take place. A higher R2 will reduces the current and slow down the sample & hold process.
I seldom do computation on transistor when it is used as a switch. When you get used to it, you will get to understand the behavior of this component and eventually understand the computation of a transistor.
Typical transistor circuit acting like a switch. The control signal is from a low current supply IC (for example a microcontroller).
For pnp transistor, the concept is the same as npn transistor. When do we used it? When your logic depends on positive voltage as a reference to switch on the transistor.
To understand this further, you need to realized that a single wire has a potential voltage. But exactly what the voltage is, you will not be able to define it.
This concept is like what I understand from the teaching of Tao. Tao is a Chinese philosophy teaching. Take for example, a wooden stick in my backyard garden. Some people say that the stick is long. But how long would you consider it as long. Compare it with the paper clip on my desk, it is long. Compare it with the river flowing down to the sea, the stick is too small to be seen. The fact is when we say the stick is long, we are comparing it to something we have in our mind. Comparing to a reference point is the key. The relative difference is the key concept.
This is the same as the voltage potential on the wire end. The open end wire has a potential. When we want to read the voltage of the wire, we are actually reading it with reference to another potential. The difference between the two potential is the voltage being read out. To know what is the voltage is on the wire, we need a reference point. Assume we read a voltage of 5V with reference from a ground potential. We will read the same wire as -7V if our reference is on the 12V potential. The voltage level is a very relative thing. Comparing to another ground reference, the voltage might be 100V. Voltage is relative. The same open end wire can be 5V, -7V, 100V at the same instant of time. This is because the reference used in each measurement is not the same.
To turn on a transistor, you need to provide a voltage difference between the base & emitter. You need 2 point to turn on a transistor. Only a wire to the base will not turn the transistor on. You need a pair of wire. One wire to the base, the other wire to the emitter terminal.
PNP has its emitter terminal on the positive end, while npn has its emitter terminal on the negative end.
Given a voltage system of 5V & Gnd (0V). If I have a logic 5V which I need to use it to switch on a transistor. For this case, I can use Gnd as the reference. Between this logic 5V and Gnd, is a voltage difference which can be applied to the transistor, to switch it on.
If the reference I used is a 5V. The logic 5V will not be able to switch on any transistor devices, because the voltage between logic 5V and reference 5V is equal to 0V difference. A transistor will need a voltage difference for it to be switched on. Typical textbook voltage is 0.7V which is our Vbe. Reference line to be connected to the emitter terminal. Logic or signal line to be connected to the base.
Now we know that we have logic 5V & reference 0V. We know that npn transistor would be the component for this switching on job.
Given another situation where you have a logic 0V signal which you want it to switch on your transistor. The voltage reference should be 5V. Present voltage difference to the transistor would be -5V. PNP transistor is chosen this time.
Another illustration to looking at a npn & pnp transistor is to look at the arrow on the transistor symbol. The potential of the arrow head should be lower than the arrow tail by typically Vbe 0.7V. Voltage difference can be more than 0.7V but base resistor should be present. The resistor is there to absorb all the unapplied voltage, so that Vbe can be maintain at 0.7V. If no base resistor is present, the base current is so large that the transistor will be damaged. In all the example used 1kΩ would be quite enough.
This is how we can look at a transistor as a switch.
NPN to PNP converter using npn pnp transistor
For Vcc = 12V, Vin = 3.3 to 5V
Digital logic 1 (3V3, 5V) to Vcc converter,
R2 is a pull up resistor. When Q1 is not turned on, the voltage V1 will be float at a undetermine state. This might result in Q2 pnp transistor being turned on slightly. R2 pull up resistor will ensure that the base of Q2 is tied to Vcc, therefore ensuring the Q2 is shut off.
R3 can be about 10Kohm. This should be large enough such that Q1 & Q2 will not be burned when they are switched on. Q1 collector-emitter junction will be shorted when it is switched on (Vin logic 1). Q2 Veb is about 0.7V when switched on. The value of R3 should be small enough for Q2 to turn on, big enough such that it don't burn Q2 or waste too much energy.
Vout is about Vcc when input Vin is logic 1, and is 0V when input is logic 0. R4 is a pull down such that when Q2 is turned off, Vout does not becomes a floating voltage. R4 can be about 100Kohm
Logic inverter circuit using npn npn transistor
For Vcc = 12V, Vin = 3.3 to 5V
Logic inverter circuit.
For logic input 3V3 to 5V
Different form of transistor packing. Higher power rated transistor having a higher capacity to conduct more current is usually bigger in size. Typical power transistor have metal casing packaging which helps to dissipate possible heat generated by the large flowing current.
Various type of transistor packages.
The following guide present the typical package model name for transistors.
(with courtesy from RS Components)
SOIC-8 package (typical pin out for n-ch)
SOIC-8 package (typical pin out for p-ch)
The following are some of the common npn and it's complementary pnp transistor ranging from low to high current ratings.
Commonly used smd package for transistors,
- sot-23 (for <1A)
- so-8 (for 1A up to 20A)
- dpak (for >10A up to 200A)
My own transistor classification
- Signal Transistor (0.1A)
- Medium Power Transistor (0.5A - 1A)
- Power Transistor (>1A)
- High Power Transistor (>20A)
Note: This is a summary reference. Always refer to your datasheet for actual component's specification.
Opto-coupler although look & work much like a transistor, has a slightly different properties. To turn on the transistor inside the opto-coupler, light is used instead of the pair of wire potential difference.
Various analog switch and opto-coupler product.
CD4066BC, ADG451, ADG452, ADG453, ADG511, ADG512, ADG513
channel, 4pins), TLP521-2 (2ch), TLP521-4 (4ch)
|Logic level translator
||Using MOSFET and 2 resistor to
convert a logic voltage from one to another. In this circuit example, a
3.3V logic is convert to a 5V logic.
This is a very simple logic translator. Please take note that it the 3V3 power is lost, the output logic will be always at 5V. For critical mechanical or machine control, this interface is not recommanded.
|Interfacing opto-coupler IC to a N-ch Mosfet. If input is on, MosFet will be on.
R3 resistor is to absorb the opto coupler leakage current, and to ensure N-ch gate pin is tie to gnd at all times.
|Interfacing opto-coupler IC to a N-ch Mosfet. If input is on, MosFet will be on.
The npn and the npn from the opto-coupler forms a darlington pair.
Singapore Customized, custom made Electronics Circuits & Kits
| 7. Triac , the
electronic AC switch
Symbol for Triac (conduct current in both direction).
Equivalent circuit for Triac component.
The equivalent circuit for the Triac component is actually two thyristor connected in a up and down orientation.
Symbol for Diac (conduct current in both direction with no gate control).
The Thyristor is a solid-state semiconductor device, also known as SCR (silicon-controlled rectifiers). Unlike a triac, thyristor conducts in a single direction. Like a controllable diode or similar to a triac triggered transistor, it is typical use for controlling DC current. The symbol for thyristor,
Article on Thyristors and Triacs. (references from Philips Semiconductors)
Triac is a semiconductor. The device package is very similar to the package for transistor. It is used for switch AC power from the mains. I have no experience in this devices, and is looking forward to try this out.
I have found a very easy to read article relating to Triac as follows. So exciting. I will come up with something soon.
There are 3 component type which I classified them in the same family.
- Thyristor or SCR (Silicon-Controlled Rectifier)
Thyristor or SCR (Silicon-Controlled Rectifier), you can
think of it like a voltage triggered diode. The component will starts
to conduct at both end of the pin upon triggering the gate, and auto
shutdown when the voltage at the conducting pin falls below a specific
voltage. Diac is another type of Thyristor. DIAC, or diode for
alternating current. It does not have gates.
Like transistor the metal tab on the package is used as the interface for heat transfer. Heat sink can be mounted to dissipate the heat away from the conducting component. Some model have the tab connected to one of the live conducting pin. It may helps conduct away heat better but is rather dangerous. For safety reason, isolated tab would be prefered.
The following is a quick guide to getting your triac components. Please take note that every component do varies from various manufacturer. Always refer to the component datasheet and physically check the component.
Triac Switch Circuit:
| Triac switch circuit & measurement
This circuit is a solid state relay interfacing a low digital voltage for controlling the 230Vac power supply to the AC device. In this example, I am powering up an AC motorized fan. This is almost the same as a mechanical relay. Solid state relay does not have mechanical parts which can wear off over the period of time.
The digital and AC power is being isolated by the opto-coupler triac IC, making it safe and easy for a digital microcontroller/circuit to control a high voltage device.
Triac Switch Circuit Schematic:
shown on the schematic, the circuit uses MOC3021 opto-coupler triac
which has a zero crossing detector built in. The zero crossing function
will help ensure that the triac will only be switch on when the AC
power (Live & Neutral) is at zero potential. If the potential
across the Live & Neutral is high during switching, a large
spike/EMI (electromagnetic interference) nosie will be generated. The
zero crossing detection will ensure minimum spike generated. This can
significantly reduce the noise on the power line.
The circuit is suitable for on/off application and not suitable for example light dimming or speed control application.
|On the left presents the circuit setup and connection for measurement. If you are interested in the setup for measuring 230Vac signal, please visit this page dedicated to 230Vac.|
Using the Traic for switching appliances. (2012-06-03)
There are many advantage using a Traic to switch on/off 230Vac appliances compare to using a mechanical relay.
Traic does not produce noisy clicking sound made by a mechanical relay. It does not have moving parts, therefore there are no physical wear and tear. Its physical size is also much smaller. It is a soft start device and does not generate arcing during when switching 230Vac power. Mechanical switch on a 230Vac power tends to generate arcing. Arcing over a long period of time results in the switch being welded, hence relay failure. The operating lifespan of a Traic is much better then the mechanical relay.
Traic can easily be design to operate from a very low voltage device. A mechanical relay current need at least 5V to 24V to enegised the relay's coil to pull the switch. It uses more energy. Traic can be easily design to operated from a very low voltage, and power consumption is lower.
Besides switching 230Vac on/off, Traic can be design to fine control the motor speed or a heater temperature through a potential meter or microcontroller. Mechanical relay would not be able to achieve all these.
The picture on the left is a setup using PIC-117 mini relay switch, purchased from PIC-STORE.
This Triac circuit (PIC-117) was installed inside a wall switch enclosure for testing. The enclosure will ensure safety when operating the Traic circuit. Always be safe when working with 230Vac.
The dangling wire (grey and white) is the PIC-117 digital input. The wire is safe for hand to touch. A voltage as low as 3.3V can be applied to this input to switch on the appliance. PIC-117 accept digital input range from 3.3V to 12V, and can be easily modified to accomulate any range of voltage input.
This setup will be a switching module for any 230Vac appliances. For this demo, I am using a 9V battery to activate a Fan. Typical practical scenerio is to use a microcontroller (3.3V or 5V) to interface directly to the PIC-117 mini relay module.
A power meter is plugged onto the incoming power source. The wall box enclosure (with PIC-117) is plugged onto the power meter. The fan appliance is the last item, which is plugged onto the wall box enclosure. This power meter will measure the power rating, which helps us understand of Traic performance.
This is an ordinary fan appliance setup pior to the Traic setup. The fan's brand is an Akira (400mm 48-52W stand fan). A power meter is used to measure its typical power consumption.
Power measurement of the fan at various fan speed,
Watt Current Power Factor
Power measurement of the fan at various fan speed through PIC-117 mini relay switch.
Watt Current Power Factor
The result shows that there isn't much different in power consumption using a Traic or not.
The following are some video clips of using the PIC-117 mini relay switch module to turn on/off the 230Vac fan.
Video showing that it is safe to touch the digital input of the PIC-117 module. MVI_0346.AVI (17.3MB)
Turning on and off the fan using a 9V battery simulating a low digital input voltage. MVI_0347.AVI (31.6MB)
Notice that the fan is turn off and on instantly without making any noise or spark. The PIC-117 mini relay switch module is small and has much more capability than the traditional mechanical relay.
Looking into how the Traic perform
Signal of the triac switch output, when the 230Vac mains is at the off state.
|Signal of the triac switch output, when the 230Vac mains is switched on. Some signal passed through the triac although the triac is not switched on yet. There is some leakage but they are not significant enough to turn on the AC motorize fan.|
green signal represent the digital input to the opto-coupler. The red
signal shows the power output becoming live, 100msec after the digital
input is being triggered. There is some small delay.
The first few cycle of the 230Vac power is badly distorted, but we can see that the AC signal started off from zero. There is no sharp switching.
|The first few cycle has come noise distorting the 230Vac 50Hz. The subsequence cycle shown on the photo, has less and less distortion.|
|Less and less distortion.|
a very very short time after the triac switch is activated, the output
reaches a steady state and there are no more distortion.
Note that the oscilloscope reading is not 650Vp-p as expected. This is because of the voltage divider stage used for the measurement. In order to obtain the effective voltage measure, I need to multiple the result by 2 times.
|The enlarge version of the 230Vac, measuring 650Vp-p.|
Manufacturer for Triac, Thyristor/SCR components
References from other website:
Triac component part number
Click here for Triac Selection Chart.
(BTA A means isolated tab, BTB B means non isolated tab, 12 means conduct up to 12A rating)
Please click the hyperlinks for the datasheet.
of a simple dimmer circuit for 230Vac lighting buib
Click the picture to enlarge.
Example of a 230Vac adjustable water heater circuit for shower bath
|The schematic on the left is taken from a 230Vac instant water heater circuit for our shower bath. The circuit is actually very similar to the dimmer for lighting bulb. Two diode is observed, and I believe these might be there due to the inductive load. It is just my guess. Other than that, it is just like the circuit above. The triac used is quite big, which is mounted to the heater copper casing.|
of a AC Motor (230Vac) speed controller circuit
|This is a circuit that can control the speed of an AC motor. The adjustable speed resemble again, the dimmer AC circuit that is presented earlier.|
|Other traic circuits
On the left are three recommended schematic that I have extracted from one of the opto-triac datasheet. The example clearly shows the minor difference for various type of triac & load.
The circuit (figure 6) for resistive load RL is the simplest, requiring only a 180Ω. The circuit (figure 7) for inductive load consist of additional resistor and capacitor. The additional capacitor is perhaps to balance the inductive load.
Figure 8 using a less sensitive triac to control the inductive load, hence the resistor is reduce from 2.4kΩ to 1.2kΩ, providing more current to drive the triac.
The capacitor 0.1uF, 0.2uF that feedback to the incoming voltage is known as the snubber circuit. It is there to protect the triac and other semiconductor device from the high voltage generated from an inductive load. The feedback may cause some problem for non-inductive load. The small leakage can be significant enough to turn on small load (for example, 230Vac lamp indicator). You will need to modify the circuit to prevent the leakage.
More information on snubber circuit are as follows,
Low voltage digital input to control 230Vac relay
The circuit examples on the left illustrate my testing, interfacing a low digital voltage to a triggered AC relay. The digital input allows 1.8V, 3.3V to 5.0V (min 5mA) which will be applied to the opto-triac. The opto-triac will switch the high 230Vac voltage should trigger the AC relay.
Circuit 1 is my first attempt of using the opto-triac to trigger the relay. However upon activation, the relay is observed to be chattering/vibrating on/off very fast. It seems to be virbrating at a rate of the AC power 50Hz. I am surprised about the behavior of this AC relay, thinking that a 230Vac should hold the relay still. Assuming that opto-triac might be causing the problem, I apply the 230Vac directly to the coil of the AC relay. The same relay chattering is observed. This means that the use of opto-triac in this design should be working properly. I might have to design a diode bridge and a capacitor to the hold the relay. This AC relay behaves very much like a dc relay.
Circuit 2 is my next few attempt to find out the effect of a capacitor in series to the AC coil. I was thinking that the capacitive acting as a resistance to the AC current might weaker the power, and relay trigger would fail; since the relay is a 230Vac relay. To my surprised, not only it can trigger the relay, the relay is able to hold the contact switch. This means that my interface would be simpler.
Circuit 3, I attempt to insert a 470Ω resistor to weaker the power, but it still works.
Circuit 4, I attempt to insert a 1k Ω 1/4W resistor. It still works.
Solid state relay circuit example using triac (taken from other website)
Singapore Customized, custom made Electronics Circuits & Kits
|8. MEMs relay||
MEMs relay. This is still under development at this point in time when this article is written. Got to know about this new device while I was researching for materials on the topic presented on this page. The MEMs relay has all the attractive properties found on various relay solution in the current market. It could be the next popular component in near future. You may like to learn more about it through this link.
Keyword: Solid State Relay, Mechanical Relay, Reed Relay, Opto-coupler, PCB mount, DIL Rail mount, Electronic Electrical controlled Switch,
thyristor, SCR, triacs, solid-state, semiconductor relay, DC SDR, AC SSR, diac
Crydom Solid State Relay
IRF International Rectifier
Maxim, Dallas Semiconductor