Sensor Hall Effect SS461C

Hello, I have a hall effect sensor SS461C handy, and I would like to use it for counting the rpm of a rotating disk.
Since it is a latching sensor, I would use 4 magnets place at quarters of the disk to do not create too much unbalance.
The datasheet is here.
I am not confident on the wiring.
I create 6 alternatives on the attached figure.
The number 1 without any resistance is what I was thinking to use since the max output current is 20mA, which should be ok for arduino pins. Alternative, the number 6 is what looks similar to the schematics on the datasheet but I cannot understand the difference between 1 and 6.

But since the actual output current depends on the magnets (if I understood well) and I do not know their magnetic field yet, I have seen online schematics with a 10komh resistor.
I do not know where this number comes from, I have tried to use the omh's law but I am clueless.
Moreover, I cannot understand if the figures from 2 to 5 makes some differences or if they are all the same.


Could you help me with that? thanks

Hi,
None of those will do.
Your sensor has open circuit collector output.

Tom... :slight_smile:

TomGeorge:
Hi,
None of those will do.
Your sensor has open circuit collector output.

Tom... :slight_smile:

Hi Tom, thank you for your reply,
no idea why your wiring works but I am sure it is right.
I attached the figure with the new configuration and the block diagram from the datasheet (where the output is wired to the ground).

How to calculate the resistance I need?
Thank you

Hi,
Sorry no, its like this.

Tom... :slight_smile:

AntroxEv:
How to calculate the resistance I need?

No calculation, really. The only thing that cna be calculated is the absolute minimum: you mentioned maximum 20 mA current, so with a 5V supply that's giving you the minimum resistance of 250Ω. But that would make for a ridiculously strong pull-up, so we never do that. 10k is a far more sensible value, so the sensor's pin has to sink only 0.5mA. Actually 10k is the de-facto default value for a pull-up (or pull-down) resistor.

Or simply use the internal pull-up (typical 20-30kΩ) by setting the pinMode to INPUT_PULLUP.

Just remember when a south pole passes the output will latch Low until a north pole passes the sensor and the sensor will latch High so using 4 magnets you need two north and two south poles.

South Pole toward IC:
Output = Low

North Pole toward IC:
Output = High

You will have 2 PPR (Pulses Per Revolution).

Ron

Ron_Blain:
Just remember when a south pole passes the output will latch Low until a north pole passes the sensor and the sensor will latch High so using 4 magnets you need two north and two south poles.

South Pole toward IC:
Output = Low

North Pole toward IC:
Output = High

You will have 2 PPR (Pulses Per Revolution).

Ron

Yes, I though it.
I need just to reverse the faces of the magnets, doesn't it?

wvmarle:
No calculation, really. The only thing that cna be calculated is the absolute minimum: you mentioned maximum 20 mA current, so with a 5V supply that's giving you the minimum resistance of 250Ω. But that would make for a ridiculously strong pull-up, so we never do that. 10k is a far more sensible value, so the sensor's pin has to sink only 0.5mA. Actually 10k is the de-facto default value for a pull-up (or pull-down) resistor.

Or simply use the internal pull-up (typical 20-30kΩ) by setting the pinMode to INPUT_PULLUP.

A couple of additional questions:

  1. If 5V is the voltage supply by Arduino, doesn't the hall effect give a further contribution (5V+xx?) ?
  2. Will I end with my diagram number 2 if I am using the internal pull-up ?

Thanks

AntroxEv:
A couple of additional questions:

  1. If 5V is the voltage supply by Arduino, doesn't the hall effect give a further contribution (5V+xx?) ?
  2. Will I end with my diagram number 2 if I am using the internal pull-up ?

Thanks

Not sure what you mean but I would say No, your sensor is 5 volt powered by your arduino board. That is Vcc to your sensor and the Arduino board Ground and the sensor Grouind are tied as a Common Ground.

Yes, depending on how the magnets are configured but a passing south latches and a passing north un latches so you want your sensor seeing S/N/S/N resulting in 2 pulses per revolution.

Ron

Ron_Blain:
Not sure what you mean but I would say No, your sensor is 5 volt powered by your arduino board. That is Vcc to your sensor and the Arduino board Ground and the sensor Grouind are tied as a Common Ground.

Yes, depending on how the magnets are configured but a passing south latches and a passing north un latches so you want your sensor seeing S/N/S/N resulting in 2 pulses per revolution.

Ron

I though the Hall Effect produces an increment of the voltage due to the magnetic field.

Anyway, I have tested the configuration tested by Tom and works fine.
thank you all for your support

AntroxEv:
I though the Hall Effect produces an increment of the voltage due to the magnetic field.

Anyway, I have tested the configuration tested by Tom and works fine.
thank you all for your support

Nope, unlike an inductive pick up. The Hall sensor is powered. You apply 5 volts between VCC and Ground pins and the Vout or Out pin gives you about 5 volt pulses.

Ron

Just to conclude with the code for the counter (I haven't test yet):

const int pinSwitch = 2; \\connected to the Hall Sensor output
volatile byte state = LOW;
int revs = 0;
float RPM = 0;
int t = 60; //duration of the test in seconds

void setup() {
  pinMode(pinSwitch , INPUT);
  attachInterrupt(digitalPinToInterrupt(pinSwitch ), counter, RISING);
  Serial.begin(9600);
}

void loop() {
  RPM=revs/2*t/60; // since I have 4 magnets
  Serial.println(RPM);
}

void counter() {
  revs = revs ++;
}

I used the keyword RISING for attachInterrupt(), hence my function counter() should be called only when the Hall Effect sensor goes from LOW to HIGH (to compensate the fact ideally I would need of a non-latching sensor).
I need to find the way to record the time in order that the time t is a variable and not a constant.
Do I need to use a RTC module or just the built-in timer in Arduino?
I have to mention that I will adapt this code to work with a code for the stepper motor and I need to avoid any undesired delay that interferes with the speed of the stepper.
Thanks

While I am far from a programming type I can tell you that code will not load:

const int pinSwitch = 2; \connected to the Hall Sensor output

Your slashes for the comment are backwards. Change that and the code will load but regardless of input, I used an Arduino Uno and a function generator, produces 0.00 in the serial monitor. My best guess is because:

int revs = 0;

Nothing changes that zero. Also remember you do have 4 magnets which will result in two pulses per revolution. That part would have went better using a non-latching Hall Effect Sensor. Again, I am not a programmer type so hopefully someone will come along and make some good suggestions.

Ron

Ron_Blain:
While I am far from a programming type I can tell you that code will not load:

const int pinSwitch = 2; \connected to the Hall Sensor output

Your slashes for the comment are backwards. Change that and the code will load but regardless of input, I used an Arduino Uno and a function generator, produces 0.00 in the serial monitor. My best guess is because:

int revs = 0;

Nothing changes that zero. Also remember you do have 4 magnets which will result in two pulses per revolution. That part would have went better using a non-latching Hall Effect Sensor. Again, I am not a programmer type so hopefully someone will come along and make some good suggestions.

Ron

Thank you for spotting the mistake. I have changed them accordingly.

void counter() {
  revs = revs ++;
}

the variable revs will be changed when the function counter is called.
I will test it soon and I post the outcome here if there is any thing to amend.
Thanks