Category Archives: Switches

Hall Effect Sensors for Position Selection

User systems often require the detection of position for operating in a specific switch mode. Such type of On or Off functionality is a straightforward requirement and many devices implement it with Hall-effect switches, including power tools, light switches, safety harnesses, and laptop lids.

The output of the sensor toggles its state as soon as the input magnetic field crosses the operating threshold. Likewise, the output reverts to the idle state when the magnitude of the magnetic field reduces below the release threshold. Hysteresis built into the device prevents the output from toggling rapidly where the magnitude of the magnetic field is close to the operating threshold.

Many applications use this functionality. For typical cases, two output states are adequate, thereby helping to reduce mechanical wear and preventing interference from grease and dust.

Although two positions may be adequate for detection in many applications, others require the detection of additional states. For instance, a tool may require a three-position power switch, denoting Off, Low, and High power modes. Detecting all three states is difficult using a single sensor. Initially, it may seem possible by adding a sensor for every switch position in the system.

A unipolar switch is well-suited for such an application. The designer places the magnet very close—so the air gap is small—thereby ensuring the pole of the magnet facing the sensor will always exceed the worst-case operating point. When the magnet is above the sensor, it results in an upwardly directed field vector. When the magnet has traveled greater than its own width, the sensor will not activate, as the direction of the field is now downwardly directed. Therefore, there can be an array of sensors representing any number of positions, provided the sensor spacing exceeds the full width of the magnet.

While the above arrangement is convenient for a low number of positions, the number of components required gets more difficult to manage as the number of positions increases. For such arrangements, dual-unipolar switches are more convenient.

Texas Instruments offers a dual-unipolar switch, DRV5032DU. It has two independently operating outputs. Each output is sensitive to an opposite polarity of the magnetic field. Where one sensor responds as it nears a North pole, the other will respond as it nears a South pole. This functionality allows the detection of three positions with a single magnet.

With the magnet mid-way between the two sensors, there is no component of the magnetic field available to activate the sensors, and therefore, both sensors remain deactivated. When the magnet moves to the left, it activates the N pole-sensitive output. Likewise, when the magnet moves to the right, the S pole-sensitive output activates. However, for this arrangement to function correctly, the magnet must have a length two times the distance of travel between the switch positions. When the magnet moves by one-half its length, one of its poles is directly above the sensor, thereby activating it.

Extending this format makes it possible to sense more than three positions. It requires an array of sensors spaced appropriately for creating additional unique positions.

Switches & Latches Based on Hall Effect

Switches and latches based on the Hall effect compare magnetic fields. More correctly, they compare the B-field, or the magnetic flux density with a pre-specified threshold, giving out the comparison result as a single-bit digital value. It is possible to have four categories of digital or on/off Hall sensors—unipolar switches, omnipolar switches, bipolar switches, and latches.

Each of the above switches/latches has a unique transfer function. However, this depends on an important concept—the polarity of the magnetic flux density. The polarity of the B-field makes the Hall effect devices directional. Moreover, it is sensitive only to that component of the magnetic flux density that happens to be along its sensitivity axis.

When a component of the magnetic field applied to a device is in the direction of its sensitivity axis, the magnetic flux density is positive. However, if the component is in the opposite direction of the sensitivity axis, the polarity of the -field is negative at the sensor.

Hall sensor manufacturers follow another convention for the B-field polarity. They consider the magnetic field from the south pole of a magnet as positive, while that from the north pole, as negative. They base their assumption on the branded face of the sensor facing the magnet. The branded face of the Hall sensor is the front surface bearing the device part number.

Therefore, for a sensor with a SOT23 package, the sensitivity axis is perpendicular to the PCB. Whereas for a sensor with a TO-92 package, the sensitivity axis will be parallel to the PCB, provided the sensor is upright after soldering.

A unipolar switch has its thresholds in the positive region of the B-field axis. Its output state changes only when the south pole of a magnet comes near it. Bringing the north pole or a negative field close to the sensor produces no effect, hence the name unipolar.

