A N mosfet with the source connected to the gnd and a resistor from the drain to the +5v.
Connect the input in the gate, when +12 the mosfet will turn on and the drain will output 0, when the input is -12 the mosfet will turn off and the drain resistor will work as a pullup and the output will be 5v.
You never mentioned the rate of the pulses, if the speed needs to be high then you may also need some mosfet driver for fast switching.
A N mosfet with the source connected to the gnd and a resistor from the drain to the +5v.
Connect the input in the gate, when +12 the mosfet will turn on and the drain will output 0, when the input is -12 the mosfet will turn off and the drain resistor will work as a pullup and the output will be 5v.
You never mentioned the rate of the pulses, if the speed needs to be high then you may also need some mosfet driver for fast switching.
Thanks for the reply! Sorry, I forgot to mention that it needs to be fairly linear, because the 0-5V is going into an 8-bit ADC. The signal I need to be able to discriminate among approximately -12/-6/-3/0/+3/+6/+12 with a 1KHz signal.
I hooked it up exactly that way, except that I used 10K/50K. What's a good rule of thumb for picking the resistor values for these kinds of op amp circuits? And can you tell me what software you used to create the diagram? Thanks again.
You can use any simulator to get the same results, the one in my picture is proteus.
I didn't use the specific values on purpose, I have just used a 5/1 ratio, a higher resistance (50K/10K) will increase the input resistance which would help if you have a source with a high output impedance but other than that I can't guide you which values to use or the proper way to choose them.