linear Hall sensor/Reading it/07. How much field a count is
Reading it · 07 of 9

How much field a count is

On an Uno one count is about 1.5 gauss; on a Pico about the same; on an ESP32-S3 about 0.36 gauss on paper, though its ADC jitters by several counts. With a 10 × 3 mm neodymium disc that is readable out to about 3 cm, on paper. A wire carrying 5 A makes about 1 gauss at 1 cm, which is why this block is not a current sensor.

What one count is worth

An Uno's analogRead has 1023 steps across 5 V, 4.9 mV each. At 3.25 mV per gauss that is about 1.5 G per count. A Pico in Arduino reads 1023 steps across 3.3 V, 3.2 mV, and at 2.1 mV per gauss that is also about 1.5 G. An ESP32 reads 4095 steps across about 3.1 V, 0.76 mV, so a third of a gauss on paper; its ADC jitters by several counts, which is why the sketches average.

How much field a count is
Your board
Magnet, N35 disc
Distance, face to chip20 mm
Field
42 G
One count
1.5 G
Counts
28
About 28 counts from rest, on paper. Each count is about 1.5 G. The same magnet switches the TK18 at 40 G, about 20 mm away.

Pick your board and a magnet, then slide it away. The field is the same model the TK18 book uses: a neodymium disc, face on, the chip on its axis. It is the best case; a real magnet at an angle does less. For a 10 × 3 mm disc it gives about 460 G at 7 mm, where the straight line ends, 40 G at 20 mm, where the TK18 would switch, and 10 G at 34 mm.

So a neodymium disc is readable from touching distance to a few centimetres, and the useful range for a number is roughly the middle of that: close enough to be well clear of the jitter, far enough to stay on the straight line. The distances depend on the magnet far more than on the chip. Try yours.

A wire is not a magnet

The page this book replaces said contactless current sensing starts here. It does not, with this block on its own.

A wire is not a magnet
Current in the wire5 A
Wire to chip10 mm
Field
1.0 G
Uno counts
0.7
Earth, at most
0.65 G
1.0 G: about 0.7 counts on an Uno, the size of the jitter, and the Earth's field changes by as much when you turn the board. The block cannot tell this current from nothing. A current sensor puts the wire inside the package, against the Hall element (the ACS712 does), or gathers the field with an iron ring round the wire.

A straight wire carrying a current makes a field that circles it and falls off with distance: 2 G for every amp, divided by the distance in millimetres. 5 A at 10 mm is 1 G, under one count on an Uno and about the size of the Earth's field, which changes as you turn the board. Pressed against the wire you might see a few counts, and any magnet or steel nearby moves the reading as much.

Current sensors that use a Hall element do it differently. The ACS712 runs the current through its own package, right against the Hall element; clamp meters wrap an iron ring round the wire to gather the field into a gap where the sensor sits. For a number in amps, use a sensor made for it, such as the TK119 INA219 block.

When it does not work

The reading only moves when the magnet is almost touching.

Either the magnet is weak or it is held edge-on. A flat fridge magnet is striped into narrow poles and its field dies within a millimetre or two. A small neodymium disc with a flat face toward the chip reaches centimetres.

The last digit never stops changing on my ESP32.

That is the ADC's jitter, several counts, and at a third of a gauss per count it is a gauss or two. Average more readings: the sketches take 16 per line. Do not expect a steady figure below a few gauss on any board.

Can I measure the current in a wire by holding the block next to it?

No, not in any useful way. A wire carrying 5 A makes about 1 gauss at 1 cm, under one count on an Uno and no bigger than the Earth's field. Use a current sensor built for it, such as the INA219 block or an ACS712 module.

Where this goes next

A sketch that names north or south without flickering at the edge.

A pole finder →

Edit this page — content/books/linear-hall-sensor/how-much-field-a-count-is.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

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.

Browse Modules and blocks on the forum →