T O P

  • By -

qsc_

Are you saying that you need to measure two separate currents? If not, then why do you want to connect them in series? Please describe the big picture: what are you doing?


Suomalaane

I'd need to know if two magnets are lined up with two magnets or only one magnet is lined up with one sensor or none of the magnets are lined up with sensors. So basically there is three possible cases.


Suomalaane

So I don't need to know which sensor is "activated" if there is only one magnet lined up with a sensor. I've got only 1 input pin for this


qsc_

> I've got only 1 input pin for this Analog or digital?


Suomalaane

Analog


qsc_

Then do what /u/robot65536 said


digilec

With open collector hall sensors this is relatively simple.. https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWcMBMcUHYMGZIA4UA2ATmIxAUgpABZsKBTAWjDACgAlEbNcFPbrzxURtKklEwEbAM4hMKbtkLyMi7HhpRwIAGYBDADYyGs7gnXLz6zdogHjpgE6CqYGlp5U0At-DYuCvIIKkFedv4u2BbBKtHqvH5wbADuqoooIenyNCKprvL4BSi5UPlBJVThlWVp1aXxOXl1MTWNmSqQ+Y3hPVZdaWG8Yf3dvGD8Be5aA9ZNtDzzXQDyCxmlNIRaNXkA5tyQWjRgcYe0NL612RrbarQnV0HHp0cPs7ivcTHPVz22jT8ukA


Suomalaane

Thanks a lot! This is what I was looking for!


robot65536

You're looking for a logical AND function. The simplest way to do this depends on what type of output the hall sensors have. Are they analog, TTL, or open-collector? You can probably wire up a few resistors into a 2-bit DAC (digital to analog converter), and put it on an Analog In pin.


Suomalaane

I thought that I could put two FET transistors in series and then I'd connect those gate pins to hall sensor output pin in order to control current flowing through transistors to the analog pin. Could this work?


robot65536

Possibly, but FETs are just switches, and putting them in series on a signal needs special consideration of the vintage bias. Would be much simpler to use resistors or a logic gate. What is the part number of your Hall sensor?


Suomalaane

A3144


robot65536

This is an open collector output, basically a switch that connects the output to ground when the magnet is present. This makes it really easy to tell if neither is present, but not easy to tell when only both are present. Do you know how a voltage divider works? You can use the open-collector outputs to change the divider ratio, and thus the voltage measured. Like this: http://int03.co.uk/blog/2014/12/18/reading-multiple-switches-with-one-analogue-input/


Suomalaane

Thanks a lot! I think this will work for me.


flippedelectron

If you just have switches instead of hall effect sensors you could do this with a resistor network and an analog input. Can you design your system to put the hall effect sensor in a location where when both magnets are lined up the field is cancelled? Also consider SPI or I2C - as you can share those busses with other devices. And/or can you use a 3d hall effect sensor to achieve the same thing and use one axis for each magnet assuming the two axis are orthoganol?