magnetic rotary encoder 0.3V output voltage
You need to add what's called a pull-up resistor to the encoder's output pin [from OP's data sheet]:

The pull-up resistor should go to the processor's +3.6V Vdd. Your processor may have GPIO pins that are 5V-tolerant. If so, you can pull-up to +5v DC.
What value? The transistor pulls down to GND, but the spec is ambiguous...suggesting that when the transistor is ON (pulling 20 mA current down to GND), you'll have 0.3V -to- 0.7V at the output pin.
If you use a large-value pull-up resistor to the processor's 3.3V Vdd, this &quot;low&quot; voltage will likely be closer to GND than 0.3V. You might try a 10k pull-up resistor to start. With such a large value, when the motor turns quickly, pulses may disappear because switching time is too slow. If so, try a smaller value pull-up resistor.