# Simulation discrepancy in 555 oscillator

I've been running the simulation of a certain circuit on falstad simulator. It's a simple square wave generator using 555 timer.

I've been trying to figure out the expected oscillation frequency, but there's a certain discrepancy between calculations and the simulation result. I would like to know where it comes from.

simulate this circuit – Schematic created using CircuitLab

Setting the potentiometer at the exact middle (i.e. $$\5\space \textrm{k}\Omega \$$ on both sides), the simulator gives 180 Hz; I calculated it to be around 208 Hz. Here's my calculation:

When OUTPUT is on and DISCHARGE pin is shut out, the capacitor is charged with $$\V_{cc}=5 \space \textrm V\$$ through one 1N4148 and two resistors that sum up to $$\6\space \textrm{k} \Omega\$$. This is effectively an RC circuit with $$\R=6\space \textrm{k}\Omega, \space C=500\space \textrm{nF}, V_{charge}=V_{cc}-V_{d}\$$, and the voltage goes from $$\\left(1/3\right)V_{cc}\$$ to $$\\left(2/3\right)V_{cc}\$$. Here, $$\V_d\$$ is the diode forward voltage drop, and the simulator says it ranges from 530 to 560 mV. Let's take 540 mV for convenience. The time required for charging is then:

$$t_{charge} = \ln \left( \frac{V_{charge}-(1/3)V_{cc}}{V_{charge}-(2/3)V_{cc}} \right) \cdot R \cdot C = 0.00272 \space \textrm{sec.}$$

When the capacitor voltage reaches $$\(2/3)V_{cc}\$$, it discharges again through one diode and two resistors that sum up to $$\6\space \textrm{k}\Omega\$$. It can thus be modeled with an RC circuit discharging, but the diode does not have an effect this time. The voltage is to be halved, and the time spent is:

$$t_{discharge} = \ln (2) \cdot R \cdot C = 0.00208\space \textrm{sec.}$$

The two figures suggest the frequency of 208.188 Hz and duty cycle 56.709%, which is quite at odds with the simulation result of 180 Hz and duty cycle 48-50%.

A few suspicions of mine would be:

• The simulator is inaccurately modeled.
• The forward voltage drop is handled wrongly in either of the charge/discharge.
• The diode does take part in discharging.
• The discharge pin was treated like a ground when discharging, but its open collector behavior is different from one.

However all these hypotheses exceed my knowledge. Can you spot what's wrong?

p.s. I'm trying to do this for PWM at 25 kHz. Do you think it's viable? I'm worried that the lower resistance and capacitance might consume more power and/or not switch on and off rapidly enough.

• Can you spot what's wrong? - basically your expectations. If you need an accurate frequency and duty cycle don't use a 666 timer. It's for good reason that I've called the chip a 666. Commented Jun 5, 2021 at 9:46
• also, 5V supply for a BJT 555 (like the NE555) is really on the edge. don't do that. Commented Jun 5, 2021 at 9:49
• I bet you want a PWM for e.g. a motor control application. We have specifically purpose-built ICs for that problem. They are nearly as cheap as a 555 + external components, often need nothing but a single decoupling capacitor to work, and are worlds more flexible. You'll know them under the name "microcontroller"; PWM generation and load control are really two of the very core features that even the cheapest microcontrollers can do, and guess what: the frequencies they can produce are way more accurate, typically, and easier to control. Commented Jun 5, 2021 at 9:52
• @Andyaka nice point, now I see that was off too. Commented Jun 5, 2021 at 9:58
• @MarcusMüller On the edge as being low, I suppose? / Yes, it's for a motor, and I deliberately tried to not use microcontrollers because, well, hipster reasons. Guess I'll steer back to Arduino world... Commented Jun 5, 2021 at 10:01