Volume 08 Beginner 5 sub-modules ~20 min read

Datasheets, Schematics and Bench Tools

This volume turns the course towards the bench. It reads a real schematic part by part, designs a transistor switch from the worst-case figures in a datasheet, shows how accurate a multimeter really is and how it disturbs what it measures, introduces the oscilloscope and the logic analyser, and ends with a first build on a breadboard - and a table of what your meter should read.

You will learn
  • How to read a schematic: designators, power symbols, dots and compact values like 4k7
  • How a datasheet is organised, and why designs use its minimum and maximum values
  • What a multimeter's accuracy figure means, and how an ammeter changes the current
  • How to read an oscilloscope trace and choose a probe, and what a logic analyser shows
  • How to build a circuit on a breadboard and check it against predicted measurements
You need

8.1 Reading a schematic

A schematic is a map of connections. Each part has a symbol, a name such as R1 or Q1, and a value, and lines show which pins join. Read it by finding the supply, following the current round, and asking what each part is there to do.

The language of schematics

You have been reading schematics all through this course. Real ones use the same symbols, and a few more habits:

  1. Reference designators. Each part has a letter and a number. R is a resistor, C a capacitor and L an inductor. D is a diode or LED, Q a transistor, U a chip and S a switch.
  2. Power and ground symbols. Instead of drawing every wire back to the battery, a schematic marks points with a supply symbol, such as VDD, or a ground symbol. All points with the same symbol are joined.
  3. Dots. A dot joins crossing wires. Two wires that cross with no dot are not connected.
  4. Signal flow. Inputs are usually on the left, outputs on the right, higher voltages near the top.

Values without a decimal point

Printed schematics often put the prefix letter where the decimal point would be, because a dot is easily lost when a drawing is copied. R stands for the point in a plain ohms value:


4k7 = 4.7 kΩ
2R2 = 2.2 Ω
1M5 = 1.5 MΩ
4n7 = 4.7 nF
100n = 100 nF
2u2 = 2.2 µF

Reading a whole circuit

Here is the circuit you will build in Module 5:

Your first build: a push button, a transistor and an LED + B1 9 V S1 R2 100 kΩ R1 10 kΩ R3 390 Ω D1 Q1
Figure 8.1 - Pressing S1 lifts R1's left end to 9 V, so current flows through R1 into Q1's base and Q1 turns fully on. Q1 then lets current flow through R3 and the LED. R2 holds R1's left end at 0 V while the button is released.
  1. Find the supply. B1, a 9 V battery, with ground at its - end.
  2. Find the load. The LED D1, with R3 to set its current, as in Volume 04.
  3. Find what switches it. Q1, an NPN transistor below the LED, as in Volume 05.
  4. Find what controls the switch. The button S1, through R1 into Q1's base. R2 is a pull-down, so the base circuit rests at 0 V when S1 is released.

Put in words: pressing the button turns the transistor on, and the transistor lights the LED. Every part has a reason to be there.

Quick check

On a schematic, two wires cross with no dot where they meet. Are they connected?

Show the answer

Answer: D. A dot marks a join. Wires that cross without one are drawn crossing only because the page is flat; they are not connected.

8.2 Reading a datasheet

A datasheet is a part's rulebook. Absolute maximum ratings are limits never to approach; electrical characteristics give minimum, typical and maximum values. Design with the worst case, not the typical.

Three kinds of number

A datasheet starts with a summary of what the part is for, then gives its numbers in sections:

  1. Absolute maximum ratings. Beyond these, the part may be damaged. They are not targets: stay well below them.
  2. Recommended operating conditions. The range the part is designed to work in.
  3. Electrical characteristics. What the part actually does, as minimum, typical and maximum values, each under stated test conditions.

Here is an example of the key lines for a small NPN transistor. These are round numbers for teaching, not the figures of any particular part:

Parameter Symbol Min Typ Max Unit
Collector-emitter voltage VCEO - - 40 V
Collector current IC - - 200 mA
Power PD - - 500 mW
Current gain, at 100 mA hFE 50 150 - -
Voltage when fully on, at 100 mA VCE(sat) - - 0.3 V
Base-emitter voltage when fully on VBE(sat) - - 0.95 V

Designing with the worst case

The typical gain is 150, but some parts will only reach 50. A design must work with every part it might get, so it uses the worst figures:

A transistor switch designed from worst-case datasheet figures + + B1 12 V RL 117 Ω RB 560 Ω B2 3.3 V Q1
Figure 8.2 - Q1 is modelled with the example datasheet's worst cases. Its current gain is only 50, it takes 0.95 V from base to emitter, and it keeps 0.3 V across it when fully on. The 3.3 V pin is B2; the load is RL.

the load wants (12 V - 0.3 V) / 117 Ω = 100 mA
with a gain of only 50, the base needs at least 100 mA / 50 = 2 mA
twice that for safety: 4 mA, so RB = (3.3 V - 0.95 V) / 4 mA = 588 Ω; the E12 value below is 560 Ω
circuit worst-case: base current 4.2 mA; Q1 fully on; load current 100 mA; Q1 turns 30 mW into heat