When the sensor is off, its output is logic high. Gradually bringing a south-pole closer to the sensor causes the device to switch to a logic low as the magnetic field crosses its threshold. The opposite happens when the south pole gradually moves away from the sensor. However, as the threshold of switching for a decreasing magnetic field is different from the threshold of switching for an increasing magnetic field, the device shows a hysteresis effect. Manufacturers create this hysteresis deliberately to allow the sensor to avoid jitter.

An omnipolar switch responds to both—a strong positive field and a strong negative field. As soon as the magnitude of the magnetic field crosses the sensor’s threshold, it changes state. With omnipolar switches, the magnitude of the operating point is the same irrespective of the polarity of the B-field. However, the magnitude of the release point is different from the operating point, but the same for both polarities. Hence, the omnipolar switch also has a hysteresis effect.

A latch device turns on by an adequately large positive field but turns off only by an adequately large negative field. A bipolar switch behaves as a latch device, but its exact threshold values may change from device to device.

What are Reed Switches?

A modern factory will have several electronic devices working, and most of them will have several sensors. Typically, these sensors connect to the devices using wires. The wires provide the sensor with a supply voltage, a ground connection, and the signal output. The application of power allows the sensor to function properly, whether the sensor is sensing the presence of a ferromagnetic metal nearby, or it is sending out a beam of light as a part of the security system. On the other hand, simple mechanical switches, like reed switches, require only two wires to trigger the sensors. These switches need magnetic fields to activate.

The reed switch was born and patented at the Bell Telephone Laboratories. The basic reed switch looks like a small glass capsule that has two protruding wires. Inside the capsule, the wires connect to two ferromagnetic blades with only a few microns separating them. If a magnet happens to approach the switch, the two blades attract each other, making a connection for electricity to flow through them. This is the NO type of reed switch, and it is a normally open circuit until a magnet approaches it. There is another type of reed switch, the NC type, and it has one blade as a non-ferromagnetic type. This switch is a normally closed type, allowing electric current to flow until a magnet approaches it. The approaching magnet makes the blades pull apart, breaking the contact.

Manufacturers use a variety of metals to construct the contacts. This includes rhodium and tungsten. Some switches also use mercury, but the switch must remain in a proper orientation for switching. The glass envelope typically has an inert atmosphere inside—commonly nitrogen—to seal the contacts at one atmospheric pressure. Sealing with an inert atmosphere ensures the contacts remain isolated,  prevents corrosion, and quenches sparks that might result from current interruption due to contact movement.

Although there are solid state Hall effect sensors for detecting magnetic fields, the reed switch has its own advantages that are necessary for some applications. One of them is the superior electrical isolation that reed switches offer compared to what Hall effect sensors do. Moreover, the electrical resistance introduced is much lower for reed switches. Furthermore, reed switches are comfortable working with a range of voltages, variable loads, and frequencies, as they function simply as a switch to connect or disconnect two wires. On the other hand, Hall switches require supporting circuitry to function, which reed switches do not.

For a mechanical switch, reed switches have incredibly high reliability—they typically function for billions of cycles before failing. Moreover, because of their sealed construction, reed switches can function even in explosive environments, where a single spark could generate disastrous results. Although reed switches are older technology, they are far from obsolete. Reed switches are now available in surface mount technology for mounting on boards with automated pick-and-place machinery.

The functioning of reed switches does not require a permanent magnet to actuate them. Even electromagnets can turn them on. Initially, Bell labs used these switches abundantly in their telephone systems, until they changed over to digital electronics.

What are Tactile Switches?

Tactile switches are electromechanical switches that make or break an electrical circuit with the help of manual actuation. In the 1980s, tactile switches were screen-printed or membrane switches that keypads and keyboards used extensively. Later versions offered switches with metal domes for improved feedback, enhanced longevity, and robust actuation. Today, a wide range of commercial and consumer applications use tactile switches extensively.

The presence of the metal dome in tactile switches provides a perceptible click sound, also known as a haptic bump, with the application of pressure. This is an indication that the switch has operated successfully. As tactile switches are momentary action devices, removal of the applied pressure releases the switch immediately, causing the current flow to be cut off.

Although most tactile switches are available as normally open devices, there are normally closed versions also in the market. In the latter model, the application of pressure causes the current flow to turn off and the release of pressure allows the current flow to resume.

