Hall Sensors (A3144) to one pin?

Hello,

first sorry, I am new to Arduino and just testing arround :wink:

My first project works, but it uses too much InputPins....
I have ~8 Hall sensors (A3144) without resistor at INPUT_PULLUP and it works, but I have to use one input-pin per Sensor.

Is it possible to connect multiple HallSensors with resistors to a analogInput and check via a IntRange which sensor is affected?

Thanks in advance!

You may be able to use an R/2R resistor ladder, then do an analogRead() call, and identify the sensor(s) is triggered by which bit(s) are set or cleared.

Using a port extender (PCF8574 is cheap and will do great for this) is the far easier and more reliable route.

[Increase Digital Pins of Your Arduino Using the 74HC595 (IOExtension Module With Arduino Library)](http://Increase Digital Pins of Your Arduino Using the 74HC595 (IOExtension Module With Arduino Library))

You may want to consider using some 74HC595 shift registers as explained in the above link. Using 4 pins gets you 16 DIO. Pretty sure Sparkfun or someone sells a ready built breakout board.

Ron

wvmarle:
You may be able to use an R/2R resistor ladder, then do an analogRead() call, and identify the sensor(s) is triggered by which bit(s) are set or cleared.

Nope, its open collector output, you need push-pull for an R-2R ladder as it relies on constant impedance.

I'd suggest using 3 or perhaps 4 sensors per analog pin at a pinch, say three with 2k2, 4k7 and 10k resistors, all to a common 1k5 pullup resistor - ought to give a reasonable spread of voltage steps with reasonable noise immunity.

Ron_Blain:
You may want to consider using some 74HC595 shift registers as explained in the above link. Using 4 pins gets you 16 DIO. Pretty sure Sparkfun or someone sells a ready built breakout board.

The shift register suggestion as such is valid, but you got a few things wrong here.

  1. the 74HC595 shift register is serial in to parallel out. In this case you need parallel in, serial out, e.g. 74HC165.
  2. you need only three pins (clock, data, and latch) where the third (latch) is optional depending on the shift register used.
  3. each one shift register offers 8 input or output lines, they can be daisy chained indefinitely - that is, until practical limits hit.
    Don't forget to add pull-up resistors on the sensor output when using shift registers.

Uh Oh, yes, I got that backwards. >:(

Serial to Parallel Shifting-Out with a 74HC595

The MCP23S17 and the MCP23017 and a Google of Port Expanders Arduino may find you some ready to go break out boards.

Ron