Rounding RB down gives a little more base current, which is the safe way. Every figure is inside the datasheet's limits: 100 mA of the allowed 200 mA, and 30 mW of the allowed 500 mW. A typical part works too, of course:


with a typical part instead - gain 150, 0.7 V and 0.2 V - Q1 is fully on and the load gets 101 mA
Common mistake

Designing with typical values. The circuit works on the bench, with the parts you happened to test, and then fails on some of the thousands made. Minimum and maximum values are there to be used.

Quick check

A datasheet gives a transistor's gain as minimum 50, typical 150. Which figure should a switch design use?

Show the answer

Answer: A. The design has to work with the worst part it might be given. With a gain of 50, the base needs three times as much current as with 150, so design for 50.

8.3 The multimeter

A multimeter measures volts, amps and ohms, and its datasheet says how accurately. Every meter also changes what it measures a little: a voltmeter by drawing current, and an ammeter by adding resistance.

Modes

Volume 01 introduced the three basic modes. Most meters add a few more. One measures alternating voltage. A continuity test beeps when two points are joined. A diode test pushes a small current through a diode and shows its forward voltage.

How accurate?

A meter's accuracy is given as a percentage of the reading plus a number of digits in the last place:


reading 4.700 V at +/-(0.5% + 2 digits): +/-0.0255 V, so the true value is between 4.6745 V and 4.7255 V

So the last digit of a display is not a promise. A reading of 4.700 V means "somewhere near 4.7 V".

The ammeter's own resistance

To measure current, a meter passes it through a small resistance inside and measures the voltage across it. That resistance adds to the loop:

Measuring an LED's current with a multimeter + A B1 5 V A1 R1 150 Ω D1
Figure 8.3 - The multimeter, set to measure current, is A1, placed in the loop. Inside, it measures the voltage across a small resistance, so it adds a little resistance to the loop.

circuit burden: an ideal ammeter would read 20 mA
a meter with 1 Ω inside reads 19.9 mA
a meter with 10 Ω inside reads 18.8 mA

Low-current ranges use bigger internal resistances, so switch to the highest range that still gives a useful reading. Volume 01 showed the voltmeter's version of the same effect.

Quick check

A meter reads 3.300 V with an accuracy of ±(1% + 3 digits), in steps of 0.001 V. How far might the true value be from the reading?

Show the answer

Answer: C. 1% of 3.300 V is 0.033 V, and 3 digits of 0.001 V add 0.003 V: 0.036 V in all.

8.4 The oscilloscope and the logic analyser

An oscilloscope draws a voltage against time, so you can see a signal change. A logic analyser records many digital signals as 1s and 0s, and can decode the messages they carry.

The oscilloscope

An oscilloscope, or scope, draws a graph of voltage (up the screen) against time (across it). Its screen is marked in divisions. Two knobs set the scales: volts per division, and time per division. A trigger holds the picture still, by starting each sweep at the same point of the signal, such as each rising edge.

Here is a trace like one on a scope's screen:

A 5 V PWM signal, as a scope would show it 0 0.5 1 1.5 2 2.5 3 0 1 2 3 4 5 6 time (ms) voltage (V)
Figure 8.4 - The signal rises every 1 ms and stays high for 0.25 ms. The time between rising edges is the period; the share of it spent high is the duty cycle.

one cycle lasts 1 ms, so the frequency is 1 / 1 ms = 1 kHz; high for 0.25 ms of each 1 ms: duty cycle 25%

Probes

A scope connects to the circuit through a probe. A 10x probe hides a resistor that divides the signal by ten, so it disturbs the circuit less:

How a 10x oscilloscope probe divides a signal + B1 5 V Rprobe 9 MΩ Rscope 1 MΩ scope input
Figure 8.5 - The probe holds a 9 megohm resistor, Rprobe. The oscilloscope's input is 1 megohm to ground, Rscope. Together they divide the signal by ten, and the oscilloscope multiplies its reading by ten to match.

circuit probe: the scope input sees 500 mV - a tenth - and the scope shows it ten times bigger: 5 V
a 1 kΩ source driving a 10x probe of about 15 pF: time constant 15 ns
a 1 kΩ source driving a 1x probe of about 100 pF: time constant 100 ns

The probe's cable and input have capacitance, and Volume 03 showed what capacitance does to a fast edge. A 10x probe adds far less, so it shows fast edges more truthfully. Use it by default.

The logic analyser

A logic analyser has many channels, often 8 or 16. It records each one only as 1 or 0, many millions of times a second. It cannot show voltages, but it can follow a whole digital conversation between chips. Here is what it shows when a microcontroller sends the letter A on a serial line:


the letter A is code 65 = 01000001 in binary; sent lowest bit first: 1 0 0 0 0 0 1 0
The letter A on a serial line, as a logic analyser shows it TX bit - - start 0 1 2 3 4 5 6 7 stop - -
Figure 8.6 - The line rests at 1. A 0 start bit announces the byte, the eight data bits follow lowest first, and a 1 stop bit ends the frame.