Mixing up the names and functions of tactile and pushbutton switches is quite common, as their operation is somewhat similar. However, pushbutton switches have the traditional switch contact mechanism inside, whereas tactile switches use the membrane switch type contacts.

Their construction makes most pushbutton switches operate in momentary action. On the other hand, all tactile switches are momentary, much smaller than pushbutton switches, and generally offer lower voltage and current ratings. Compared to pushbutton switches, the haptic or audible feedback of tactile switches is another key differentiator from pushbutton switches. While it is possible to have pushbutton switches in PCB or panel mounting styles, the design of tactile switches allows only direct PCB mounting.

Comparing the construction of tactile switches with those of other mechanical switches shows a key area of difference, leading to the tactile switches being simple and robust. This difference is in the limited number of internal components that allows a tactile switch to achieve its intended function. In fact, a typical tactile switch has only four parts.

A molded resin base holds the terminals and contacts for connecting the switch to the printed circuit board.

A metallic contact dome with an arched shape fits into the base. It reverses its shape with the application of pressure and returns to its arched shape with the removal of pressure. This flexing process causes the audible sound or haptic click. At the same time, the dome also connects two fixed contacts in the base for the completion of the circuit. On removal of the force, the contact dome springs back to its original shape, thereby disconnecting the contacts. As the material for both the contacts and the dome are metal, they determine the haptic feel and the sound the switch makes.

A plunger directly above the metallic contact dome is the component the user presses to flex the dome and activate the switch. The plunger is either flat or a raised part.

The top cover, above the plunger, protects the switch’s internal mechanism from dust and water ingress. Depending on the intended function, the top cover can be metallic or other material. It also protects the switch from static discharge.

What is a Thermal Switch?

Future spacecraft carrying humans require thermal management systems with high turn-down capabilities. In widely varying thermal environments, thermal switches can dissipate a wide range of heat loads. Thermal switches are electromechanical on/off switches, and they are thermally actuated. In contrast with thermal fuses, thermal switches are reusable. They are well suited for protection against common temporary thermal situations, that the user can correct.

A temperature differential activates a thermal switch. When activated, the state of the switch changes over from either normally open to closed or normally closed to open. The movement of the contacts can generate a faint audible noise, as they interrupt the power to an electrical circuit. 

Applications of thermal switches include preventing damage from over-heating of electrical circuits. However, these switches may also be useful as temperature control devices, such as in water heaters. The switches are helpful in preventing overheating in various consumer, industrial, and commercial products. In practice, they control the power to circuitry in electric motors, power supplies, lighting fixtures, transformers, ballasts, and battery packs. When controlling temperature, these switches are useful in electronic cooling fans, heat pumps, low voltage relays, or gas furnaces operated by a solenoid valve.

Several types of thermal switches are available. These include bi-metallic disc or snap action, mercury switches, thermal reed switches, rod and tube switches, vapor-tension switches, and gas-activated switches.

The snap action or bi-metallic disc switches operate based on the phenomenon of thermal expansion. The switch has two dissimilar metals that expand at different rates. As the temperature reaches the threshold, the snap action of the discs forces the switch to activate.

In mercury switches, the contacts are sealed within a glass envelope containing a small amount of mercury. At temperatures above 40 ℃, mercury is always in a liquid state. As mercury is also a good conductor, it can make or break the contacts based on the angle of inclination. Typically mounted on a metal coil, the switch activates with thermal expansion that causes the coil to tilt.

Thermal reed switches have a pair of contacts on ferrous metal reeds inside a hermetically sealed glass tube. As the metal reeds are ferrous, a magnetic field can activate them. The switch can have either normally open or normally closed contacts, kept in that state by a ferromagnetic material surrounding the glass tube. As temperature rises and reaches the curie point of the ferromagnetic material, it loses its magnetic strength, and this alters the state of the contacts.

Rod and tube thermal switches are made of an outer tube surrounding an internal rod, both made of metals with dissimilar coefficients of thermal expansion. When the temperature rises, the rod expands faster than the tube can, and induces a plunger-style contact. Rod and tube thermal switches have rapid response times and can operate at high temperatures.

