Hall-Effect Switches in Parallel?

Hi Guys

I want to be able to use two A1104 hall-effect switches, either of which will be able to change the state of an Arduino pin. However, being unfamiliar with the properties of the switch's NMOS output transistor, I am unsure whether my plan to connect them in parallel will cause problems.

In the attached sketch, with neither hall-effect switch subject to a magnetic field, the Arduino pin will be held high, but if either switch A or switch B, but not both, is magnetically switched, will the Arduino pin be made low as desired, or will there be a short from Vcc to ground?

If the result is a short, can anyone suggest an alternative way to connect the two hall-effect switches such that either switch can change the Arduino pin state and not short Vcc to ground?

Bernie

A1104x2.jpg

That's fine - they are open drain devices, they can only sink current.

But that won't give the behavior you asked for though. It will go low if either or both of them sense a magnetic field.

Hi DrAzzy :smiley:

Once again, you have saved my butt!

Actually, the fact that the input will go low if both of the switches sense a magnetic field as well as just one is not a problem. I just need the Arduino (its a ProMini in actual fact) to receive a low signal when either of the switches are subject to a magnetic field and in the unlikely event (in this particular setup) that both were switched at the same time, its good to know that the end result would be still the same.

Thanks again!

Bernie

You'll need to add a pullup resistor.

@Old Steve - why is a pull-up resistor needed - and where?

The default output state of the switch is high (Vcc) and goes low when subject to the magnetic field.

Bernie

STDummy:
@Old Steve - why is a pull-up resistor needed - and where?

The default output state of the switch is high (Vcc) and goes low when subject to the magnetic field.

Bernie

In that case, your diagram is not accurate. You show "open-drain" MOSFETs, with nothing pulling the drain high.
(I was going purely by your diagram.)

Here is the functional block diagram from the Allegro datasheet for the A1104, (attached).
It clearly shows an "open-drain" output, which would require a pullup resistor.
(So your diagram was correct, but you must be wrong - the "default" is not 'high', it's 'open'.)

Edit: You need a resistor from the output of the Hall-effect switch to +5V. If connecting the two Hall-effect switch outputs together, you need just one resistor. 10K would probably be OK.

Hall Effect Open-drain.JPG

Hi OldSteve

Apologies for the confusion. I completely forgot to indicate that I do in fact use the internal pullup resistor of the processor which will take the place of the 10K resistor you mention. In fact, I'd completely forgotten about the input_pullup until I just rechecked the sketch!

Many thanks for the lesson to "check first before revealing my ignorance" :-[ :smiley:

I also have to apologise to all and sundry for basically repeating myself from here - Hall Effect Sensors in parallel - General Electronics - Arduino Forum
Lets just say I'm getting old!

Bernie

Edit: Added an embarrassed smiley!

STDummy:
Hi OldSteve

Apologies for the confusion. I completely forgot to indicate that I do in fact use the internal pullup resistor of the processor which will take the place of the 10K resistor you mention. In fact, I'd completely forgotten about the input_pullup until I just rechecked the sketch!

Many thanks for the lesson to "check first before revealing my ignorance" :-[ :smiley:

I also have to apologise to all and sundry for basically repeating myself from here - Hall Effect Sensors in parallel - General Electronics - Arduino Forum
Lets just say I'm getting old!

Bernie

Edit: Added an embarrassed smiley!

No problem Bernie. :slight_smile:

Lets just say I'm getting old!

Don't worry, you're not the only one. :smiley: