So what the heck is going on inside the 555 timer? Well here are a couple of schematics from the National Semiconductor datasheet to help explain it.
In the first picture we can see that there are two comparators, one on the trigger pin and one on the threshold pin. We can also see that they are connected to a voltage divider. One input of the Threshold comparator is at 2/3 Vcc and one input of the Trigger comparator is at 1/3 Vcc. The outputs of the comparators lead to a flip flop. Although it doesn't say on the image, the flip flop happens to be a SR flip flop. From the flip flop there is the output stage which leads to the output pin and the transistor that controls the discharge.These are the basic parts of the 555 timer.
This is the basic theory of operation:
When the trigger voltage goes below 1/3 Vcc (its reference voltage) the comparator Sets the flip flop, which pulls the output high and turns off the discharge. When the threshold swings higher than 2/3 Vcc (its reference voltage) the comparator Resets the flip flop, which pulls the output low and turns the discharge on. This basic operation allows the 555 timer to operate in various ways with various configurations.
I don't want to get into all of the ins and outs of how the 555 timer works, so if you know, great! If you don't know here is a good tutorial with lots of theory and operation information
. It is my personal favorite.
If we look at the schematic diagram in the datasheet (second image), we can see what is actually happening inside the chip. The comparators are differential amplifiers, or long tailed pairs with a few added components to increase gain and sensitivity. The differential amplifier is the basis of the comparator, it greatly amplifies the difference in voltage to the point where millivolt differences result in rail to rail swings (voltage swings between 0v and Vcc). What's interesting here is that the threshold comparator uses NPN transistors whereas the trigger comparator uses PNP transistors. I don't know if that has an effect on the operation, but I just kept them like that in my circuit. The threshold comparator also has several extra transistors not present in the trigger comparator, along with a slightly different configuration. They perform the same function though, so I just replicated the trigger comparator but using NPNs instead.
The flip flop circuit is rather interesting. There is a lot going on for what is just a SR flip flop with a second force reset. That can be made with 3 transistors so I discarded that circuit and made my own.
The output driver is fairly simple. It is composed of two transistors, with the signal to one inverted so that when one is on, the other is off. This allows the output to operate in push-pull mode. This means that the output can source current, the output is shorted to Vcc, when it is high and sink current, the output is shorted to ground, when it is low.