Today we'll turn our attention to yet another dedicated purpose chip: the 555 timer. While not the newest or fanciest way of generating signals, it is cheap, reliable, and well-known. While they're kind of a meme in the world of hobbyist electronics, you can do some surprisingly cool things with them like drive ultrasonic transducers to levitate things or amplify signals as part of a geiger counter. Or you can do less cool things like turn a disposable vape into a Synthesizer. People are still coming up with new uses for them, such as a 1MHz voltage to frequency converter. Whatever the case, let's dig into what the chip does.
The 555 timer is an integrated circuit (IC) that is primarily used to make square waves of a known frequency. It is a powered device, and therefore requires connections from pin 1 to ground and from pin 8 to a supply voltage ($V_{CC}$, typically +5 V) in order to function.
Many integrated circuits are fabricated on essentially a 2d piece of silicon. The way we interface our pin connections to that silicon is often done by bonding tiny gold wires to pads at the edge of the silicon. To avoid having wires cross one another (which could result in unexpected shorts), they're typically connected to whatever pin is closest physically. Since chips are typically manufactured at a massive scale, it is usually worth it to design a compact circuit in silicon that doesn't match up to human conventions in order to save space. More chips per cm${}^2$ means faster production and lower costs. All this is to the best knowledge of the author; there may well be other reasons for this design choice as well.
The 555 timer has two states: on and off.
The 555 timer has two inputs, the trigger ($\overline{\mathrm{TR}}$ ) and the threshold ($\mathrm{TH}$), which are typically wired together. The values of these inputs are compared to specific voltages, and the outcomes of these comparisons determine whether or not the 555 timer changes state.
Although the threshold and trigger voltages may change the 555 timer’s state, there is no current in or out of either pin (since they effectively have infinite input impedance). There may, however, be current at the other four pins, depending on the configuration. The reset ($\mathrm{R}$) pin will disable or reset the timer if it is at ground or lower, so it generally is tied to $V_{CC}$ to prevent unwanted behavior.
If you want some practice thinking through the logic of how this works, there is a tutorial exercise available here. This was meant to be done in class as guided practice, but it could still be useful on its own.
There's not a whole lot I can add here, this is already the best intro I've come up with. I will note that the diagrams shown here shuffle the order of the pins compared to their physical layout; this is in order to make for more easily readable circuit diagrams as we'll see shortly.
If you want to run through tutorial solutions, I've got them attached here: em_555tutorial_capacitors.docx
This is, again, a lot for students to digest, as now we're talking about state dependent behavior. There are diagrams that have some more detail but they probably wouldn't be much help at this stage because they include flip-flops, which we haven't discussed yet.
You might ask yourself why we're introducing new chips, if we can accomplish the same thing with other components we already know how to use. The answer is twofold: specialized parts tend to do the job better than general ones, and we'd like you to get comfortable learning about how to go about using new components and learning about them from their descriptions and datasheets. There are thousands upon thousands of different devices out there that can accomplish lots of useful tasks without the need to design a system from scratch, such as the SN74LS247N
which makes driving seven segment displays easy, to the MMA8452Q triple-axis accelerometer, which can be used to tell what direction something is facing or if a device is falling. Modern circuit design is often a mix of finding the right parts for the job and then adapting them to the situation at hand.
Alright, now that we've talked about what the chip's designed to do, we'll put it to work making an oscillator for us.
Let's start with a couple of predictions (If you did the tutorial these will be familiar). Assume the chip initially starts in the on state.
How long will it take the capacitor to charge up to the threshold voltage $\left(\frac{2}{3}V_{CC}\right)$?
After the chip is off, how long will it take the capacitor to discharge enough to turn the chip back on?
Finally, how long will it take in the next cycle for the capacitor to charge from $\frac{1}{3}V_{CC}$ to $\frac{2}{3}V_{CC}$ ?
If the chip is on, there's no path fur current through the discharge pin D. To build up a charge of $2/3V_{CC}$ across the capacitor we can use the charging equation:
$V_C= \frac{2}{3}V_{CC}= V_{CC}(1-e^\frac{-t}{RC})$
Long story short, we'll end up solving for when $\frac{1}{3} = e^\frac{-t}{RC}$, or $-ln(\frac{1}{3})*RC = t$
For our components, this happens at $t \approx 2k*0.1\mu*1.1 = 220\mu s$
To discharge the capacitor enough to turn on again, we can use the discharge equation with a little modification:
$V_C= \Delta$ where $-RC * ln\left(\frac{1}{2}\right) = t$
We're looking for when $V_C = \frac{1}{3} V_{CC}$; using this we get $-RC * ln\left(\frac{1}{2}\right) = t$
When discharging, the only relevant current will be through $R_2$ to pin D since the voltage at D is set.
$t = .7 *1k *0.1\mu = 70 \mu s$
Finally, when charging, we have to use a modified charging equation again:
$V_C= \Delta V_{CC}(1-e^\frac{-t}{RC})$
I'll handwave things again to get to the same relationship as the discharging equation (see the tutorial for more info):
$-RC * ln\left(\frac{1}{2}\right) = t$
When charging, there will be current through both resistors, so the time taken will be:
$t = .7 *2k *0.1\mu = 140 \mu s$
The period is found from adding the charging/discharging times together, getting us 210 𝜇s
If you get stuck, look at the “Astable Operation” section (7.4.2) of the datasheet. lm555.pdf Their schematic is drawn differently, but it has the same topology and thus the circuit is the same)
What is the resulting period of oscillation for this circuit's output?
Now that you have some idea of how the circuit works (or are thoroughly flummoxed), build it on your breadboard so that you can test it. Note that we don't do anything with pins 4 or 5 for now; that's coming up later.
$V_{out}$ should be an asymmetric square wave between 0V and 5V, spending 1/3 of the time low and 2/3 high.
$V_C$ will oscillate between $\frac{1}{3}V_{CC}$ and $\frac{2}{3}V_{CC}$, spending twice as large charging as discharging. It will look sort of triangle-ish, but since this is caused by stitching exponential together it'll be a bit like a series of shark fins.
Characterize the signals you see at both $V_{out}$ and across the capacitor, $V_C$. Do they behave as expected?
Connect your piezo speaker (shown below) with an inline resistor between $V_{out}$ and ground to listen to the dulcet tones of your circuit. I'd suggest using a wire you can easily disconnect when wiring this, especially if you don't want your classmates to disconnect it percussively.
Square waves sound awful, hence the warning.
Your signal will be distorted somewhat when you attach your speaker, but the effect will be greatly mitigated with the 10$\Omega$ resistor inline with it. This also results in the sound volume being reduced greatly, as you're effectively making about a 10:1 voltage divider. A properly designed transistor circuit would be able to boost the volume substantially, if you want to experiment with this sort of thing in your copious free time.
What do you hear when the speaker is connected?
Predict how the frequency of the sound would change (increase or decrease) if $R_2$ were replaced with a 2.2k resistor
It should make an annoying buzzing at a frequency of 4.7kHz
Increasing $R_2$ will increase both the charging and discharging times, which will result in lowering the frequency of the sound heard.
Test your prediction and resolve any discrepancies.
Keep your circuit built, you'll be modifying it throughout the lab.
As you noticed, you get a somewhat lopsided square wave out of this circuit, because the capacitor charges through both resistors but only discharges through $R_2$. To fix this, we can use our good friend the diode (Use a 1N914, the smaller ones) to make it so that the capacitor charges through $R_1$ and discharges through $R_2$, letting us create a wider array of signals.
A modified circuit that allows for more flexibility in waveform. Note that the diode will result in slightly slower charging through $R_1$ due to the 0.6 V drop.
Modify your circuit by adding a diode, and observe its behavior.
What effect did adding the diode have on the output's waveform (without the speaker attached)?
What effect did adding the diode have on the speaker's sound?
The diode will make it so that $R_2$ is bypassed when the capacitor is charging, resulting in it taking less time to charge up and thus increasing the output frequency.
I will note that it would charge slightly slower since there's a voltage drop over the diode, but that's a much smaller change than the addition of the diode itself.
Remember that pin 5 that we told you not to worry about before? It is the control pin, and it is used to modify the typical trigger and threshold settings by altering a voltage divider circuit. If we feed a different voltage threshold, then when our input signal is low it will result in the capacitor charging to a lower voltage, (causing quicker oscillations) and when it is higher it will take the capacitor longer to charge, resulting in slower oscillations.
See the Wikipedia page or page 3 of the datasheet for a schematic of the internals. In both diagrams, there's a voltage divider made from three resistors. The threshold and trigger pins are compared to the to 2/3 and 1/3 of the power rail voltage via comparators. We'll get to flip-flops and inverts in later weeks, but for now we'll focus on how the control pin connects directly to the voltage divider / inverting input of a comparator.
Use the function generator's DC setting for $V_{in}$, with the voltage set between between 1 V and 4 V. (Why? Because it behaves fairly well in this regime.)
Do your tests support the idea that higher control voltages lead to the output staying high longer?
The control pin acts to replace the usual 2/3 VCC and 1/3 VCC upper / lower thresholds for the chip changing states, with the high limit being the control voltage and the low threshold being half of that. Since the capacitor is still being charged by 5V (via R1 and R2), this will result in it hitting the thresholds faster for low control voltages and thus changing state more frequently. We removed the diode because it makes the relationship between control voltage and discharge time non-linear due to that 0.6V threshold.
Set the function generator to make a 10 Hz, 300mV peak-to-peak square wave with a 3.333V Offset, but leave it off for the moment
Predict what parts of the square wave will correspond to higher/lower frequencies.
When the input is above 3.33 V, it should increase the threshold for changing states, resulting in a higher period (and thus lower frequency).
When lower, the threshold will be decreased, resulting in a higher frequency.
This should result in the output signal alternating between two different frequencies, swapping over every 100 ms.
To make observations a little easier, set the scope to trigger off of the function generator's square wave signal on channel 2. Since it'll be relatively small and riding on top of a large DC offset, the following will help:
2 button and use the top softkey to change the coupling to ACTrigger Menu:Type to EdgeSource to Ch2more option at the bottom of the screenCoupling to HF Reject This should let you look at just the AC parts of your modulating signal (i.e. a 300 mV pk-pk square wave) and set it so that the trigger ignores any sudden spikes on the signal to make things stable.
Test your circuit, and resolve any discrepancies between your predictions and observations.
What happens when you change the frequency and amplitude of the modulating signal?
Changing the amplitude should result in a larger change in the frequency shifts.
Changing the frequency would change how often the behavior is altered, making the alternation between frequencies slower or faster. As long as it is reasonably lower frequency than the signal its modulating not a whole lot should happen.
Yes, this is kind of hand-wavey.
If you want to observe this, look at the FFT output of the 555 timer on a timescale of around 2.5 kHz. With the modulation off, there should be a sharp peak right around 4.5 kHz. When you turn on the modulating signal of 10 Hz, 0.3 V pk-pk, and 3.333 V offset, the single peak will be split into a pair separated by around 500 Hz. As you change the modulation frequency in the low end (i.e. 1s or 10s of Hz), not much happens. Eventually (around 60 Hz) some harmonics will start making their way onto the FFT and they'll quickly swamp out the signal.
On the other hand, if you start increasing the amplitude, the frequency spit will increase. Around 1V gets a split of a bit under 2 kHz. You'll also see a larger shift in the 2nd order harmonic corresponding to around 3.6 kHz
Finally, let's try using the speaker to listen to the output signal. Note that this will alter it somewhat; speakers take some work to use without loading other circuitry due to their small resistance and significant inductance.
To test the difference the modulating signal makes, turn the function generator output on or off.
What difference does the modulating signal make?
In this case, the modulated carrier signal has the frequency altered by our control signal. With the original settings, the control signal will cause the output to switch between two different frequencies 10 times a second.
This technique is also know as Frequency-Shift Keying (FSK). It was one way of making early Morse code signals more robust, and a modified version of it is used for Bluetooth devices to send binary data robustly.
You can also try changing the frequency and amplitude of the modulating signal.
You can also modulate the modulating signal for even more strangeness! For instance, try setting the Modulation to AM. Use a Mod. Freq of 0.5 Hz or even slower, then set the waveform to a Triangle. This will cause your modulating signal to have a diamond shaped envelope, which will subsequently cause your 555 timer's output frequency to sweep up and down.
To make Anxiety: the Noise, set a frequency sweep to 30s sweep time, 1 Hz (not kHz) start and 10 Hz stop.
By modulating one signal with another, you can send information much more reliably than you could with a pure analog signal. If you transmit a low-amplitude analog signal, you're likely to pick up a lot of unwanted noise along the way. But, if you use that signal to modulate a square wave, you can keep (much) of the same information while having to worry a lot less about noise, because we've essentially encoded the amplitude of our original signal as a frequency in our carrier.
In physics, sometimes we'll generate signals that are modulated in a similar manner, such as from a Surface Acoustic Wave (SAW) sensor. These sensors will reflect back signals of a certain frequency with modifications based on their physical parameters, and can be used for things like high temperature thermometers that don't need wires running directly to them.
You've probably noticed that the output for your circuit can jitter about in some odd ways on the scope, and that its hard to observe sometimes. Since scopes are mostly designed for signals with a single, known period, combinations will always prove problematic. We got around this a bit by judicious triggering settings, but there's another option. These scopes have a built-in Fast Fourier Transform FFT function, which will let us get information about the frequency components of our signals even when they're hard to observe otherwise.
Turn off the function generator input to start with, and press the FFT button (just left of channel 1). Make sure the “source” is set to whichever channel is hooked up to your circuit's output. You'll want to turn the scale knob counter-clockwise to adjust the frequency space that's being shown until it is at 2.5 kHz per major tick (see the images below)
The Fourier transform display is a plot of the amplitudes of different frequency components of your signal. For a pure sine wave, you'll expect to see a sharp peak at a single frequency (middle) and then some low amplitude noise. Since the 555 timer circuit generates a few kHz square wave, the largest component will be the first peak shown, followed by some higher-order components.
Your mileage may vary depending on how you've set up your system. The most useful things to do here are to change settings while listening to the audio output, and also going back and forth between the $V$ vs $t$ view and FFT to get an idea of how they're correlated.
Our scope is not designed for doing sophisticated analysis via FFT. For that you'd want a dedicated spectrum analyzer, which is a much more niche tool. As such, there's a bit of an art to selecting an appropriate frequency binning. Don't agonize over the this last section too much, we primarily want you to learn a bit about how you can get information from an FFT that you can't easily see from the normal operational mode of the scope.
The strongest component should correspond to the frequency we've seen for the 555 circuit thus far, around 4-5kHz or so.
On adding the modulating signal, we'll see the input split into two prominent frequencies.
Increasing the amplitude of the modulation signal should result in a larger frequency split
Portions of this page are adapted from “Flexible Resources for Analog Electronics” by Stetzer and Van De Bogart.