This chapter explains how to use some of the most common electronic tools and test equipment. This includes both instruments for measurement such as multimeters and oscilloscopes and also simulation software that can be useful during design, especially when dealing with analog electronics.
To correctly use a lab power supply, follow these steps:
Aside from a multimeter, the lab power supply is probably the most useful piece of test equipment you can own. Owning one will save you vast amounts of time in the long run because you won’t have to hunt around for batteries and cobble together power supplies and reduce the chance of accidental destruction of components when prototyping.
Figure 21-1 shows a typical lab power supply capable of supplying up to 22V at 5A.
The top line of the display shows the voltage and the bottom, the current. When the output is off, the voltage knob allows you to set the voltage. The current knob sets the maximum current the circuit will be allowed to draw. If the circuit exceeds this, the power supply will automatically decrease the voltage until the current is below the set maximum. In this way, the power supply can be used as:
In addition to a single-output power supply like the one shown in Figure 21-1 dual-output power supplies are also available. These are very useful for analog circuits that require a split-voltage supply.
For information on building your power supplies of various sorts, see Chapter 7.
If you have an autoranging multimeter, simply set the meter to DC voltage and connect the probes across the voltage source.
If you have a multimeter where the range is set manually, determine the maximum voltage you expect to see and set the meter to the range whose maximum is above that value. Then connect the probe leads across the point in the circuit you want to measure.
Once you have established that the voltage is not too high for the range you selected, you can reduce the voltage range for better precision.
Figure 21-2 shows a typical medium-range digital multimeter (DMM).
Although an autoranging multimeter might seem to be superior to a multimeter where the range has to be set, in practice, it can be an advantage to think about what reading you are expecting to see before you take the reading (manually setting the range forces you to do this).
Even very low-cost DMMs generally provide better precision and accuracy than an analog meter. The principle advantage of an analog meter is that you may get a few more clues about what you are measuring if, for example, the tip of the meter’s needle jitters slightly to indicate noise, or you can see the rate of change of voltage as the speed of the meter moving in one direction or another. Some DMMs try to give you the best of both worlds by including an “analog” bargraph-type display in addition to the digital display.
For measuring AC voltage, see Recipe 21.3.
Follow the same procedure as Recipe 21.2 except set the multimeter range to AC volts rather than DC volts.
Since you are measuring AC you will get the same polarity of reading no matter how the leads are placed onto the circuit.
If you are planning to measure high-voltage AC ensure your meter probes are rated for high voltage. Also see Recipe 21.12.
Most DMMs will provide only an approximation of the RMS (root mean square) voltage by rectifying and smoothing it. Higher-end multimeters often include the feature “true RMS.”
For measuring DC voltages, see Recipe 21.2.
To use a multimeter to measure current:
DMMs measure the current flowing by measuring the voltage across a very low-value resistor. This is why you generally have to shift the probe leads to a different socket when measuring current.
If you leave the leads of the multimeter in their current measuring sockets and then go to measure voltage, you will effectively short-out the voltage you are trying to measure. This may damage the circuit or blow a fuse inside the multimeter.
To prevent this, always swap the leads back to their voltage-measuring positions when you are finished measuring current.
If you do blow the fuse in your multimeter, you should be able to open up your multimeter’s case and change the fuse.
To measure voltage, DC, and AC, see Recipe 21.2 and Recipe 21.3, respectively.
Most bench power supplies (Recipe 21.1) will also include an ammeter to tell you how much current is being drawn.
Disconnect the wire so that it is not in use and then use the continuity setting on your multimeter and connect the probes to each end of the thing you want to test.
If you are testing a long multicore cable (i.e., in situ and too long for the multimeter leads to reach both ends), you can connect the separate cores together at one end of the cable and test for continuity at the other, as shown in Figure 21-4.
After DC voltage, continuity is probably the setting you are most likely to use on your multimeter. It is particularly useful if your multimeter makes a beeping noise when the resistance is low enough to indicate continuity. This allows you to move the test probes around without having to look at the multimeter’s screen.
Recipe 21.2 provides an introduction to multimeters.
Nearly all multimeters will have several resistance ranges, and many will have a few capacitance ranges as well.
To use these ranges, simply select the range and attach the component to the test leads. You may find that as with measuring current, the test leads have to be inserted into different sockets on the multimeter when using these measurement ranges.
Some DMMs will offer inductance and frequency ranges, and specialized meters are available for measuring resistance, capacitance, and inductance more accurately than the average DMM can.
Some of these will actually allow you to just attach test leads to any component and the meter will first identify it and then measure its properties. Amazingly, such meters are available on eBay as a kit to assemble yourself for around $10.
When measuring component values, do not be seduced into thinking you are making a very accurate measurement of a component value because of the precision of the result. A reading of 1.23µF may still have a measurement of ±10%, so check the specification for your meter.
Recipe 21.2 provides an introduction to multimeters.
Disconnect the circuit and then use a resistor in parallel with the capacitor to discharge the capacitor until the voltage across it has reached a safe level as indicated by a multimeter set to its DC-voltage setting.
When discharging the capacitor, you can either connect the resistor using insulated crocodile clips, or if access is good enough, bend the resistor leads to the correct gap and then hold the resistor with pliers, carefully touching the capacitor leads as shown in Figure 21-5.
Calculate the resistance and the power rating of the resistor such that the capacitor discharges in a reasonable amount of time without the resistor becoming too hot.
The time constant (RC) is the time in seconds for the capacitor’s voltage to drop to 63.2% of its original value. For example, if you have a 100µF capacitor charged to 300V (you might find this in a photographic flashgun) and you want to discharge the capacitor to a safe 10V, a resistor of 10kΩ would have a time constant of 1 second. So holding it to the capacitor for 1 second would reduce the voltage to 190V, a further second to 120V, and so on. So, after 7 seconds, the voltage would be down to a safe 7.6V.
You can calculate the maximum power the resistor will dissipate as heat using:
which in this case would be 9W. That’s quite a physically big resistor, so failing to do a rough calculation and using a standard ¼W resistor is likely to end in a puff of smoke for the resistor.
Increasing the resistance of the resistor decreases the power requirement of the resistor but will take longer for the capacitor to discharge. It is a good idea to monitor the capacitor’s voltage with a multimeter while you discharge.
A capacitor charged to a high voltage is a dangerous thing, but a high-value capacitor even at low voltages can cause massive currents to flow if its terminals are short circuited and the capacitor has a low ESR.
For a calculation on the energy stored in a capacitor, see Recipe 3.7.
Use a voltage divider comprised of a ladder of equal-value resistors to reduce the voltage to be measured. You will need to take into account the effect that the voltage divider has on the voltage being measured and the input impedance of the multimeter. Also, make sure the resistors used are rated for a high enough voltage.
Figure 21-6 shows how you might measure a voltage of around 5kV using a multimeter with a maximum DC voltage measurement of 1000V and an imput impedance of 10MΩ.
The voltage divider will reduce the input voltage by a factor of 10, making the sums easier. Using 10 equal-value resistors (of 1% or better accuracy) is more likely to result in better accuracy of the system overall if the resistors are from the same batch. The closer the resistors are in value to each other the better the divider.
There are a few other things you need to consider. First, remember to calculate how much the chain of resistors will load the output of the high-voltage source. In this case, a load of 10MΩ across 10kV will result in current flowing at 1mA.
If you plan to measure high voltages, you will need special high-voltage leads that are extremely well insulated to prevent sparking across to your fingers. Your voltage divider should also be boxed and not easy to accidentally touch.
Also, see Recipe 21.12.
The heat power generated by each resistor will be 1kV * 1mA = 1W, which is significant. The temptation is to use higher-value resistors (say 10MΩ) to reduce the power and loading on the voltage source, but this will lead to the impedance of the multimeter becoming significant and acting as two similar-value resistors in parallel, making the reading almost useless.
A typical low-cost or medium-range multimeter will only have an input impedance of 10MΩ, which would result in the voltage reading being reduced by about 10% from the actual voltage.
You can determine the input impedance of your multimeter using the schematic in Figure 21-7.
To determine the input impedance of your multimeter (Z in Figure 21-7):
For example, with a value of R1 of 10MΩ and a 10V supply, my meter gave a Vm reading of 4.7V. Plugging the numbers in you get:
If you plan to measure high voltages on a regular basis, buy a specialist high-voltage voltmeter. In addition to having a very high voltage range, these instruments also usually have very high input impedance and do not load the circuit under test to the extent that the voltage being measured is appreciably altered.
You can also use the preceding method using very high-value resistors if you buy a high-quality multimeter with a buffered input that gives the multimeter an input impedance in the hundreds of MΩ or even GΩ range.
For more information on using a resistor as a voltage divider, see Recipe 2.6.
For regular DC-voltage measurement, see Recipe 21.2.
Figure 21-8 shows a typical low-cost oscilloscope displaying a 1kHz 5V test signal available from a terminal on the front of the oscilloscope.
To look at a signal on an oscilloscope:
Every model of oscilloscope is a little different, so you will need to consult the manual for yours to find the controls used in the preceding instructions.
Most oscilloscopes, including the one shown in Figure 21-8, have two channels that allow you to display two signals at the same time as well as a host of other features such as automatic measurement of frequency and signal amplitude.
When choosing an oscilloscope to buy, you can spend from a few hundred dollars to many thousands of dollars. You pay more for higher frequency range, better displays, and more advanced features. A basic 20MHz oscilloscope like the one shown in Figure 21-8 is a perfectly good starting point and has served me well for many years.
In addition to standalone oscilloscopes, you can also buy “PC scopes” that do not have a screen but rather rely on a USB connection to the PC running the oscilloscope software. As with standalone oscilloscopes, PC scopes are available at all prices and qualities. I prefer a standalone device as it’s always there on my workbench and I don’t have to wait for it to boot up, but many people find the extra features that often come with a PC scope and the bigger and better display of a computer monitor outweigh any disadvantages.
For more information on getting the most from your oscilloscope, get to know the manual really thoroughly. You may find all sorts of features that are not immediately obvious from the controls on the front.
Use a function generator (a.k.a. a signal generator).
The function generator shown in Figure 21-9 is a typical low-cost function generator capable of generating two independent sine, square, or triangle waveforms of up to 20 MHz.
To use the function generator:
If you have a single-supply amplifier or other circuit, if the input signal is swinging negative on each cycle, you may damage the circuit you are testing.
Signal generators with digital controls, like the one shown in Figure 21-9, assume a full AC signal and a DC offset have to be explicitly set.
Figure 21-10 shows the oscilloscope trace for a 10kHz sinewave with an amplitude of 2V peak-to-peak and a DC offset of 2.5V generated by the function.
If you are on a budget, you can make your own oscillator as shown in Recipe 16.5.
Use circuit-simulator software.
A free online circuit simulator is a great way to get started with circuit simulation. The PartSim is one such easy-to-use simulator. Sign up for a PartSim account and then start drawing your schematic in the simulator. Figure 21-11 shows the schematic for the simple RC filter from Recipe 16.3.
In addition to drawing R1 and C1, you can also specify an AC-voltage source to drive it. In this case, as the parameter in Figure 21-11 suggests, the test signal will be a 5V square wave (pulse) with rise and fall times of 1µs, a pulse length of 15µs, and an overall period of 30µs. This corresponds roughly to the 32.7kHz carrier signal of Recipe 16.3.
When you click the Run button you will be prompted to enter some parameters for a simulation as shown in Figure 21-12.
There are various types of simulations that can be run, but in this case we are interested in the “Transient Response.” The Start and Stop times determine how long the simulation will run and the Time Step is the step between each calculated value in the simulation.
When you click Run, you will see a new tab appear in the window with the name “transient response” that shows the result of the simulation as shown in Figure 21-13.
You can see that the output is indeed greatly attenuated by the RC filter.
Simulation is very useful in analog design, not least because it tells you how the circuit should behave, whereas a signal generator and oscilloscope will tell you how just one prototype behaves. A physical prototype has the problem that there may be a fault in its construction or components that causes it to behave differently when you make a second prototype. Simulation will tell you what to expect in a reliable and consistent manner.
In addition to idealized components like resistors, capacitors, and perfect op-amps, simulators like PartSim also have a huge array of “models” for actual components, including specific op-amp models.
PartSim is based on the open source SPICE simulation software; learn more at: http://bwrcs.eecs.berkeley.edu/Classes/IcBook/SPICE/.
Assume that coming into contact with a high voltage will kill you.
Although a little hyperbolic, this statement is a good thing to keep at the front of your mind when working with high voltages. Frankly anything above 50V should scare you. So AC with its fatal combination of high voltage and high availability of current should scare you a lot.
Here are some rules I stick to when working on AC:
According to the American Burn Association:
In the United States, on average of 400 people die from electrocution and 4,400 are injured each year because of electrical hazards.
In addition to the risk of a current flowing through your heart and stopping it, burns caused by your body effectively acting as a heating element as well as arcing sparks are risks associated with high voltages.
For the full American Burn Association report, see: http://www.ameriburn.org/Preven/ElectricalSafetyEducator’sGuide.pdf.