Adding Low Pass Filter to Open Collector Hall Sensor
your revised circuit is not what " transistor " recommended , he said remove R2 and leave R1 , so this way the circuit will be something like this:

you also are better disabling the micro-controller internal pull up of the micro-controller and use a voltage divider if micro is 3.3v and sensor is 5v as shown in the schematic , instead pull up the sensor to 3.3v because this is the whole point of using open collector , even if the sensor is supplied by 5v , the output can be interfaced to 3.3v or 12v or whatever you want , the circuit will be like: