lincomatic
Newbie level 4

What's the best way to level shift a signal with a +/-12V voltage swing to 0->5V?
Many thanks in advance.
Many thanks in advance.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Did you consider using an FET?
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.
Alex
This is the schematic and the result, blue is input +-12 (to test I have used a sinusoidal 24v p-p), and red is the output (0-4.8v)
View attachment 58195
Alex