Electronic – Hall Switch AND gate

brushless-dc-motorhall-effectsensor

I am building a motor with permanent magnets in the rotor, and I need to pulse the stator coils at the right time, and need to be able to adjust the duty cycle.

My plan was to use not 1 but 2 Hall effect switches (A3144) in an AND gate setup, where the current would only flow when BOTH sensors were ON.

This way, the further I place the sensors apart, the lower the duty cycle becomes, since the moment at which both sensors are ON becomes shorter.

However, I've only been able to create an OR gate setup like this:

enter image description here enter image description here

Any idea if and how I can create an AND gate using two Hall sensors?

Thanks for the help!

Best Answer

Your Hall sensors appear to be of the usual output-low-when active and hopefully open-collector/open-drain configuration. Thus in your shown circuit, the LED will light when either activates and sinks current.

Your literal request is for the functionality of an "AND" gate but with active low inputs and the outputs, or in simple terms, an AND gate with inversion at both the inputs and output. Via DeMorgan's theorem, an AND gate with inverted inputs is a NOR gate, and if we add the inversion of the output, we're back to an OR gate.

So a literal answer to your question would be to buy an OR gate such as a 74AHC1G32. Or if you'll take four of them to get a breadboadable 14-pin DIP package, an 74AHC32. The "AHC" letters represent one logic family with a wide supply range; depending on your actual needs many others will suit.

However, given that you seem to be trying to ultimately do motor control, in the end you'll probably have an MCU in the system.

And at that point, it makes far more sense to run the two sensors into distinct MCU pins, and implement the required logic function in software.