I'm trying to use the output of the following transistor circuit as an input for XOR gate. It doesn't seem to work, I'm out of ideas. Any help would be appreciated.
It would be interesting if you set up a pull-up resistor in the transistor collector, that would make your circuit work properly.
What happens in your circuit is that the transistor collector is floating, so you´ll have problems to work the XOR gate.
Figure 1. Correct application of the pull-up resistor.
Response to comment:
I want the circuit to work the other way, when transistor is on logic gate's input becomes high.
Figure 2. To eliminate the inversion caused by Q1 just eliminate it. R4 is required to pull the input low when the switch opens.