This is an FYI, sort of a post-mortem. TL;DR: supply >5V and specify INPUT_PULLUP.
E38S6G5-600B-G24N is an industrial 600 pulse/revolution A/B bi-phase rotary encoder; this product, among many like it, are used for building DIY racing wheel controllers for its higher resolution compared to garden variety potentiometer-like incremental encoders. Interfacing wise, works mostly the same. The only differences are that it needs 5V-24V power input, and that the output is "NPN-type" which necessitate pullups. Internal pullups in AVR suffices for that.
I had one that didn't seem to work at first, and came across this thread-> Racing Wheel Rotary Encoder whont work in which the user sadly gave up using this part. Since that thread is long locked and there are not much information for this part in the first place, I decided to drop some information here.
As said in TLDR, this part require 5-24V input, and 5V means 5V; it can't be substituted with 4.975V or whatever from Arduino. This is not a forgiving part like typical 5V components that states min/typ/max = 3.7/5.0/7.2V in DC characteristics, it works from 5.0V.
To generate "more than 5 volts", a simple voltage doubler can be used e.g. -> operational amplifier - Op amp based DC-DC voltage doubler - Electrical Engineering Stack Exchange , just feed it voltage from 5V pin and analogWrite(13, 127). I used 1N4148 for diodes, 47uF for C1. Larger is better. It will be less than 10V and not a clean one at all, but it should work. It may be supplied with 12V from other sources just fine. Do not feed that 12V through external pullup resistors though, for it burns inputs on Arduino.
I'm hoping this will help others in the future.
UPDATE 2024/11/29: TL;DR: "5-24V" is a lie. Feed 6.7V or more.
I came back to the project and came back to this my post and solution, which didn't exactly work as described, perhaps due to USB port voltage variances; sorry for people confused by it.
Upon further investigation, I found a second source 78L05 linear regulator inside, which regulates input voltage down to 5V with a 1.7V dropout voltage required for it to turn itself on. 5 + 1.7 = 6.7V.
I've concluded that "5-24V" input rating has to be completely inaccurate, and backed that diode boost with another 5V DCDC totaling up to 7.5V or so. This time it worked.
As for whether this specific solution is important or could it be any source with adequate voltage, yes it can be any supply above 7V-ish. In case you're powering Arduino with a DC barrel adapter, it likely can be just tied to VIN pin.
I also report that the device has open internal pullup pads as well as unused Z phase output.
Good grief.