I have a serial data signal that goes from 0 to 5V and I want to convert it to 0 to 12V. I'm using this circuit to amp/shift my 0-5V signal to 0-12V:
For some reasons it just doesn't work. The output @ the op amp is always 12V (my rail voltage is 12V). I know for sure that I have a signal @ the op amp "+" terminal.
I think using an op amp to voltage shift is probably not the best way but I still would like to know why it doesn't work. Is there something about digital signal that makes it not work with op amp?
I assume you mean 741. That is the problem. The input range of the 741. Is nowhere near the positive or negative voltage rails. With a better opamp it should work but as you say, an opamp is not the best way of level shifting a digital signal.
Instead of an opamp, wouldn't be easier to use a transistor working as an inverter? See attached picture ..
If you cascade tow of them you'll have data in the same phase ..
I don't have the 741 datasheet to hand but if you look at it you will find an input voltage range or common mode input range. This is the range of input voltage the opamp will work over. Outside that range it won't behave like an opamp. It is probably 3V or more from the voltage rails. So it will not work if the input is below 3V or above 9V when used with a 12V supply. Your circuit relies on the inputs going to 0V. Something like the LM324 may work - I think the input range includes the negative rail.