Reading Maxon Motor Hall Sensor

Hi all,
I am currently trying to use a Maxon motor with a built-in hall sensor to output its current RPM to my Arduino system.
Unfortunately, when I attempt to output the sensor data, it does not appear to be working.
I have the sensor output wire connected to a PWM pin, and I am using analogRead to try and real the values and print to a serial monitor.
this hasn't worked. The serial monitor reads values but its something like 3500 and doesn't change, even when the motor speed changes or the motor turns off. Even when the motor is off the monitor is still outputting the same value (as refreshed values, the values change with +-50 rpm even though the motor dropped something like 2000 rpm or was turned off).
This is a 5-wire maxon ec45 flat motor for reference.

Any and all help is appreciated, thanks.

Reading Your post I must say: Read the first topic telling how to get the best out of this forum. Link: How to get the best out of this forum - Using Arduino / Project Guidance - Arduino Forum

Please post schematics. Your question makes no sense,
"sensor output wire connected to a PWM pin".

I agree with @Railroader, that makes no sense. PWM and analogRead are completely different. PWM is an output. AnalogRead does not work on PWM (digital) pins.

Post a data sheet or link to a data sheet for the motor.

It may be that the sensor output is open collector (drain) so needs a pullup resistor to work. You can use an external pullup (10K or so) or enable the internal pullup. You can use internal pullup on an analog input if it is indeed analog output.

In setup() put:

pinMode(Ax, INPUT_PULLUP);

to enable the internal pullup on pin x.

But the Hall effect sensor on a motor is more likely to be a Hall effect switch so reading with a digital input pin (digitalRead) that is set to enable the internal pullup is more appropriate.

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