Hi everyone, first post here.
I'm dipping into the world of microcontrollers and micro electronics. And I want to start with what I feel is a good entry level project.
I'm looking to convert an analog encoder to a 5v quadrature. The analog encoder produces a Sine wave with 2.2-2.7 volts peak to valley. It also puts out a 2.45v reference voltage that you can use to compare to. I did some reading and it sounds like using a voltage comparator circuit is the easiest way. Mainly a LM311 chip. Attached below is the circuit that I made along with the output from my scope. Looks like I'm really close to what I want. I will have to make three of these circuits for the A/B/Z channels of the encoder.
But I'm having a couple problems. First, I'm only getting around 3.7v output, Which is enough for TTL. More would be nice, but its not the end of the world. My cable run will be about a meter.
Second is the problem. My rise time on the square wave is around 20us. Max speed on this I need is 100khz which would be 10us peak to peak. So getting the speed down to at least 5us rise time I think will work. Faster is better for a cleaner signal. I have some 2n2222 transistors on the way, can I use those to speed up the circuit?
Lastly, this signal is going to be fed into a VFD. I have the option of Open Collector or Line Driver. I've looked up both and I don't understand the difference. I think I need open collector so that's what I ordered.


I'm dipping into the world of microcontrollers and micro electronics. And I want to start with what I feel is a good entry level project.
I'm looking to convert an analog encoder to a 5v quadrature. The analog encoder produces a Sine wave with 2.2-2.7 volts peak to valley. It also puts out a 2.45v reference voltage that you can use to compare to. I did some reading and it sounds like using a voltage comparator circuit is the easiest way. Mainly a LM311 chip. Attached below is the circuit that I made along with the output from my scope. Looks like I'm really close to what I want. I will have to make three of these circuits for the A/B/Z channels of the encoder.
But I'm having a couple problems. First, I'm only getting around 3.7v output, Which is enough for TTL. More would be nice, but its not the end of the world. My cable run will be about a meter.
Second is the problem. My rise time on the square wave is around 20us. Max speed on this I need is 100khz which would be 10us peak to peak. So getting the speed down to at least 5us rise time I think will work. Faster is better for a cleaner signal. I have some 2n2222 transistors on the way, can I use those to speed up the circuit?
Lastly, this signal is going to be fed into a VFD. I have the option of Open Collector or Line Driver. I've looked up both and I don't understand the difference. I think I need open collector so that's what I ordered.

