Half the supply at rest
With no field the output sits at half the supply, 2.5 V from 5 V, and an Uno reads about 512. A field moves it 3.25 mV per gauss, typical, up for one pole and down for the other, in a straight line out to about 460 gauss either way. Zero field is the middle of the scale, not the bottom.
A straight line through the middle
A current runs through the Hall element inside the chip. A field through the element pushes that current to one side and leaves a small voltage across it, proportional to the field and with a sign that follows its direction. The chip amplifies that voltage and adds it to half of its supply. So the output has a middle, and the field moves it either way.
At 5 V the data sheet gives the numbers: 2.5 V with no field, 3.25 mV for every gauss, 1 V at −460 G and 4 V at +460 G. Slide the field and the output follows the line. The gauss is the unit: a fridge magnet is tens of gauss at its surface, a small neodymium disc thousands, and the Earth's own field about half of one.
The middle is not exact
The typical chip rests at 2.5 V. The data sheet allows 2.25 to 2.75 V, shown as the grey band, and at 3.25 mV per gauss that spread is worth about 77 G. A sketch that assumes 512 on an Uno can be out by more than a fridge magnet's worth before you start. So the sketches in this book measure the resting level with no magnet near and subtract it.
The slope varies too, 2.95 to 3.55 mV per gauss at 5 V, about 9 % either way. A reading in gauss from this block is good to about a tenth, and better as a comparison: nearer, farther, stronger, weaker.
Where the line ends
The sheet draws nothing past ±460 G. A small neodymium magnet makes that at a few millimetres, so the reading stops growing before the magnet touches the board. Treat a reading at the end of the range as "strong", and measure from a little farther out when you want a number.
When it does not work
No. 512 on an Uno is half of 1023, and half the supply is where this chip rests with no field. The field is how far the reading has moved from there, up or down. A sketch that treats 0 as no field and 1023 as strong is wrong for this block.
Probably not. The data sheet allows the resting level anywhere from 2.25 to 2.75 V at 5 V, about 460 to 563 on an Uno. That spread is worth about 77 gauss, which is why the sketches measure their own zero instead of assuming 512.
The sheet draws its straight line out to 460 gauss and no further, and a small neodymium magnet makes more than that at a few millimetres. Past it the reading says strong, not how strong. Measure from a little farther away.
Up for one pole, down for the other, and why the back of the board swaps them.
Which pole, which way →Edit this page — content/books/linear-hall-sensor/half-the-supply-at-rest.mdx
Questions about this product
See what other owners have asked, and read their solutions.
Linear Hall Effect Sensor
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.