Hall effect sensor switch question.

Status
Not open for further replies.

fil

New member
Hi all,

Could anyone advise me on a project?

I am using 10 x hall effect allegro A1125 sensors as switches, digital ins to trigger midi note on/offs.

I came across some Unipolar Allegro A1157's, which are (in effect) 2 pin switches, which reduces 3 pin connections to 2 pins.

My question is; how do I connect the 2 sensor pins, which are ground and 3 volts positive, to a digital pin in, on the Teensy. (I am using a teensy LC).

Do I connect the 3v sensor pin to 3v, and the ground pin to a Teensy digital pin, or vice versa?

And, do I need any other components, caps, resistors etc in the circuits?

Thanks in advance,

fil.
 
You need a pullup resistor but it's already built into the Teensy.
You would connect the ground pin of the sensor to ground and the other pin to your digital pin. To enable the pullup it would look like this:

pinMode(n, INPUT_PULLUP);
 
Thanks nlecaude.

Thanks nlecaude, that makes complete sense.

:D

Much appreciated. fil.


D
You need a pullup resistor but it's already built into the Teensy.
You would connect the ground pin of the sensor to ground and the other pin to your digital pin. To enable the pullup it would look like this:

pinMode(n, INPUT_PULLUP);
 
nlecaude's suggestion definitely won't work. Those 2-wire hall effect sensors operate in current mode and switch between 2 current draw levels. Interfacing with them is much more cumbersome. You need a sense resistor and you need to ensure that the hall sensor gets it's 3V minimum voltage (you need to take into account that the sense resistor will drop a fair amount of voltage). You also need to be prepared for 17mA current draw per sensor. What voltages / power supplies do you have? Which Teensy?

Is using the 3-wire version that big a deal (ground and Vcc can be shared between the sensors)?
 
nlecaude's suggestion definitely won't work. Those 2-wire hall effect sensors operate in current mode and switch between 2 current draw levels. Interfacing with them is much more cumbersome. You need a sense resistor and you need to ensure that the hall sensor gets it's 3V minimum voltage (you need to take into account that the sense resistor will drop a fair amount of voltage). You also need to be prepared for 17mA current draw per sensor. What voltages / power supplies do you have? Which Teensy?

Is using the 3-wire version that big a deal (ground and Vcc can be shared between the sensors)?

would it work, if the resister is not internal but external to complete the sensor electronics (fet for impedance transform?) and using an ADC to sense the different states of the sensor?
(internal resistor may to big for allowing drain of 17 mA )
 
would it work, if the resister is not internal but external to complete the sensor electronics (fet for impedance transform?) and using an ADC to sense the different states of the sensor?
(internal resistor may to big for allowing drain of 17 mA )

Yes. I'd put the resistor on the low side (as a "pull down") and power from Vusb. The Sensor needs a minimum supply voltage of 3.0 V, so when powered from 5V that allows for 2V drop in the sense resistor. With the worst case values (17mA, 3V) the maximum resistance will be: R = 2V / 17mA = 117 Ohms. Take the next lower standard value of 100 Ohms. Now your worst case "high" signal is V = 100 Ohms * 12 mA = 1.2V, which is well below the 0.7*Vdd = 2.31V the Teensy 3.2 needs to recognize a logic high. So you'd need the ADC. Whether trading the necessity of analog inputs against using the two-wire hall switches is a good trade or not depends on the application...
 
Yes. I'd put the resistor on the low side (as a "pull down") and power from Vusb. The Sensor needs a minimum supply voltage of 3.0 V, so when powered from 5V that allows for 2V drop in the sense resistor. With the worst case values (17mA, 3V) the maximum resistance will be: R = 2V / 17mA = 117 Ohms. Take the next lower standard value of 100 Ohms. Now your worst case "high" signal is V = 100 Ohms * 12 mA = 1.2V, which is well below the 0.7*Vdd = 2.31V the Teensy 3.2 needs to recognize a logic high. So you'd need the ADC. Whether trading the necessity of analog inputs against using the two-wire hall switches is a good trade or not depends on the application...

Figure 2 in data sheet (download via http://www.allegromicro.com/en/Prod...fect-Unipolar-Switches/A1150-2-3-5-6-7-8.aspx) shows the schematic: sense resistor either high or low (as suggested by ben)
 
Thanks all.

Thanks everyone for your inputs.

As I mentioned in my original post the Teensy is an LC type.

I'm looking at a 3.6 rechargeable battery for power requirements.

From Ben and MXZ's comments. It looks like the 2 pin sensor has complications.

They are also difficult to source here in the UK. Shipping in from Digikey, USA is the only option I've found.

So, although the extra traces for 3 pin operation are problematic, it is doable.

So, my next question is; Will I need any extra components for using, say a 3 pin Allegro A1125?

Thanks again for your collective inputs.

fil.

nlecaude's suggestion definitely won't work. Those 2-wire hall effect sensors operate in current mode and switch between 2 current draw levels. Interfacing with them is much more cumbersome. You need a sense resistor and you need to ensure that the hall sensor gets it's 3V minimum voltage (you need to take into account that the sense resistor will drop a fair amount of voltage). You also need to be prepared for 17mA current draw per sensor. What voltages / power supplies do you have? Which Teensy?

Is using the 3-wire version that big a deal (ground and Vcc can be shared between the sensors)?
 
So, my next question is; Will I need any extra components for using, say a 3 pin Allegro A1125?

Have a look at the data sheet of Allegro A1125 (figure 1) it indicates a 0.1 uF from Vdd to GND (close to hall sensor) and a resistor to provide current to the FET
 
As I mentioned in my original post the Teensy is an LC type.
I overlooked that.
I'm looking at a 3.6 rechargeable battery for power requirements.
That means it would be close to impossible to reliably supply 3V to a 2-pin sensor. It would also use more power, in the high state quite a lot more.

If you had a well-regulated 5V supply, you could potentially make a 2-wire version work with a digital input (there are 2.5V sensor versions, TI DRV50XX), but since you don't...
 
Last edited:
Status
Not open for further replies.
Back
Top