# How to design a square wave inverter circuit without an op amp

I am using an NE555 timer circuit to generate a 0 to 12 volt 10kHz square wave.

I would like to invert that square wave (so inverted signal is 0 when original is 12V and 12V when the original is 0 V.)

I used an NPN transistor that creates a distorted inverted wave.

Is there a simple way to make a clean inverter circuit for this AC signal?

Here are pictures of the circuit and output:

• Question: what do you think Q1 does? Commented Mar 25, 2021 at 18:32
• Replace the transistor with an inverter? Commented Mar 25, 2021 at 18:36
• @user758469 No, I don't mean an op-amp, as you specifically said you did not want an op-amp. Commented Mar 25, 2021 at 18:39
• @user758469 exactly, you got that one right, but you've got to realize that the reason for the "roundness" in your curve is due to the things around Q1 (and Q1 itself). Commented Mar 25, 2021 at 18:40
• Might help if you explained why you are doing this. Commented Mar 25, 2021 at 18:42

Here is what I get with the 2N3904 driven with a clean 12V square wave (note that the 555 model is not very accurate, but that doesn't matter here). Collector is open except for the 10K resistor to +12:

There is a slight delay in the rise due to charge storage effects but no such waveform.

Is there a hidden capacitor or probe model or something of that ilk not shown? It would take a huge capacitance (~10nF) to cause that effect.

Here is the simple circuit:

Version 4
SHEET 1 880 680
WIRE 400 16 288 16
WIRE 288 128 288 96
WIRE 672 128 288 128
WIRE 288 144 288 128
WIRE 400 144 400 16
WIRE 80 192 64 192
WIRE 128 192 80 192
WIRE 224 192 208 192
WIRE 64 208 64 192
FLAG 288 240 0
FLAG 400 224 0
FLAG 64 288 0
FLAG 288 128 Vcollector
FLAG 80 192 Vin
FLAG 672 192 0
SYMBOL res 224 176 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL res 272 0 R0
SYMATTR InstName R2
SYMATTR Value 1K
SYMBOL voltage 400 128 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value 12
SYMBOL voltage 64 192 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value PULSE(0 12 10n 10n 10n 50u 100u)
SYMBOL npn 224 144 R0
SYMATTR InstName Q1
SYMATTR Value 2N3904
SYMBOL cap 656 128 R0
SYMATTR InstName C1
SYMATTR Value 10n
TEXT 30 312 Left 2 !.tran 300u

• I am not sure; I just right-clicked on the transistor and chose the model directly from LTSPice. IS that what you did? Commented Mar 25, 2021 at 18:53
• Yes, it's the default model npn->2N3904 which is the NXP model .model 2N3904 NPN(IS=1E-14 VAF=100 Bf=300 IKF=0.4 XTB=1.5 BR=4 CJC=4E-12 CJE=8E-12 RB=20 RC=0.1 RE=0.1 TR=250E-9 TF=350E-12 ITF=1 VTF=2 XTF=3 Vceo=40 Icrating=200m mfg=NXP) Commented Mar 25, 2021 at 18:56
• ok I will try simulating again Commented Mar 25, 2021 at 18:56
• You can save the above as an .asc file and open it directly. Commented Mar 25, 2021 at 18:58
• If you have the gate of a hidden MOSFET connected to the inverter output, that would explain your results 100%. You have the models there- why? Commented Mar 25, 2021 at 19:02