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?
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.
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.
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" :-[
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" :-[