Pull-up or pull-down resistor with PNP/NPN hall sensor?

Hello everyone!
I'm trying to understand the difference and if I should be using a pull-up or pull-down resistor with a PNP/NPN hall sensor.
Should I use pull-up with PNP and viceversa for NPN? or can I use pull-ups for both NPN and PNP and then, on the code where I have the attachToInterrupt section I change from "RISING/FALLING/CHANGING" depending if I used a pull-up or pull-down?

I'm doing a project for a Tachometer and I'm now choosing sensor and resistor to use, but without this basic knowledge I obv. cannot decide on what to purchase.

Many thanks for the help!

With PNP pull down and rising, with NPN pull up and falling

1 Like

Simple trick assuming it is an open collector output. Look at the center letter of the transistor device and that tells you whether to pull it "N" negative or "Positive.

1 Like

Hi, @francescoranchi

You need a pullup resistor for NPN transistor output.

You need a pulldown resistor for PNP transistor output

Tom.. :smiley: :+1: :coffee: :australia:

1 Like

Ok super! many thanks, one last question, If I use for example NPN with pull-up and attachToInterrupt "FALLING" it must be a NO, otherwise if it's NC I need to write "RISING", is that correct?

Hello Dear all,
I'm making an Arduino based tachometer and I'm using a hall sensor. I've understood pretty well the differences between a NPN/PNP hall sensor, what kind of output signal I need to expect, if I should use pull down or up resistor and how to adapt the code according to the chosen sensor.
However I'm facing an issue understanding the difference between NO and NC which seems to be the easiest part.

This is what I've found reading online

"NPN (Normally Open) means that when the Hall sensor has no magnetic field, it outputs a low level, and when there is a magnetic field, it outputs a high level. NPN (normally closed) means that the Hall switch sensor outputs a high level when there is no magnetic field, and outputs a low level when there is a magnetic field.
2. PNP (normally open). When the Hall switch sensor has no magnetic field, it outputs a high level. When there is a magnetic field, it outputs a low level. PNP (normally closed), the Hall switch sensor outputs a low level when there is no magnetic field, and outputs a high level when there is a magnetic field."

To me it makes no sense because if it's normally open, doesn't matter if PNP or NPN I shouldn't receive any signal at all...could somebody help and explain?

many thanks!!

You should not open new topic if your subject is same than previous.
Anyway there are 4 wire sensors that can be used NC or NO . They have 2x npn or 2x pnp incorporated.

Normal 3-wire PNP hall sensor is giving positive output in presence of magnetic field, so it's considered "NO"

Right :frowning:
Most probably that text was created by ChatGPT, you should not rely on it.

NPN and PNP act like mechanical switches, where NPN is tied to - (GND) and needs a pullup resistor, while PNP is tied to + (Vcc) and neads a pulldown resistor. NPN is the best choice with µC which have a negative common GND, so that the pullup can go to the controller Vcc regardless of the sensor operating voltage.. PNP sensors instead can have a high operating voltage that exceeds the acceptable controller input voltage and deserve further circuitry.

NO and NC should be known from relays or other mechanical switches. When activated then NC connects to - (GND) for NPN or to + for PNP. NO does the same in not activated state.

More properties are important with Hall sensors. You already seem to have decided for digital senors, not analog. Digital sensors can have a hysteresis and may latch. Latching means that one magnetic polarity turns the output ON and only the other polarity turns it OFF again.

@francescoranchi,

Your two or more topics on the same or similar subject have been merged.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

I see you have been warned about this before, I have given you a 2 day rest from posting, please read and understand the forum rules.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.

Hi, @francescoranchi

Can I suggest you get down and dirty, and actually build a circuit around your device and connect it to a controller and EXPERIMENT and observe the result.
You will learn so much more and quicker.

What is your device?
Please post a link to soecs/data of the sensot?

Tom.. :smiley: :+1: :coffee: :coffee: :coffee: :australia:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.