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. Let's dig into what it 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.
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 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.
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.
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
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?
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 datasheetfor 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?
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.
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 AC
Trigger
Menu
:Type
to Edge
Source
to Ch2
more
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?
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?
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.
Portions of this page are adapted from “Flexible Resources for Analog Electronics” by Stetzer and Van De Bogart.