at 9600 bits per second, one bit lasts 104 µs and the whole 10-bit frame 1.04 ms

Good analysers decode this automatically and print the letter. The analyser must sample fast enough to see every change:


sampling at 24 MHz, a 4 MHz clock is seen 6 times per cycle
sampling at 24 MHz, a 16 MHz clock is seen 1.5 times per cycle

Four or more samples per cycle is a sensible minimum. At 1.5, the recording cannot be trusted. Embedded C from Zero uses these serial links.

Quick check

A scope shows a square wave whose rising edges are 2 divisions apart, at 500 µs per division. What is its frequency?

Show the answer

Answer: B. The period is 2 × 500 µs = 1 ms, and the frequency is 1 / 1 ms = 1 kHz.

8.5 Your first build on a breadboard

A breadboard lets you build a circuit without soldering. Build it from the schematic one part at a time, check it with a multimeter against the numbers you expect, and a fault has nowhere to hide.

The breadboard

A breadboard is a plastic block full of holes, with metal clips inside. In the main area, each short row of five holes is joined underneath, so parts pushed into the same row are connected. A gap runs down the middle, and chips sit across it, so each pin gets its own row. Long strips along the edges are the power rails, for the supply and ground.

What you need

A 9 V battery and clip, a push button, an NPN transistor such as a general-purpose small-signal type, a red LED, and resistors of 10 kΩ, 100 kΩ and 390 Ω. Plus a few wires and a multimeter. Nothing here is dangerous, but disconnect the battery while you change anything.

Building it

Build the circuit of Figure 8.1:

  1. Power rails. Clip the battery's + lead to one edge rail and its - lead to the other. Leave it unplugged for now.
  2. The LED and R3. R3 from the + rail to a free row; the LED from that row to another, long lead (the anode) towards R3.
  3. The transistor. Check its datasheet for which pin is which. Collector to the LED's cathode row; emitter to the - rail.
  4. The base. R1 from the base's row to a new row. R2 from that new row to the - rail. The button from that same row to the + rail.
  5. Check, then power up. Compare every connection with the schematic, then connect the battery.

What you should measure

The solver worked out what your meter should read, with the button released and pressed:

Measure Button released Button pressed
Across the battery 9 V 9 V
R1, left end to ground 0 V 9 V
Q1 base to ground 0 V 700 mV
Across R3 0 V 6.8 V
LED current 0 A 17.4 mA
Battery current 0 A 18.4 mA

released: no current flows through the LED, so Q1's collector floats, anywhere up to 9 V - 2 V = 7 V
pressed: base current 830 µA, far more than the 174 µA the LED current needs

Your readings will not match exactly: the resistors have a tolerance, a real battery sags, and your LED's forward voltage will not be exactly 2 V. But they should be close. A reading far away points straight at the fault. A fresh battery may even read a little above 9 V.

When it does not work

  1. Nothing lights. Check the battery voltage, then that the LED is the right way round.
  2. The LED is always on. The button may be in the wrong rows, or the transistor's pins swapped.
  3. Still nothing. Measure the base voltage with the button pressed. About 0.7 V means the base circuit works, so look at the collector side. 0 V means look at the button and R1.
Remember

Measure, do not guess. Every reading either matches what the circuit should do, or tells you where it does not.

Quick check

With the button pressed, the base reads 0.7 V but the LED stays dark. Where is the fault most likely to be?

Show the answer

Answer: C. 0.7 V at the base shows that current is flowing into it, so the button, R1 and the battery are working. The fault is in the path the transistor should switch: R3, the LED (perhaps backwards) or the collector.

What you learned

Key words from this volume

Every word below has a plain-English entry in the glossary.

Practice

Practice 1

Compact values

What are 6k8, 47R and 3n3?

Show the solution

6k8 = 6.8 kΩ
47R = 47 Ω
3n3 = 3.3 nF
Practice 2

Sample fast enough

A logic analyser samples at 24 MHz. Can it record an 8 MHz clock reliably?

Show the solution

sampling at 24 MHz, an 8 MHz clock is seen 3 times per cycle

Only 3 samples per cycle - below the sensible minimum of four. Use a faster analyser.

Practice 3

A dimmer LED

In the first build, R3 is changed to 680 Ω. What LED current flows with the button pressed?

Show the solution

with R3 = 680 Ω, pressed: LED current 10 mA

Interview corner

Interview question 1

Debugging a board

"A board you built doesn't work. How do you go about finding the fault?"

Show the solution

"First the basics: is it powered, and is the supply at the right voltage at the chips' pins, not just at the connector? Then I split the problem in half. I find a point in the middle of the signal path and measure it against what it should be, which tells me which half the fault is in. I repeat until I'm down to one part or one connection. Throughout, I compare measurements with what the design says they should be. I use a multimeter for steady voltages, a scope for anything that changes, and a logic analyser for digital buses. And I check the simple things before the clever ones: backwards parts, wrong values, and connections that aren't made."

That completes Electronics from Zero. From here, Digital Logic from Zero builds with the gates you now know how to make. Embedded C from Zero puts a microcontroller in charge of circuits like the one you built.