Continue to Site

# [SOLVED]+-12V to 0-5V Level Shifter

Status
Not open for further replies.

#### lincomatic

##### Newbie level 4
What's the best way to level shift a signal with a +/-12V voltage swing to 0->5V?

Did you consider using an FET?

Did you consider using an FET?

Yes, I've seen some FET level shifter circuits, but none that can handle conversion of a +- voltage swing to +.
Can you tell me how to do it? Thanks.

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

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

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.

Use a differential amplifier

If you apply an offset of 12v and set the gain to 1/5 then the (+12 to -12)+12 offset x1/5 will give 0-4.8v

Alex

lincomatic

### lincomatic

Points: 2
Perfect, Thanks!

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)

Alex

Points: 2

### jinantha

Points: 2
I expect an old RS-232 - TTL interface chip would do nicely, if this
is a digital application. I bet TI and National still make them.

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

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.

Alex

Points: 2

Points: 2