Vapor tension or gas-activated thermal switches use a sensing bulb with a gas or vapor inside. As temperature rises, the thermal expansion of the vapor or gas leads to a proportional pressure increase on a piston assembly or a diaphragm, actuating an electrical switching system.

Two-Phase Thermal Switches

Spacecrafts frequently make use of a wide range of variable conductance devices for thermal management. These devices, also known as thermal switches, help to maintain the temperature of heat sources that operate under varying thermal environments and thermal loads within a spacecraft. Many such applications are already operating in Lunar and Mars landers and rovers, and in satellites. Being highly reliable, scientists may be using thermal switches in the future for human spacecraft transiting through space.

Two-phase thermal switches are low-mass, and they meet the above requirements very well. The temperature of the heat source passively triggers the switching mechanism. The operation of thermal switches is similar to the functioning of a heat pipe with flexible walls.

A two-phase thermal switch consists of a hermetic enclosure housing sealed metallic bellows. The bellows have one of its ends fixed to the enclosure, which, in turn, is in contact with the heat source. Within the bellows, there is a wick structure along with a small amount of saturated working fluid.

The heat from the source enters the enclosure and the bellows, heating the working fluid. The heat vaporizes the fluid, increasing the saturated vapor pressure inside the bellows. The increasing pressure causes the bellows to expand until it makes contact with the other end of the enclosure, which is in contact with a heat sink.

The temperature of the saturated vapor that causes the pressure at which the bellows makes contact with the heat sink end of the enclosure, is the setpoint temperature of the two-phase thermal switch. The design of the two-phase thermal switch determines its setpoint temperature. One of the components deciding the set point temperature is the gas pressure within the enclosure, as it opposes the expansion of the bellows. Users can remotely adjust the set point temperature of a two-phase thermal switch by changing this counter pressure. The switch maintains the heat source at its set-point temperature as the heat sink conducts heat away from the enclosure.

As the name suggests, a two-phase thermal switch operates in two phases. The first phase is similar to a conventional thermal switch. The device switches from a low conductance state to a high conductance state and back as the heat source supplies heat or removes it.

The second phase of the switch comes into effect during its high conductance state. In this condition, the device also operates as a variable conductance device for maintaining the heat source at its set-point temperature. The design of the device allows it to maintain the temperature of the heat source at the set point while the heat sink temperature varies wildly. The variable conductance is a result of the dynamic motion of the bellows as it oscillates and periodically connects with the heat sink.

Two-phase thermal switches are capable of dissipating a wide range of heat loads during widely ranging thermal environments. Their low mass, simple design, low cost, and higher on to off conductance ratios are positive factors in spacecraft applications. At high temperatures of the heat source, the bellows may not disconnect from the sink, essentially acting as a heat pipe.

What is a DIP Switch?

DIP or Dual-In-line-Package switches have been popular since the 1970s. OEMs and end-users use them widely to change the functionality of electronic devices at the point of use. For instance, DIP switches allow users to set region codes for equipment to make them work in different areas, to change to a specific radio channel, which garage door the opener will engage, or to select the type of memory a PC motherboard has.

The DIP switch comprises a set of switches within a single unit, typically mounted on a PCB. Each switch is very basic in construction and functionality. The user must set each switch manually, and therefore, the user can simply determine the status by viewing the switch bank during system startup. This is in direct contrast to a membrane keypad connected to a microcontroller, which must be powered up and polled to know the status. Therefore, DIP switches have the simplicity and provide input to basic system firmware, and need not be powered up to know their current status.

Users can select the number of operations on their DIP switch depending on the configuration of the electronic application. This is possible as DIP switches are available in a variety of sizes, configurations, power ratings, and styles.

Just like any other switch, users can select from the number of poles and throws the DIP switch must-have. For instance, they can use the SPST switch or single pole single throw switch, as it has a two-terminal option, with the pole either engaging with the throw to enable continuity or disengaging with the throw to enable electrical isolation.

Likewise, there are SPDT switches or single pole double throw switches, where the user may push the single pole to engage with any one of the throws, and push it the other way to engage with the other throw. It is possible to direct any signal on the pole to either one of the throws at any time.

