# How do I convert voltage from 0 to 5V into -9 to 9V

Discussion in 'General Electronics Chat' started by labelman, Jul 5, 2016.

1. ### labelman Thread Starter New Member

Jun 3, 2016
6
0
I'm trying to interface a 5V digital signal to drive an ultrasound transmitter. I've seen several approaches including this thread from a few years back.

My current circuit will only go from -3V to 8V and I don't understand how to debug it. I'm guessing it has to do with the voltage divider based reference. I don't need to operate in the linear region. Is there a simpler and better way to do this? I've also tried the circuit in the second attachment without success even though my LTSpice simulation gave the results I wanted. As you can tell my analog skills are really weak.

Any help would be appreciated.
Thanks,
Lane

2. ### #12 Expert

Nov 30, 2010
16,703
7,338
If you just want hard square waves, forget the finesse. Just let the op-amp slap the rails as hard as it can.

File size:
6.7 KB
Views:
16
3. ### labelman Thread Starter New Member

Jun 3, 2016
6
0
Thanks #12,
Except for the resistor on the input signal that's what I did (see my second circuit). Is the input signal resistor required? As I recall my circuit like my second drawing just stuck to one rail no matter the input value. From your circuit the input resistor is the only difference I see. I used 100k vs 1k resistors for the divider if that matters.
Lane

4. ### WBahn Moderator

Mar 31, 2012
18,087
4,917
First, note that the TL082 is not a rail-to-rail opamp. The closest you can count of coming to the rail is about 2 V. So if you are powering it from +/- 9 V then you can't count on anything better that about +/- 7V. But that still leaves the question of why you are only seeing -3 V.

In your first circuit, V4 is a pulse source, but V3's output is labeled "in", so which is your input signal?

5. ### wayneh Expert

Sep 9, 2010
12,388
3,244
Should work fine either way.

6. ### hp1729 Well-Known Member

Nov 23, 2015
2,098
232
Any standard RS232 driver will work. MAX232 even generates the + and - V.

• ###### MAX232.pdf
File size:
408.1 KB
Views:
4
Last edited: Jul 6, 2016
labelman likes this.
7. ### WBahn Moderator

Mar 31, 2012
18,087
4,917
True, though it will invert the signal, which may or may not matter.

@labelman; How much current does the ultrasound transmitter need? Be sure the opamp can deliver it.

8. ### labelman Thread Starter New Member

Jun 3, 2016
6
0
V4 is the source, V3 is mislabeled and is just for the reference voltage. I just happened to have a TL082 lying around so I thought I'd try it to prototype the idea. I definitely need a better choice.

9. ### labelman Thread Starter New Member

Jun 3, 2016
6
0
This is a great idea and I think I'll go this way, but I still want to make the other circuit work just so I learn something along the way. Thanks!

10. ### WBahn Moderator

Mar 31, 2012
18,087
4,917
So how much current does the ultrasound transmitter need?

11. ### dannyf Well-Known Member

Sep 13, 2015
2,196
417
Your circuit needs a gain of 18v / 5v.

So either amplify the input signal by that and then shift it, or to shift it first and then amplify it.

12. ### dannyf Well-Known Member

Sep 13, 2015
2,196
417
Your first circuit is quite close. Use a non inverting amplifier, set up the right gain. Terminal the resistor on the inverting end to a 2.5v source.

Done.

13. ### Kjeldgaard Member

Apr 7, 2016
73
17
If I understand the job right, then we have a 5V logic input signal and need a 18 Vpp output signal to drive a piezo element.

My idea then is a full bridge stage with a "good old" CMOS 4049 inverting buffer on a 9V supply:

The component values are my bid on something that can operate at 40 KHz and up to 200 KHz if the speedup capacitor on the base is present.

If the piezo element is with a large capacity may be needed to buffer further, perhaps emitter followers and slightly higher output supply voltage.

absf likes this.
14. ### labelman Thread Starter New Member

Jun 3, 2016
6
0
They require approx. 200mW so at 18V then around 12 ma

15. ### labelman Thread Starter New Member

Jun 3, 2016
6
0
Kjeldgaard, thanks for this idea. I'm going to try this too as a learning exercise. Lane

16. ### hp1729 Well-Known Member

Nov 23, 2015
2,098
232
MAX232 won't do it for you then. At 9 V out it is limited to about 2 mA or so.

17. ### WBahn Moderator

Mar 31, 2012
18,087
4,917
Thanks.

You might do a quick test and run the opamp open loop. Take just the opamp and put a voltage divider to produce 0V at the non-inverting input. Then tie the inverting input to the positive rail and see what the output is. Then tie it to the negative rail and see what the output is. That will give you the bounds for that particular opamp. If it only goes to -3 V, then you have a bad opamp.