Array of hall sensors

Hi folks,

I'm new to arduino. I read everything available about multiplexing and led-arrays and think I fully understand it. What I want to do next is to build a hall-sensor matrix (8x8). Therefore I want to alter the led array in that way that I change the leds to normal diods and put a hall sensor behind each (with the needed resistor, like described here

I want to add a multiplexer to the output (I need the other ports for other project based outputs). That output I want to put on the matrix row. For the input a multiplexer is added, too (columns of the matrix).

Now I want to multiplex through the outputs and set them in high and check all possible input for a sensor signal to clearify which hall sensor switch is activated.

Does that sound like a feasable plan or won't it work?

Thank for you help and guidance.



image above is an example how to use two 4051 (one as demultiplexer and one as multiplexer) in a 8x8 Matrix to check 64 buttons or other digital Inputs just with one digital-In-Pin on the arduino


The resistor isn't needed in that tutorial, because you can use the internal pin pullup resistor instead.

The resistor isn't needed

Wasn't it Ohm that said, "A resistor saved is a resistor earned."? XD


I rarely use the weak internal oull-up resistors because their value is not guaranteed. I'd rather put a physical component on the board for a nickel and know what I'm doing can be exactly modeled within the range precision of the component. At today's prices, I always buy 5% or 1% for metal film resistors.

But, yes, I suspect the internal pull-up would be appropriate in this case.


For this application, I think I would use a 74HC138 3-to-8 line demultiplexer, with each output driving a PNP transistor that switches the +5V supply to one column of Hall sensors (sadly, as each sensor need 4mA of supply current, you can't power 8 of them from a single demultiplexer output). I would connect the Hall sensor outputs together in rows (they are open-collector outputs) and use a 74HC4051 multiplexer chip to connect one row at a time to an Arduino input.

After selecting the column, you need to allow 25us (the power-up time of the sensor) before reading the input.