Other switches are available as a combination of the above SPST and SPDT arrangements. For instance, there may be mechanically linked double poles engaging with double throws, making the switch DPDT or double pole double throw type.

Typically, the number of switches in a package is dependent on the application, with 1 to 16 positions being a common number. For instance, a common DIP switch package may have eight positions, allowing it to be set to 256 different ways. This is equivalent to the 256 binary values that an eight-bit byte may express.

Mechanically, DIP switches are available in various types, depending on the way they operate, whether they have slide actuators, rotary actuators, piano actuators, and so on.

DIP switches with slide actuators usually have two positions, either closed or open, acting as an SPST switch. However, there can be DIP switches with slide actuators and three positions. Frequently, in such switches, the middle position acts as the neutral. As the actuator moves to either side, it makes contact with the position on that side.

DIP switches are low-cost, flexible, and provide a simplicity rarely found.

IoT and DIP Switches

Pre-configuring equipment helps in many ways. In the field, the ability to pre-configure functionality eases installation procedures, helps in diagnostics, and reduces downtime. DIP switches are very popular for pre-configuring devices and an increase in their demand is accelerating the flexibility in their design.

Although designers nowadays prefer to use re-programmable memories and software menus in equipment, DIP switches customizing the behavior of electronic devices was have always been present. DIP switches present an easy-to-use method for changing the functionality that anyone even without software knowledge can use. An added advantage of DIP switches over software menus is the former allows change even when the equipment has no power.

Engineers developed the DIP switch in the 1970s, and their usefulness remains relevant even after five decades, for instance, for changing the modality of a video game or for fine-tuning the operation of a machine on the shop floor. Now, engineers are finding new uses for this proven technology in innovative applications such as the IoT or Internet of Things.

Depending on present requirements, manufacturers now present a large variety of DIP switches for modern applications. It is now easy to find surface mount versions of DIP switches, with SPST or single pole single throw, SPDT or single pole double throw configurations, or multi-pole single and double throw options. Piano type side actuated DIP switches, side DIP switches, and DIP switches in sealed and unsealed versions are also available readily off the shelf.

Originally, DIP switches were a stack of manually operated electric switches available in a compact DIP or dual-in-line package with pins. The configuration of the pins of a DIP switch was the same as that of an IC with leads, which made it easy for a designer to incorporate in the printed circuit board. It was usual for each switch to have two rows of pins, one on each side. The distance between the rows was 0.3”, while the pitch or gap between adjacent pins was 0.1”. By taking advantage of the same mounting technique as that of an IC, the DIP switch provided a compact switching mechanism that designers could place directly on the PCB.

By stacking DIP switches side by side, the designer could add as many switches to the circuit as necessary. The versatility of the DIP switch lay in the numerous configurations achievable. For instance, it is possible to generate an incredible 256 combinations from an eight-position DIP switch. Each switch can assume one of two ways, and an eight switches combination can assume one of 256 ways (2 to the eight power).

Earlier, digital electronics mostly used eight bits to a byte, which made the eight-position DIP switch more of a standard at the time. With advancements, digital electronics now encompasses 8, 16, 32, 64, 128, and even 256 bits, generating a great demand for DIP switches with new designs.

DIP switches are easier for the user as they offer a visual indication of the present setup.  For manufacturers, DIP switches make it easier to customize their production, at the same time, allowing the user to make changes as necessary.

ATtiny Remote Power Switch for the Raspberry Pi

One of the shortcomings of most highly popular single board computers such as the Raspberry Pi (RBPi) is the lack of an on/off power switch. The board springs to life as soon as you insert the micro USB power cable into its socket. If you simply switch off power or pull out the micro USB cable off the RBPi, you stand the risk of not only losing data but also of corrupting the file system. Therefore, to shutdown the RBPi safely, you need to call a shutdown command, which closes down the file system and takes the RBPi into a safe state, allowing you to remove the USB cable.

