HOME > > ELECTRONICS MAIN PAGE    

Reed Switches / Hall Effect Sensors

Anyone "seen" my magnet? (Passing by...)

This page introduces reed switches and Hall effect sensors to hobbyists, etc. It concentrates on how they can be useful in low voltage digital circuits.

The first (?) contactless technology

I'd be the first to agree that RFID systems are very cool... that's why I made my RFID operated front door locking system. And then there are systems to send commands via infra-red (IR) light beams.

However, wonderful though they are, those weren't our first contactless technologies. Okay, what you can do with the precursor is limited... but it is still useful.

Before RFID and IR, we had magnetic fields.

When a magnet is brought close to either a reed switch or a Hall effect sensor, the switch changes or the sensor's properties change. As far as I know, although there are probably esoteric exceptions to the rule, both types of switches are single pole, single throw devices. I'm going to discuss both as if they were normally open, although I imagine normally closed versions are available. (And one of the two main types of Hall effect sensor doesn't operate on an "on or off" basis.

Reed Switch

A reed switch is a humble little thing, but it does its job exceedingly well.

It consists of two small metal blades sealed in a glass ampoule. Bring a magnet near, and the blades are pulled together, completing the circuit. Move the magnet away, and they separate again, opening the circuit.

photo of reed switch

Reed switches come in various sizes... I've seen them as small as about a centimeter and as large as 5cm.

Reed switches are waterproof, dustproof, reliable. They don't get hot. They are unaffected by bright light. They are even inexpensive. I use cheap ones in my anemometers (I have two), and have to replace the reed switch from time to time... perhaps after three years?

... and easy to underestimate! A moment ago I said they were reliable, and then I said I had to replace the one in my anemometer after three years. Consider that the switch opens an closes each time the wind driven little triangle of cups spins around, and that's a lot of operations. (In the past 24 hours, the reed switch in the anemometer on the roof where I am writing this has opened and closed about 25,000 times... and it hasn't been a particularly windy period! 25,000 x 365 x 3...)

If your reed switch isn't "sensitive" enough, consider replacing the magnet you are using to activate it. The new high strength magnets are not very expensive, and they are strong.

It is also worth experimenting with where the magnet passes over the reed switch, and how the axes of the two relate to one another. With some of my magnet/ reed switch combinations, the magnet is most effective if it passes over the end of the reed switch, which surprised me...but I'm not to proud to use something surprising, as long as it works!

One design consideration which may be relevant to your design is the current carrying capacity of a given switch. If you are, say, working with 5v DEC, and are merely using the reed switch to pull a microprocessor input low against a pull up resistor, or high against a pull down resistor, then the current will be negligible, and almost any reed switch will do... find a cheap one!

Want to know more?? Start "playing" with them... or go to Wikipedia's reed switches article.

Hall Effect Sensors

Obviously, they come in a variety of packages, but the ones I am familiar with look like transistors: A blob of plastic with three parallel legs. They also come in tiny SMT packages.

photo of Hall effect sensor

Hall effect sensors come in two broad types.

In each type, there will be three connections to make...

(Vcc and Ground are just connected to "positive" and "negative" (or "zero volts") points in your circuit.)

The output:

With a "basic" Hall effect sensor, the voltage you could measure or use coming from the output will be proportional to the strength of the magnetic field the device finds itself in. One example (8/11) is the Jameco part 1915931. They provide a datasheet for this analog output Hall effect sensor. The sensor costs $2.89 (8/11). ModernDevice also sell an analog (or linear) Hall effect sensor, the Allegro A1321. Cost $2.60.

The "fancier" Hall effect devices, which are very common, have some extra electronics in the chip. This extra electronics will at least ensure that the output is either a digital "high" or a digital "low". Hence these devices may be called Hall effect switches.

There are also "fancy fancy" Hall effect switches. They have a latching function built into them. Sparkfun.com sells the US1881 (for 95 cents), which is an example of a latching Hall effect switch.

You may have thought it would be just like a reed switch, just with no moving parts. Not so.

Bring the south pole of a magnet up to the face of the a "fancy fancy" Hall effect switch, and the output will go high and stay high until the north pole of a magnet is detected. Only then does the output go low, and it will stay low even if the magnet is taken away. It only goes high again when the south pole is again detected.

The easy way to achieve north/ south/ north/ south... is to have the magnet attached to a shaft such that it rotates in front of the Hall sensor.

With Hall effect sensors, you need to choose the right type for your needs and for the other things you have in your design. You have to choose one which will accept the Vcc you have available. Arduinos have A-to-D converters, so the simple Hall effect sensor may be attractive, especially if you care about how close the magnet is. Usually, though, I suspect you just want to know if the magnet is present or not, in which case using one of the "fancy" switches will make your system operate more reliably, for all of the usual reasons which make digital designs robust.

Speaking of "robust".. if you have a sensitive Hall effect sensor, and subject it to particularly strong magnets, you can damage it.

A detail: Many of the devices have Schmitt triggers built into them. Schmitt triggers are useful things which help avoid "chattering" when a sensor is near it's trip point.

A special use

Suppose you want to know if current is flowing in a particular wire, and you want to know without "connecting" anything. I haven't tried it, but I'm told that if you form a stretch of that wire into a coil, and put an analog Hall effect sensor in the coil, the stronger the current, the more the Hall effect sensor will react. You may find this only works with DC current. I suspect it might not with an AC current, or that at least it will work better with DC.

Further reading...

The Sparkfun page recommended a Bildr Blog Bit aBout Hall effect devices to me, which was one of the sources of the above tutorial. The Bildr Blog has more information. Go visit them anyway, if only for more wit like the idea at the bottom of the blog...

Use the latching ones, get like hundreds of them, and place them with LEDs under a resin floor. Put north facing magnets on your shoes, and south on other people's shoes and see when you have walked, but others have not! Yeah, it's late....

Let the magnetism commence!

I hope that helped? Do please write in and tell me if bits were unclear, or you would like more help with reed switches or Hall effect devices.



   Search this site                 powered by FreeFind
 
Site Map    What's New    Search


Ad from page's editor: Yes.. I do enjoy compiling these things for you... hope they are helpful. However.. this doesn't pay my bills!!! If you find this stuff useful, (and you run an MS-DOS or Windows PC) please visit my freeware and shareware page, Sheepdog Software (tm), download something, and circulate it for me? At least (please) send an 'I liked the parallel port use page, and I'm from (country/ state)' email? (No... I don't do spam.) Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.

Don't forget to check out the programs for controlling the state of the parallel port at my shareware site. There are two free programs there... one for toggling bits, the other for using the computer as a timer via the parallel port.


Here is how you can contact this page's editor.
Click here to go up to general page about electronics by editor of this page.
Click here to go up to general page about electronic projects by editor of this page.
Why does this page have a script that loads a tiny graphic? I have my web traffic monitored for me by eXTReMe tracker. They offer a free tracker. If you want to try it, check out eXTReMe's site. The Google panels and the search panel are also script based.

Valid HTML 4.01 Transitional Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org


....... P a g e . . . E n d s .....