A battery-powered door sensor carries a reed switch on its BOM. Hand-soldering ten prototypes is effortless. The SMT line is a different story: the glass envelope will not survive reflow, so a secondary hand-placement station has to be added. Every added station costs yield, consistency, and assembly time. Meanwhile the field reports a second problem: units installed more than two years ago are starting to miss events.
Both symptoms trace back to the same part. A reed switch is inexpensive, needs no power, and is easy to explain, which makes it the comfortable choice at prototype scale. Move to volume production with a multi-year service life and its weaknesses in process, endurance, and consistency surface one after another. At that point most teams look at a Hall effect switch. The teams that get burned are the ones that treat the change as a part-number swap. A Hall switch is not a passive contact: it needs a supply rail, draws quiescent current, runs on a sampling schedule, and has magnetic thresholds.
This article is not about part-number correspondence. It covers what an engineer actually needs: the four circuit changes required when a reed switch is replaced by a Hall switch, and how to calculate each one.
The glass envelope does not survive reflow. A reed switch is a glass tube with two internal blades. The glass-to-metal seal is sensitive to thermal shock, so the part generally cannot be taped and run through a standard SMT line; it needs hand placement or a secondary operation. That translates directly into station cost and consistency risk.
The mechanical contact bounces, and it wears. Contact bounce on closure forces the firmware to debounce over milliseconds before one closure counts as one event. Repeated blade flexing also gives the part a finite mechanical life, which becomes the limiting factor in high-cycle applications such as jump-rope counters, impeller counting, and flip-cover detection.
Size and mounting attitude are unfriendly. Typical glass tubes run on the order of ten-plus millimeters in length, which is a lot of board area and installed height, and the part must hold a specific attitude relative to the magnet. The assembly tolerance window is narrow.
The threshold is expressed in different units. A reed switch is specified in ampere-turns (AT), a measure of magnetomotive force, and its operate point depends on how strongly the blades become magnetized — which in turn depends heavily on the relative position, angle, and overlap length between magnet and switch. Section 6 develops this point, because it is the change most often overlooked and the one most likely to bite.
One advantage deserves honest acknowledgement: a reed switch draws nothing while its contacts are open. That is the cost of moving to a Hall device, and section 5 is entirely about managing it.
A reed switch needs no power. A Hall switch does. This is the first item to settle at the schematic stage: give the Hall device a dedicated always-on rail.
The lower limit of that rail determines how far the battery can be discharged. In the HXY micropower omnipolar line, the supply floor comes in two grades:
• 1.8 to 5.5 V: H6520MI, H6523MI, H6527MI, H6022MI
• 2.5 to 5.5 V: H6524MI, H6531MI
On paper the difference is 0.7 V. In a product it is a real design decision. A CR2032 is nominally 3.0 V and falls toward 2.0 V at end of life; two series alkaline cells behave the same way. If the product has to work down to the last of the cell, a 2.5 V floor drops out of the operating region before the battery is finished and the output becomes unreliable. A single lithium cell (3.0 to 4.2 V) and a 5 V system are covered by either grade, and so is a regulated 3.3 V rail.
Stated as an ordering rule: draw the battery discharge curve first, fix the supply floor second, pick the part third. Do not run that sequence backwards.
Supply quality belongs in the same discussion. The Hall device contains chopper and sampling circuitry, and supply ripple couples into the magnetic threshold comparison; in marginal-sensitivity designs it shows up as the occasional missed event. The standard remedy is a decoupling capacitor placed close to the device between VCC and ground. When the Hall device and the MCU share an always-on rail, place that capacitor next to the Hall device rather than next to the MCU.
A reed switch is a passive contact. A normally-open type shorts when the magnet approaches, the MCU side uses a pull-up, and a low level means "magnet present." After moving to a Hall switch, three things need re-confirmation on the output side.
Output stage: push-pull or open drain. A push-pull output drives an MCU input directly and needs no pull-up; an open-drain output requires one. Among the HXY micropower parts discussed here, the H6520MI, H6523MI, H6524MI, H6531MI, and H6022MI are all push-pull, and only the H6527MI is open drain. Confirm this before laying out the schematic. Adding a pull-up to a push-pull output is not an error, but it is unnecessary; omitting the pull-up on an open-drain output means no signal at all.
Magnetic polarity: omnipolar or unipolar. Reed switch operation depends on field orientation, so a magnet installed backwards may never operate it. An omnipolar switch responds to either pole, so a reversed magnet still works — a genuine benefit in door sensors, flip covers, and any product where the magnet orientation is set by the installer or the end user. The H6520MI, H6523MI, H6524MI, H6531MI, and H6527MI are omnipolar. The H6022MI is a bipolar latch: its output switches on one pole and holds until an opposing field arrives, which suits bistable position sensing rather than simple proximity detection.
Logic polarity and interrupt edge. The Hall output flips when the field crosses the operate point and flips back when it falls below the release point. Firmware must confirm whether "magnet present" is a high or a low, and the external interrupt edge has to be set accordingly. There is a bonus here that is easy to miss: the Hall output is a clean semiconductor edge with no contact bounce, so the millisecond debounce delay written for the reed switch can be deleted. Event response gets faster and one source of timing ambiguity disappears.
This is the change with the largest cost attached, and the one that decides whether a battery-powered product is viable at all.
An open reed contact consumes nothing. A powered Hall device always consumes something. The micropower Hall architecture addresses this with internal low-frequency sampling: the device sleeps nearly all the time, wakes at a fixed rate to take one magnetic measurement, and returns to sleep immediately. The "operating frequency" in the product list is that sampling rate:
| Part | Sampling rate | Sampling interval | Suitable event type |
|---|---|---|---|
| H6520MI | 5 Hz | 200 ms | Door and window sensors, flip covers, liquid level, end-of-travel |
| H6523MI | 160 Hz | 6.25 ms | Jump-rope counting, proximity counting, low-speed rotation |
| H6524MI | 160 Hz | 6.25 ms | Same, with a 2.5 V supply floor |
| H6531MI | 175 Hz | 5.7 ms | Wake-up detection in instruments and portable equipment |
| H6022MI | 200 Hz | 5 ms | Bipolar latch for bistable position sensing |
| H6527MI | 5000 Hz | 0.2 ms | High-speed counting, rotation measurement |
The supply current listed in the product data represents the device during its sampling window; actual average current for a micropower part is far lower. The per-sample charge and the sleep current should be taken from the datasheet. One relationship, however, is solid: the sampling-related portion of average current scales approximately with the sampling rate. That makes the sampling rate the single variable to trade in this section.
The rule is simple. Set the sampling rate above the frequency of the event being detected — typically five to ten times — but no higher than the budget requires.
• Door sensors, flip covers, liquid level: human motion happens over hundreds of milliseconds, so 5 Hz (one sample every 200 ms) is generous
• Jump-rope counting, impeller counting, proximity counting: event periods of tens of milliseconds call for 160 to 200 Hz
• Rotation measurement and high-speed counting: millisecond event periods call for 5000 Hz
Worked example 1: deriving the sampling-rate budget from cell capacity.
A CR2032 is nominally about 225 mAh (a published cell figure; confirm against the specific cell datasheet). Target one year of shelf plus service life, or 8760 hours:
• Allowed average current = 225 mAh / 8760 h = 25.7 µA
• That budget is split three ways: Hall sensing, MCU sleep current, and supply plus I/O leakage
• If the MCU in deep sleep plus leakage accounts for 8 µA, only 17.7 µA remains for Hall sensing
• Translating to sampling rate: dropping from 160 Hz to 5 Hz shrinks the sampling-related average current by a factor of about 32; going the other way, from 5 Hz to 5000 Hz, inflates that same term by a factor of 1000
Whether a one-year service life is achievable therefore depends largely on one decision: specify the sampling rate that is sufficient, not the one that is simply available. If the application genuinely needs 5000 Hz, accept the higher average current and pay for it with a larger cell or a rechargeable architecture. The alternative — a continuously powered Hall device plus a timer-driven MCU that polls the GPIO — usually costs more, since waking the MCU typically consumes considerably more energy than one Hall sample.
Budget the latency at the same time. From field crossing the threshold to the MCU taking the interrupt, the total delay is the sampling period plus output propagation delay plus MCU wake-up time. At 5 Hz the delay can reach 200 ms, which is entirely acceptable for a door sensor; that same 200 ms applied to high-speed counting means missed counts.
This is the item most often skipped and the one most likely to fail at pilot build.
A reed switch threshold is specified in ampere-turns (AT), a measure of how strongly the blades are magnetized, and it is sensitive to the relative position, angle, and overlap length between magnet and switch. A Hall threshold is specified directly in magnetic flux density (gauss) and compares the field component perpendicular to the package sensing face. The units differ, so the original magnet position, magnet grade, and assembly tolerance cannot be carried over. They have to be recalculated.
For an axially magnetized cylindrical magnet, the flux density on the axis at a distance z from the magnet face is estimated by:
B(z) = (Br / 2) × [ (z + h) / √(R² + (z + h)²) − z / √(R² + z²) ]
where R is the magnet radius, h is the magnet thickness, lengths are in millimeters, and Br is the remanence in gauss.
Worked example 2: sizing the air gap with a common magnet.
Take an N35 NdFeB disc, 10 mm diameter (R = 5 mm) and 3 mm thick (h = 3 mm), with Br = 11700 Gs (the N35 nominal remanence is published material data; confirm against the magnet vendor‘s specification):
| Air gap z | B(z) | Margin vs 30 Gs operate point | Margin vs 20 Gs release point |
|---|---|---|---|
| 2 mm | 1964 Gs | 65.5× | 98.2× |
| 4 mm | 1106 Gs | 36.9× | 55.3× |
| 6 mm | 620 Gs | 20.7× | 31.0× |
| 8 mm | 365 Gs | 12.2× | 18.2× |
| 10 mm | 228 Gs | 7.6× | 11.4× |
| 12 mm | 150 Gs | 5.0× | 7.5× |
| 15 mm | 87 Gs | 2.9× | 4.3× |
| 20 mm | 41 Gs | 1.4× | 2.1× |
Reading that table against the H6520MI, H6523MI, and H6524MI with a 30 Gs operate point and a 20 Gs release point (the Bop/Brp symbol convention follows the datasheet):
• At a 12 mm gap the field is 150 Gs, giving 5.0× margin on the operate point and 7.5× on the release point — comfortable
• At 15 mm the field is 87 Gs, giving 2.9× and 4.3× — an area that warrants care
• At 20 mm the field is only 41 Gs, giving 1.4× on the operate point, where temperature drift and assembly tolerance together start to cause missed events
Engineering practice is to hold three to five times margin. Against a 20 Gs release point, that calls for a field of at least 60 to 100 Gs, which on the table above puts the practical air-gap ceiling at roughly 13 to 15 mm.
Two further observations fall out of the table. First, a Hall device generally tolerates a larger air gap than a reed switch, so the magnet can sit farther away or be made smaller, which buys mechanical freedom. Second, the strong magnet originally specified for a reed switch may be over-specified for a Hall device — confirm that it cannot trigger adjacent Hall devices or other magnetic sensors, particularly in equipment with several Hall parts mounted side by side.
There is a consistent trade among threshold grades: a lower threshold tolerates a larger gap but is correspondingly more exposed to stray-field triggering. The H6531MI operates at 35 Gs and releases at 20 Gs; the H6527MI operates at 30 Gs and releases at 18 Gs. The direction of the trade is the same.
Using a CR2032-powered door sensor as the example, the chain has five stages.
Magnetic circuit. A small magnet mounts on the frame and the Hall board mounts on the door, or the reverse. With the door closed the magnet faces the sensor at the air gap derived in section 6; when the door opens, the magnet moves away and the field falls below the release point.
Sensing. The H6523MI (SOT-23-3L, 1.8 to 5.5 V, omnipolar, push-pull output, 160 Hz sampling) hangs directly on the always-on rail with a decoupling capacitor close to VCC. Its output is push-pull, so no pull-up is needed. Where the trace from the Hall board to the main board is long, add a small series resistor and a capacitor to ground at the MCU to control edge ringing and coupled interference.
Control. The MCU stays in deep sleep throughout, with the Hall output connected to a wake-capable GPIO configured for a both-edges external interrupt. When the field crosses the threshold, the Hall output flips and the edge wakes the MCU.
Action. On wake-up the MCU confirms the state, applies whatever level check is needed, emits the event, and returns to sleep. The bounce handling written for the reed switch can be deleted outright.
Supply. The always-on rail comes from the cell directly or through a low-quiescent-current LDO. This stage has to be folded into the current budget from section 5 alongside the control stage.
Latency budget. From field crossing to MCU response: sampling period plus output propagation delay plus MCU wake-up time. At 160 Hz sampling the delay is on the order of 6.25 ms, ample for door and flip-cover use; for impeller counting, with event periods dropping to tens of milliseconds, 160 Hz still has room.
Where the H6523MI sits in this chain determines two practical outcomes: its 1.8 V supply floor lets a CR2032 or two alkaline cells be used down to end of discharge, and its push-pull output removes a pull-up resistor, saving one part and one leakage path. For slower events with a more aggressive life target, the 5 Hz H6520MI pushes average current lower still. For bistable position sensing — where the output holds after the magnet passes and releases only when the opposite pole arrives — the H6022MI bipolar latch applies, with a supply current of just 0.014 mA and the same 1.8 V floor.
| Part | Package | Output | Magnetic polarity | Supply | Temperature | Supply current | Output current | Operate / release | Sampling rate | ESD |
|---|---|---|---|---|---|---|---|---|---|---|
| H6520MI | SOT-23-3L | Push-pull | Omnipolar | 1.8~5.5 V | −40~85 °C | 5 mA | 5 mA | 30 / 20 Gs | 5 Hz | 6000 V |
| H6523MI | SOT-23-3L | Push-pull | Omnipolar | 1.8~5.5 V | −40~85 °C | 2.8 mA | 5 mA | 30 / 20 Gs | 160 Hz | 6000 V |
| H6524MI | SOT-23-3L | Push-pull | Omnipolar | 2.5~5.5 V | −40~85 °C | 2.8 mA | 3 mA | 30 / 20 Gs | 160 Hz | 6000 V |
| H6531MI | SOT-23-3L | Push-pull | Omnipolar | 2.5~5.5 V | −40~85 °C | 2400 nA | 5 mA | 35 / 20 Gs | 175 Hz | 6000 V |
| H6527MI | SOT-23-3L | Open drain | Omnipolar | 1.8~5.5 V | −40~125 °C | 2.5 mA | 5 mA | 30 / 18 Gs | 5000 Hz | 6000 V |
| H6022MI | SOT-23-3L | Push-pull | Bipolar / latch | 1.8~5.5 V | −40~125 °C | 0.014 mA | 5 mA | +25 / −25 Gs | 200 Hz | 6000 V |
Set the sampling rate before choosing the part. Sampling rate is the dominant variable in average current, and the gap between 5 Hz and 160 Hz is a factor of 32. In practice: measure the shortest period of the real mechanical event — high-speed video or a scope capture of one genuine actuation — take five to ten times that as the sampling rate, and do not spend the remaining margin.
The 1.8 V versus 2.5 V floor decides whether the cell can be used to end of discharge. Single lithium cells, CR2032, and two alkaline cells that discharge below 2.5 V need the 1.8 to 5.5 V grade (H6520MI, H6523MI, H6527MI, H6022MI). A 5 V system or a regulated 3.3 V rail can use either grade and choose on package, sampling rate, and current instead. Plotting the cell discharge curve and the device supply floor on the same graph is far more reliable than judging from memory.
Do not add a pull-up to a push-pull output. The H6520MI, H6523MI, H6524MI, H6531MI, and H6022MI are push-pull; connect them straight to the MCU input. Only open-drain parts such as the H6527MI need a pull-up, sized between the sink-current lower bound and the rise-time upper bound exactly as for any open-drain Hall device.
Design the air gap against the release point, not the operate point. The magnet approaching crosses the operate point first; it must fall below the release point before the output drops. The magnetic design has to keep the field at three to five times the release point under unfavorable conditions, or the output will latch on and stay there. Use the expression in section 6 to compute gap and magnet grade together rather than reusing the magnet position from the reed switch design.
Change the debounce logic and the sampling latency together. After dropping the reed switch, the contact-bounce delay in firmware can be removed — but the Hall sampling period introduces its own delay, and that delay belongs in the event timing budget, especially where several events must be ordered or paired.
The change is four design actions, not one part number. Supply, output, sampling, and magnetics each have to be carried through the schematic and the firmware. Skip any one and it surfaces at pilot build or in the field, and the Hall stage is rarely the first place anyone looks.
Replacing a reed switch with a Hall switch is four calculable tasks: provide an always-on rail with a supply floor the cell can live with, redraw the output and interrupt edge for a push-pull or open-drain stage, set the sampling rate from cell capacity and event frequency, and recompute the air gap and magnet in units of flux density. Done properly, the payoff is an SMT-compatible process, bounce-free edges, and wider assembly tolerance; the price is a quiescent-current budget that has to be taken seriously.
HXY Electronics (HuaXuanYang Electronics) is a power device brand with ten years of focus on this category, offering more than 5000 part numbers. The Hall line covers 96 Hall switches and 46 Hall ICs, 142 devices in total, spanning unipolar, bipolar latch, omnipolar, two-wire, and programmable types. Output stages include 86 open-drain, 36 push-pull, and 20 current-source parts. Supply voltage spans 1.8 to 60 V, the operating temperature ceiling reaches 150 °C, the sampling rate ceiling reaches 500 kHz, and ESD capability reaches 12 kV. Packages cover SOT-23-3L, TO-92S, SOT-23, PG-SSO-3-52, SOP-8, and TO-94. On the micropower battery-powered side, the choice follows event frequency and supply floor: the H6520MI (5 Hz, 1.8 V floor) for slow events and aggressive life targets, the H6523MI (160 Hz, 1.8 V floor) for general use, the H6527MI (−40 to 125 °C, open drain) and the H6022MI (bipolar latch, 0.014 mA supply current) where a wider temperature range or bistable behavior is needed, and the H6524MI or H6531MI where the rail stays above 2.5 V. HXY supports selection with FAE engineers and offers sample requests, online ordering, volume quotation, lead-time inquiry, and scheduled delivery.
Disclaimer: this article is compiled from publicly available technical material and HXY Electronics product information for reference and discussion only, and does not constitute any form of design guarantee or commitment. The guidance given here concerns design-level architecture choices and does not assert equivalence to, or compatibility with, any specific existing device. Final device selection, application, and verification must be based on the latest official datasheet and bench measurements. HXY Electronics accepts no liability for consequences arising from use of the information in this article. For reproduction, please credit the source and contact sales@hxymos.com.
声明 / Disclaimer
本文部分参数引自华轩阳产品手册或第三方规格书,数据有更新可能,仅供选型参考,最终设计请以最新版规格书与实测为准。
联系 Contact:sales@hxymos.com