The above has been the reason for several projects to incorporate a switch with the RBPi that will safely switch it off without corrupting the file system. Most of the projects incorporate a board sitting on the GPIO header of the RBPi along with a micro USB connector and a toggle switch to control the power supply for the RBPi. The entire control of the power supply comes from a tiny microcontroller on the add-on board, which monitors the state of the toggle switch and the RBPi. In turn, the microcontroller switches a MOSFET and an LED indicates the status of power. This also precludes the necessity of unplugging the RBPi from the power module after switch off.

This power switch from Nanomesher, using an Attiny85 microcontroller, adds a new dimension to controlling the RBPi—it has a remote that you can use to remotely control power to the RBPi. The entire arrangement comes as a kit, and you get a hack able and smart power switch for the RBPi that a removable Attiny85 microcontroller controls. There are also four jumper cables that allow the board to connect to the RBPi GPIO, a high quality micro USB cable 20 cm long, and an infrared remote control.

The project is hack able in the sense you can remove the ATtiny85 microcontroller and reprogram it to provide any type of functionality with the remote. Of course, reprogramming the ATtiny85 will require an Arduino-compatible platform such as the Uno. Other Arduino devices with switches are available, and you may already own some, or you may buy them for experimentation. The ATtiny requires wiring up with the Arduino on a breadboard for the programming.

You can use the included remote or any other remote already available with you. Since the kit is hack able and reprogrammable, you can make it recognize many more signals, changing the timings and functioning of the shutdown. For instance, you may add another button for a hard reset, and reprogram the Attiny85 to recognize it.

Although the kit does a fine job of shutting down the RBPi safely, the presence of the jumper wires to connect to the RBPi makes the kit somewhat cumbersome to use. The project would have been much more useful if the kit could be fitted onto the RBPi in the form of a HAT. Of course, the presence of jumpers does make the kit more flexible since one can select the GPIO pins for connection.

Using Reed Switches as Sensors

Any ordinary electrical switch has two contacts. Push-type switches are spring loaded so that pushing a button brings them together and they spring apart on releasing the button. Rocker switches have mechanical levers that close the contacts when in one position, while in the other position they pull apart.

In reed switches, the two contacts are in the shape of metal reeds, each coated with a metal that does not wear easily. The reeds are made from a ferromagnetic material, so they are easy to magnetize. The entire assembly is hermetically sealed within a thin glass envelope containing a nonreactive gas such as nitrogen. For extra protection, sometimes the glass envelope may have a plastic casing.

The ferromagnetic material making up the reeds is typically a nickel-iron alloy that shows high magnetic permeability but low magnetic retentivity. That means, when brought close to a magnet, it magnetizes the reeds, which come together in contact. On moving the switch away from the magnetic field, the reeds lose their magnetic property and separate. Their movement has high hysteresis, that is to say they close and open slowly and smoothly. The reeds have a flat area where they contact each other, and this helps to extend the life and reliability of the switch.

Although reed switches typically have two ferromagnetic contacts, some variants may have only one ferromagnetic contact, while the other is non-magnetic. Others may have three contacts, with two non-magnetic and the central one as ferromagnetic.

Like ordinary switches, reed switches also come as two major variants—normally open type and normally closed type. This refers to the position of the reeds when there is no magnetic influence on them. Therefore, the normally open type has its reeds separated from each other, and they close when a magnet is brought close enough. The normally closed type of reed switch has its reeds in contact with each other, and they move apart when a magnet is brought close enough.

As the magnet comes close to a normally open reed switch, the two contacts become magnetized as opposite magnetic poles, and they attract each other to close. In this position, the switch can pass an electric current. This magnetizing of the reeds is independent of the pole of the magnet coming close to them. As the magnet moves away, the reeds lose their magnetism, and their stiff and springy nature makes them spring apart in their original position.

Reed switches are very useful as sensors such as for sensing level of liquids. A sealed stem holds the reed switches at different heights. A float containing a permanent magnet rides on the stem, going up and down as the liquid level changes. When the float magnet comes close to one of the reed switches, it snaps close, changing its electrical status that any electronic circuit can sense. Automotive, marine, and industrial applications use reed switches for level sensing.

A float switch in a dishwasher controls the level of water in the machine. The shaft containing the reed switch is positioned at the water fill limit of the pan. As the water rises, so does a float containing the magnet. When the magnet comes close to the reed switch, it closes, and signals the ECU.