banner bristolwatch.com

Using Hall Effect Switches and Sensors

by Lewis Loflin

Hall effect sensors are solid state magnetic devices used as either magnetic switches or to measure magnetic fields. There are three basic types I'm concerned with here: The Hall effect switch, the Hall effect latch, and the ratiometric or analog sensor. For more on the general operation see my You Tube video above. Here I'm concerned with illustrating various electronic circuits and how to connect the sensors and use them.

A Hall effect switch will turn on in the presence of south magnetic field on its face or north magnetic field on the opposite side. It will turn off when the magnet is removed.

A Hall effect latch works like a switch, but will stay on when the magnet is removed. It will turn off if the north pole is applied to the face or the power is turned off.

A ratiometric Hall effect sensor outputs an analog voltage proportional to the magnetic field intensity. The devices I will use on a separate page are unipolar and in general with no magnetic field applied the output is one-half the supply voltage. The voltage will increase with the south magnetic pole on the face or decrease with the north magnetic pole on the face.

See Using Ratiometric Hall Effect Sensors

Hall Effect switch

Pictured above are typical pin outs on three lead Hall sensors. The south pole of the magnet goes towards the 'face' turning the device on. The north pole on the face will have no effect unless the device is a latch, which it will turn off if it's already on.

Considering Magnets

The magnetic field typically produced by rare-earth magnets can be in excess of 1.4 teslas, whereas ferrite or ceramic magnets typically exhibit fields of 0.5 to 1 tesla. The Tesla is named in honor of the inventor, physicist, and electrical engineer Nikola Tesla. A smaller magnetic field unit is the Gauss (1 Tesla = 10,000 Gauss):

10-9 - 10-8 gauss: the human brain magnetic field;
0.31-0.58 gauss: the Earth's magnetic field on its surface;
25 gauss: the Earth's magnetic field in its core;
50 gauss: a typical refrigerator magnet;
100 gauss: a small iron magnet;
2000 gauss: a small neodymium-iron-boron (NIB) magnet;
15,000-30,000 gauss: a medical magnetic resonance imaging electromagnet.

Above ref. Wiki. To find out more about rare earth magnets in general visit www.rare-earth-magnets.com. Magnets can be stacked (N to S) to form a more powerful magnet.

Let's consider a UGN3013T five volt Hall effect switch. To trip the switch on requires typically 500 gauss to a max of 750 gauss. But to release or cut off is a typical 225 gauss to as low as 110 gauss. So we have a reasonable range of 275 that we need to stay in for reliable operation. So it's obvious even a small iron magnet may work well or has to be very close to the sensor. Note this is an old obsolete part I just happened to have. Newer units are much more sensitive.

We can also use electromagnets.

digital Hall Effect switch

Pictured above is a basic Hall effect switch. It consists of a Hall effect plate, amplifier, Schmidt trigger, and open-drain field effect transistor. (FET) The Hall effect plate produces a very small output that must be amplified, the Schmidt trigger will turn on when the amplifier output reaches a certain level, which will then turn on the FET.

The FET is an electronic switch much like a mechanical light switch. When "ON" it completes the path to ground switching on an external device connected to positive VCC. A Hall Effect latch only differs in having some additional latching circuitry.

When on uses the turn "HIGH" we men the FET is turned off breaking the path to ground. The voltage on the drain will climb to VCC. When we say "LOW" the FET is turned on it will "sink" the current to ground and the voltage on the drain goes to zero. This is true of almost all modern digital circuits.

For more on the concept of sink/source see Basic Transistor Driver Circuits for Micro-Controllers

Hall Switch connected to LED

Pictured above is a Hall effect switch connected to a light emitting diode. (LED) In the off condition TP2 will be "HIGH" or 5 volts measured relative to ground. The LED will be off. When switched on by a magnet TP2 will measure about .5 volts and the LED will be on.

This can be directly connected to the input port of a micro-controller or other 5-volt digital logic.

The problem with the above circuit is that a Hall sensor is a low power device that can sink about 20 mA. Now we will look at a number of simple circuits to boost the power output of the device.

Hall switch with 7406

In the example above we used 1/6 of a 7406 HEX inverter to drive an N-channel MOSFET such as the IRF630. With the Hall effect switch (U3) off, TP1 is five volts, TP2 is 0 volts, and TP3 is 12 volts with the lamp off.

Apply magnet:
TP1 = 0 volts;
TP2 = 12 volts;
TP3 = 0 volts and lamp is on.
R1 is 4.7k and R2 is 10k.

To use a 12-volt Hall effect switch or a latch such as a SS466 from Honeywell, change the 7406 to a 74C906 and R1 to 10k. Note the IRF630 is an enhancement mode MOSFET.

Hall switch with an n-channel MOSFET

In the above example we used a N-channel depletion mode MOSFET. When U4 is off, TP4 and TP5 each = 12 volts and the lamp is off. When a magnet switches U4 on TP4 and TP5 both go to 0 volts and the lamp is on.

Hall switch with relay

Voltage Isolation

In the above sample circuit we use a 5-volt Hall switch to operate a 24-volt relay circuit to operate a high-voltage AC circuit. All of the voltages are electrically isolated from each other and even the common ground between the 5 and 24 volt supplies can be severed. With the Hall switch off we note the following meter readings:

TP1 = 5 volts;
TP2 = 24 volts;
indicator LED D3 is off;
relay K1 is de-energized, contacts open;
the voltage across K1's contacts is 120 VAC;
and lamp B1 is off.

When Hall switch U2 is turned on by a magnet:


TP1 = 0 volts;
TP2 = 0 volts;
indicator LED D3 is on;
relay K1 is energized, contacts close;
the voltage across K1's contacts is 0 VAC;
and lamp B1 is on.

R1 can be 330 ohms while R2 can be 1000 ohms. D2 is a general purpose silicon diode used for spike suppression when the relay coil is de-energized.

Hall switch with triac

In our final circuit we use a 5-volt Hall switch and a MOC30XX type opto-coupler to operate a high voltage triac circuit. When Hall switch U4 is turned on TP1 goes to zero volts and the lamp turns on. R1 is still 330 ohms and R4 is 180 ohms. Triac Q1 should be at least 200 volts.

This completes my introduction to Hall Effect switches. Our next section we will look into ratiometric sensors, circuits, and uses. From there we will connect a Hall sensor to a micro-controller.

Hall effect switch with CD4027

As shown above a simple Hall Effect switch can be made into a latch by using a CD4027 dual JK flip-flop. Whenever a magnet pulls the output of the Hall switch low then moves away this creates a high-to-low transition which toggles the two Q outputs. Repeating the process reverses the process.

To purchase Hall sensors or explore the many varied types of sensors see www.allegromicro.com.