(upbeat music)
- Welcome, and today we are on the fourth
and final tutorial on our 555 tutorial mini series.
So we are going to talk about the astable configuration
which as I've discussed in the previous tutorials
basically means that in this configuration
the output of the 555 timer does not have
a stable place that it wants to settle.
And so it oscillates back and forth, back and forth
creating a controllable square wave.
So you can change it by changing out your capacitor
and your resistor values and doing stuff like that
and create a pretty decent square wave.
So that's pretty exciting.
So this is actually one of the more common,
actually, they're all pretty common.
So I don't know if I can say that,
but it seems like one of the more common configurations
for the 555 timer.
And it's not as simple as the bistable configuration
but it's not as complex to understand
what's going on as the monostable configuration.
So we'll go over that pretty quick
and it should be quite straightforward.
Now, you would want to use this for creating any square wave
whether that's little trinkets
that you wanna create noise with, that tone generators.
I've seen tutorials on metronomes
that you can vary the speed of the metronome
things like that by changing the resistance
using a variable resistor, all sorts of applications.
So the astable configuration is just basically a way
without using an Arduino or a microcontroller
or more complex analog circuits, a way to create
an easily controllable square wave generator.
So let's jump into how the a astable 555 timer configuration
is set up, kinda look at it a little bit
and then we'll jump into our practical
where we will see it in action
see how it matches up with reality.
And in this case, for some reason
it doesn't match up with reality.
We'll talk about that a little bit
and some of the reasons why I think that is.
But first, let's talk about the pinout configuration.
So, okay, so unlike our buy bistable configuration
we are not going to be attaching a reset to anything.
It's just tied directly to VCC
so that we don't accidentally reset things.
So really bistable is the only configuration
that had, one that used the reset pin
as an integral part of what it was doing.
And then you have your typical power and ground
and then for five, that control.
we don't want to override the two-thirds VCC setting.
So a five is just tied to ground
via capacitor to get rid of noise, no problem.
And then our output number three.
So all of the boring stuff
is on the right side of this pinout
and the more interesting stuff is on the left side.
Now, the most interesting thing to note here
is that pins two and six
which are the trigger and the threshold are tied together.
And that is where you get that instability
is because if you remember
those are tied together on the inside
and we'll jump into that in just a second.
And so that is where you get some of those challenges
because you'll cross one threshold
be in kind of a no man's land,
and then cross another threshold
that will cause it to change states
and then it'll switch
and then it'll be in another threshold.
So most of the interesting stuff happens
due to the fact that two and six are combined.
Now you can see here pin seven, that discharge,
that capacitor discharge pin is coming into play
just like we saw with the monostable configuration.
And then we have these two resistors and our capacitance.
And it is by changing these resistors
and this capacitor that you can set the frequency
you can set the duty cycle
and you can change everything that you want
by varying those, you can make them all bigger,
make them all smaller make R1 bigger, make R2 bigger.
And I will just, spoiler alert,
talk about how the discharge BJT
the internal BJT can affect our RC calculations.
Okay, so with that, let's jump into what things look like
when we first start up.
So in this astable configuration,
let's look at it now that we can see the internals,
we can see that the trigger is connected
to the lower inverting input and threshold is connected
to our non-inverting upper comparator input.
So we will assume that it's reset and the output is low.
And right now when we just hooked everything up
we've got VCC and it's high obviously
and we have this capacitor C1 that's still at zero volts.
So with that being at zero volts
then our inverting input is below our non-inverting input.
So our input to the set pin is high
whereas since it's low up here you'll see
that the zero volts basically is going
to be below two-thirds VCC, whatever that happens to be.
And so our reset is low.
And so as we all know, I at least I keep a handy dandy
I keep a pen on the floor now.
I keep a really short truth table to quickly reference
because I don't have all of this stuff memorized.
But now that we know that set is one and reset is zero
the output of Q is going to be one,
Qbar is going to be zero and it's gonna be inverted.
So since Qbar is low, the output will be high.
So that is when we first start out
we have that reset immediately
it flips up high because C1 is low
which makes this inverting input lower
than the non-inverting input.
So S is high.
And then we have the opposite on the top comparator.
So the R is low, and so we get a high output on Q.
So that is our first state.
Now the interesting thing is this is our starting state.
We'll never get back to this state again
as long as it's running.
So this is our, we're starting at zero
getting up into the oscillatory states
that we're looking for.
So with that, let's jump to our next state.
Now we are looking at our capacitor charging.
So C1 was at zero volts, I had nothing over it,
no voltage over it, but eventually C1 will hit a point
where it is a higher voltage than one-third VCC.
So this lower comparator will actually output a zero.
Now looking at our handy dandy truth table
with S and R being zero, we have a memory state.
So our output is still high, our queue is still high
and our total output is still high.
So there's this point where even though our voltage
has raised up enough to change the outputs
of these comparators
it doesn't change the output of our SR flip-flop.
So we still haven't quite hit the point
where we get into the regular oscillations.
Okay, now C1, our capacitor fills up to above two-thirds VCC
and the top most comparator flips
where the non-inverting input is now higher
than the inverting input here at two-thirds VCC.
And we are outputting a one which makes R our reset
and our SR flip-flop go high, which makes Q go down
and Qbar go high, which makes our output low.
Again, the 555 timer is so confusing
because it's like this goes high
which causes this, this, so don't,
even though I'm going into that sort of detail
don't let it overwhelm you.
Again, the most important things
are what's coming out at the end.
So in this case, we have finally gotten into the first part
of a state that is going to be seeing over and over again
as it's going up and down with the output
but we have now officially dropped our output low
because our non-inverting input
to our uppermost comparator has gone high.
Now, if you remember from the monostable configuration
what happens when the Qbar goes high?
Well, this BJT transistor
it starts to conduct because the base has a higher voltage
it starts to conduct a little bit
and we will see this capacitor start to discharge.
So let's go to the next state.
So now that Qbar is high
our capacitor almost immediately starts to discharge.
However, there are two things that are stopping it.
One is R2, and that's the overwhelming portion
that you should consider.
And then two, it is the resistance of this BJT.
Now, this is the thing,
I set this up to have 100 ohms for R1 and R2.
And because that is a low enough resistance,
lower than the recommendation, to be honest
this resistance of the BJT comes into account
and messes up my timing, which is kind of interesting.
If my resistance and my capacitance were a different values
than the internal resistance of the BJT would be low enough
that it would be negligible.
But because I'm using 100 ohms
instead of at least a thousand or 10,000 ohms
like I probably should be doing,
this becomes a problem.
So that's something to think about.
Now, going back to where we are in this flow,
we have now started to discharge our capacitor through R2
and the BJT transistor until we move to the next state.
We are going to the point where the capacitor
has a low enough voltage that our inverting input
on our lower comparator is below the one-third VCC input
of our non-inverting input for that lower comparator.
And due to that, it makes the input to our set pin
on our SR flip-flop go high, which makes Q go high.
And we just started the process over again.
Now it goes high, Qbar goes low
the BJT transistor shuts off
and the capacitor starts to charge again.
So we just oscillate between these states,
capacitor being high enough that the output's low
the capacitor discharging,
capacitor being low enough that the output's high
through over and over and over again,
never stabilizing, thus the astable configuration.
Now the reason that this BJT transistor may affect things
in the timing of all of this is because the width
of the high cycle and the width of the low cycle
are dependent entirely on the RC timing.
So for it to be high
you have the equation where the high output
lasts as long as 0.693 times R1 plus R2
times the capacitance.
And now when you're doing this
the high width that is not at all dependent
on that transistor because it is purely coming
from VCC down through R1 through R2
and filling up the capacitor.
And so that makes sense.
So again, 0.693 times R1 plus R2 times the capacitance.
Now for us, it's just a hundred ohms times a hundred ohms
excuse me, hundred ohms plus a hundred ohms so 200
times what we have here is 0.1 micro farads times 0.693.
Now, I did the math and I'm going to do it again
because it went away,
but we should come out with about 13.86 seconds
for the high pulse of our square wave
due to what I have here.
Now, let's just assume that's a 50% duty cycle.
And so we would expect something around 30,
what am I saying here?
Yeah, around 30 microseconds
for the entire period if we did this.
Now, if I wanted that to be a shorter period
I could use even smaller capacitance
and well I shouldn't use smaller resistors
but I should use significantly smaller capacitors
and then bump up my resistors.
So I have a little bit more of what I want there.
And that's how you change the frequency,
is changing the capacitors and the resistance.
Now, if you want to change the width of the height
versus the low part, change the duty cycle, for example.
The better way to say it is you can change
either R1 or R2 because the equation
for the low length of time is actually the same,
0.6 93 times R2 only times the capacitance.
Now you'll know it's something interesting there,
is that with this setup
you will never ever get less than a 50% duty cycle
because your low will always be shorter than your high
because you can't have a negative resistance
not at least in what we're dealing with here.
And so whenever you put in that second resistor
it's gonna make that time constant longer.
So you should always expect a longer rise time
because you're trying to get that current
through both resistors and a shorter drop off time
because you're just going through R2 and the transistor.
So this is again, where the BJT transistor comes into play.
When that BGT transistor is on
it has a resistance and it affects this equation.
Now, again, if my resistances were a hundred thousand
and a hundred thousand ohms,
50 ohms of a really inefficient transistor,
it's not a big deal.
But since I'm dealing with a hundred ohms
that transistor plays a much bigger factor.
So now we've gone over the basic circuit diagram.
What the point is,
we've also talked about what's going on internally
as it's switching between those different states.
Now let's set up the camera
on the oscilloscope and actually show it in action.
And I'll show you also where that BJT transistor
causes issues with my timing.
All right, so I am providing seven volts to this circuit
which you can kind of see my settings
are about five volts per division.
So five volts, seven volts, that all looks good.
And both of these are at the same scale.
So that is some something important to note.
What I have here is the yellow is the output
from the 555 timer, and the blue is that capacitance,
the voltage over the capacitor, not the capacitance
I don't know why I said that,
it's the voltage over the capacitor that is charging
from one-third where you get that high voltage
to two-thirds where then it hits,
it drops to the low voltage
and is discharging through that discharge pin
on the 555 timer until it hits one-third VCC,
goes high, up and down, up and down all the way across.
Now, like I said, I expected the time,
the width right here of the positive to be about 13.86.
That was it, 13.86 microseconds
which 14.2 microseconds, not too shabby.
However, if I am to take out that 200
and change that to 100 because that's what it should be
then that shows that my low time should be,
6.93 microseconds, 6.93, and I'm at 25.2.
That is a huge difference.
So this is actually what raised some red flags
when I was doing this, oh my goodness what's going on here?
And I realized that if I am to take this,
if I were to take this, or if I am, I'm going to take this,
you can take this voltage and crank it from seven
up to the 15 volts that this is designed to take.
And you'll notice something very strange.
Let's go up to, alright, I'm about.
I'm almost a 15 now, 14.8-ish volts.
And look at that width, it dropped to 17.6 seconds.
Now this equation doesn't have any,
it doesn't have any voltage portion of it.
The voltage should not affect it at all.
It should not drop by eight microseconds
when I basically double the voltage.
And so what I think is going on here
is that I'm increasing that base voltage
at that BJT transistor.
And it is, well, I don't know if that's the correct term.
It's closing the transistor more.
It's decreasing that resistance, which is making it,
so it discharges the capacitor even faster
which is really fascinating.
And again, if I used a thousand ohms, 10,000 ohms,
something that I should have used
this wouldn't be playing a factor in it.
So that is something that you should pay attention to
when you're selecting the different values you have
for your 555 timer, is not only using a hundred ohms
make it so that that this dissipates more power
than necessary, it also is messing up the timing
because it has some real life issues
that it needs to overcome.
So I left this here even though I realized my mistake just
because I thought it was an interesting teaching moment.
So that's it.
That's the astable configuration of the 555 timer.
We've gone over the setup, the circuit diagram.
We've talked about what is going on internally.
We've talked about some of the real life things
that you should pay attention to
and why you shouldn't use the values that I used here.
We saw in action over here, I think that's fun.
It's always fun.
You know me, I love seeing things in action
seeing the real life applications.
If you did find this useful, fantastic.
Give this video a like if you haven't already
subscribe to our channel, all that good stuff
and we will catch you in the next one.
(Toaster thwacking)
- [Man] We hope that you enjoyed this tutorial.
Did you know that CircuitBread.com
has other useful engineering content?
In addition to many other features
we have study guides that cover a wide variety
of engineering topics
at a high level with equations and diagrams
to make it easy to quickly review and reference.
Go check 'em out.
(upbeat music)