# How to adjust the amplitude of the square wave?

#### circuitnaiver

Joined Oct 1, 2021
22
Hello, guys,

I have a circuit design to output the +6V and -12V square wave with the input 0V and 6V. Vout is connected to the oscliscope.

One of my friends designed this circuit. But it does not work in the simulation. Can anyone help me out with this?

Thank you~

#### crutschow

Joined Mar 14, 2008
28,161
Are you constrained to 6V and -12V supplies or can they be higher voltages?

What should be the output voltage for 0V input?

Last edited:

#### MrChips

Joined Oct 2, 2009
24,609
Change V2 to -6V.

#### circuitnaiver

Joined Oct 1, 2021
22
Are you constrained to 6V and -12V supplies or can they be higher voltages?
No, higher voltage supplies can also be used. But the ideal case is that we only single supply, like 6V directly from the input source without any added power supply.

#### circuitnaiver

Joined Oct 1, 2021
22
Can anyone explain to me the function of R11? Why do we use a 1M ohm resistor here?

#### circuitnaiver

Joined Oct 1, 2021
22

#### dl324

Joined Mar 30, 2015
13,505
Can anyone explain to me the function of R11? Why do we use a 1M ohm resistor here?
Is this school work?

#### circuitnaiver

Joined Oct 1, 2021
22

#### crutschow

Joined Mar 14, 2008
28,161
But the ideal case is that we only single supply, like 6V directly from the input source without any added power supply.
That's not ideal, that's impossible.
How do you expect to get -12V from a +6V supply.
An opamp can only output no more that its supply voltages.

If this is school work, why are you using someone else's design?
Shouldn't you be doing your own?

I have a design that does what you want using only 4 resistors and the opamp, but you need to demonstrate some understanding of op amps circuits before I will post that.

Last edited:

#### circuitnaiver

Joined Oct 1, 2021
22
That's not ideal, that's impossible.
How do you expect to get -12V from a +6V supply.
An opamp can only output no more that its supply voltages.

If this is school work, why are you using someone else's design?
Shouldn't you be doing your own?

I have a design that does what you want using only 4 resistors and the opamp, but you need to demonstrate some understanding of op amps circuits before I will post that.
I think I understand how it works. The Op amp can work as a comparator by comparing one analog voltage level with another analog voltage level. Something work as follows:

#### crutschow

Joined Mar 14, 2008
28,161
The Op amp can work as a comparator
Yes, it can if you just want two output levels.
If you want the output to go to the power supply rails, then you need a rail-rail type op amp.

#### dcbingaman

Joined Jun 30, 2021
495
Hello, guys,

I have a circuit design to output the +6V and -12V square wave with the input 0V and 6V. Vout is connected to the oscliscope.

View attachment 249231

One of my friends designed this circuit. But it does not work in the simulation. Can anyone help me out with this?

Thank you~
You can accomplish the goal also with 2 BJT transistors and a few resistors. Because this is homework, can't provide solution but something to think about.

#### crutschow

Joined Mar 14, 2008
28,161
You can accomplish the goal also with 2 BJT transistors and a few resistors.
That will give a +6V output for a 0V input and a -12V output for a +6V input?

#### dcbingaman

Joined Jun 30, 2021
495
That will give a +6V output for a 0V input and a -12V output for a +6V input?
Assuming we have a +6V supply and a -12V supply. I was thinking the other way around: 0V goes to -12V and +6V goes to +6V.

#### crutschow

Joined Mar 14, 2008
28,161
I was thinking the other way around: 0V goes to -12V and +6V goes to +6V.
Yes, I see that his original circuit uses the non-inverting input for the signal, so that would be the polarity you are thinking.