When a magnet does nothing
Bring the magnet to the chip and look at the red LED first. Lit means the chip saw it, and the fault is between SIGNAL and your sketch. Dark means the chip has no power or the magnet is not close enough, face on, over the right part of the board.
Six symptoms
Pick what the block is doing. The ringed part of the board is where to look first, and the list beside it is the order to check in, by how often each one is the answer.
The LED stays dark with a magnet at the chip
The LED lights from the chip's output, so a dark LED means the chip did not switch. Either it has no power, VCC or GND missing or the cable one pin over, or it did not see enough field. The magnet has to be over the small chip at the top left, not the printed magnet at the top right, with a flat face towards it, and close: within about a centimetre for a small disc. A fridge magnet may have to touch.
The LED lights, and the sketch sees nothing
The chip pulled SIGNAL LOW, so the block is fine. The pin number in the sketch is a GPIO number, the one printed beside the pin on your board, not a count along the header. Then the SIGNAL wire itself. Then the ground: if the block is powered from somewhere other than the board reading it, the two need a GND wire between them.
It reads backwards
Nearly always a sketch that treats HIGH as the magnet, like the one on this
block's old page. The chip is active low. Test for LOW.
It reads a magnet that is not there
With the LED lit, it is right: something magnetic is near the chip. With the LED dark, VCC is probably missing and SIGNAL is drifting.
It misses some passes
The chip looks at the field about every 22 ms, and a magnet that is in range for less than that can fall between two looks. Slow the wheel, or make each pass last longer. No change to the sketch fixes it.
When it does not work
Wire GND and VCC only, and bring a magnet's flat face to the small chip at the top left. The red LED should light while the magnet is there and go out when you take it away. If it does, the chip and the supply are fine, and anything left is SIGNAL's wire or the sketch.
The flash pins, which stop the board booting if touched, and the strapping pins read at reset, 0, 2, 5, 12 and 15. A magnet left beside the block holds SIGNAL LOW through a reset, and on a strapping pin that could change how the chip starts. GPIO 25 is used here because it has no job at boot.
Look at the LED. Lit: something magnetic has come near the block, a tool, a speaker or the magnet itself. Dark: a wire has come loose, most likely VCC, and SIGNAL is drifting. The right-angle pins lie flat, and a cable's weight can pull the block out of its row.
It is rated to 5.5 V and for 6000 V of static from a hand, so the ways most likely to damage it are a supply above 5.5 V, or VCC and GND swapped: its rating stops at 0.3 V below ground. If the LED never lights with a strong magnet touching the chip and the supply is right, that is the time to suspect it.
Forty-odd blocks, and this is the one that notices without being touched.
Back to the blocks →Edit this page — content/books/hall-effect-sensor/when-a-magnet-does-nothing.mdx
Questions about this product
See what other owners have asked, and read their solutions.
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.