I have a rotary encoder whose output uses an NPN and a PNP transistor to switch between something slightly less than the high input voltage (~17V input) and ground.
I need to trigger 5V TTL from this, so I connected it to a 5.1V Zener diode and a resistor, and the DAQ board to which it is attached has a pull-down resistor.
To run, the rotary encoder requires a voltage between 12 and 24V input, and at around 14V (which I had almost working) the current draw from the power supply is ~100mA (for 3 outputs, A, B and Z, each with their own same resistor R and Zener)
The voltage measured goes between about 400mV and 4.5V in that case. The decay is quite curved - not very sharp corners for my 'square' wave output. Reducing the value of the resistor labelled R improves the corner 'squareness' but I'm concerned that current draw might cause more problems for the diode.
If I increase the current limit on the PSU, the maximum voltage gets closer and closer to 5V but then the output flatlines.
I had worried that the diode was dissipating too much power, so I switched from a 1.3W to 5W zener diode. I'm pretty sure that even if the entirety of the PSU current went through only one of the diodes, with the full voltage drop there, the power dissipated should be less than 5W (14*0.1 << 5).
Why is the circuit output flattening to ground? Should I use larger or smaller R? (Currently at 680 but started with 1k and tried also 3.3k - I'd expect larger R to draw lower current I, but that doesn't seem to be what I'm seeing from the PSU, and larger R is making my wave increasingly curved at corners)