Using Schematic Diagrams and Datasheets

A schematic diagram, also called a circuit diagram, is the standard way of describing the components and connections in an electronic circuit. It uses iconic symbols to represent components, with lines representing the connections between the components.

A circuit diagram represents the connections of a circuit, but it is not a drawing of the actual physical layout. Although you may initially find that drawings and photos of the physical wiring can be easier to understand than a schematic, in a complicated circuit it can be difficult to clearly see where each wire gets connected.

Circuit diagrams are like maps. They have conventions that help you to orient yourself once you become familiar with their style and symbols. For example, inputs are usually to the left, outputs to the right; 0V or ground connections are usually shown at the bottom of simple circuits, the power at the top.

Figure A-1 in Appendix A shows some of the most common components, and the symbols used for them in circuit diagrams. Figure B-1 is a schematic diagram from Recipe 8.8 that illustrates the symbols used in a typical diagram.

Typical schematic diagram

Components such as the resistor and capacitor used here are not polarized—they can be connected either way around. Transistors, diodes, and integrated circuits are polarized, so it is important that you identify each lead and connect it according to the diagram.

Figure B-2 shows how the wiring could look when connected using a breadboard. This drawing was produced using a tool called Fritzing that enables the drawing of electronic circuits. See http://fritzing.org/.

Physical layout of the circuit shown in Figure B-1

Wiring a working breadboard from a circuit diagram is easy if you break the task into individual steps. Figure B-3 shows how each step of breadboard construction is related to a circuit diagram. The circuit shown is from Recipe 1.6.

Transferring a schematic diagram to a breadboard

How to Read a Datasheet

Datasheets are produced by the manufacturers of components to summarize the technical characteristics of a device. Datasheets contain definitive information about the performance and usage of the device; for example, the minimum voltage needed for the device to function and the maximum voltage that it can reliably tolerate. Datasheets contain information on the function of each pin and advice on how to use the device.

For more complicated devices, such as LCDs, the datasheet covers how to initialize and interact with the device. Very complex devices, such as the Arduino controller chip, require hundreds of pages to explain all the capabilities of the device.

Datasheets are written for design engineers, and they usually contain much more information than you need to get most devices working in an Arduino project. Don’t be intimidated by the volume of technical information; you will typically find the important information in the first couple of pages. There will usually be a circuit diagram symbol labeled to show how the connections on the device correspond to the symbols. This page will typically have a general description of the device (or family of devices) and the kinds of uses they are suitable for.

After this, there is usually a table of the electrical characteristics of the device.

Look for information about the maximum voltage and the current the device is designed to handle to check that it is in the range you need. For components to connect directly to a standard Arduino board, devices need to operate at +5 volts. To be powered directly from the pin of the Arduino, they need to be able to operate with a current of 40 mA or less.

Note

Some components are designed to operate on 3.3 volts and can be damaged if connected to a 5V Arduino board. Use these devices with a board designed to run from a 3.3V supply (e.g., the MKR series, ARM Cortex-M0-based boards such as the Arduino Zero, and other ARM-based boards), or use a logic-level converter such as the SparkFun BOB-08745. More information on logic-level conversion is available at https://cdn-shop.adafruit.com/datasheets/an97055.pdf.

Choosing and Using Transistors for Switching

The Arduino Uno output pins are designed to handle currents up to 40 mA (milliamperes), which is only 1/25 of an amp. Other boards may be rated even lower. For example, the the Uno WiFi Rev 2 board is rated at 20mA, the Zero at 7mA. You can use a transistor to switch larger currents. This section provides guidance on transistor selection and use.

The most commonly used transistors with Arduino projects are bipolar transistors. These can be of two types (named NPN and PNP) that determine the direction of current flow. NPN is more common for Arduino projects and is the type that is illustrated in the recipes in this book. For currents up to .5 amperes (500 mA) or so, the 2N2222 transistor is a widely available choice; the TIP120 transistor is a popular choice for currents up to 5 amperes.

Figure B-1 shows an example of a transistor connected to an Arduino pin used to drive a motor. See Chapter 8 for some recipes that use transistors.

Transistor datasheets are usually packed with information for the design engineer, and most of this is not relevant for choosing transistors for Arduino applications. Table B-1 shows the most important parameters you should look for (the values shown are for a typical general-purpose transistor). Manufacturing tolerances result in varying performance from different batches of the same part, so datasheets usually indicate the minimum, typical, and maximum values for parameters that can vary from part to part.

Here’s what to look for:

Collector-emitter voltage

Make sure the transistor is rated to operate at a voltage higher than the voltage of the power supply for the circuit the transistor is controlling. Choosing a transistor with a higher rating won’t cause any problems.

Collector current

This is the absolute maximum current the transistor is designed to handle. It is a good practice to choose a transistor that is rated at least 25 percent higher than what you need.

DC current gain

This determines the amount of current needed to flow through the base of the transistor to switch the output current. Dividing the output current (the maximum current that will flow through the load the transistor is switching) by the gain gives the amount of current that needs to flow through the base. Use Ohms’s law (Resistance = Voltage / Current) to calculate the value of the resistor connecting the Arduino pin to the transistor base. For example, if the desired collector current is 1 amp and the gain is 100, you need at least 0.01 amps (10 mA) through the transistor base. For a 5 volt Arduino: 5 / .01 = 500 ohms (500 ohms is not a standard resistor value so 470 ohms would be a good choice).

Collector-emitter saturation voltage

This is the voltage level on the collector when the transistor is fully conducting. Although this is usually less than 1 volt, it can be significant when calculating a series resistor for LEDs or for driving high-current devices.

Example of key transistor datasheet specifications
Absolute maximum ratings
Parameter Symbol Rating Units Comment

Collector-emitter voltage

Vceo

40

Volts

The maximum voltage between the collector and emitter

Collector current

Ic

600

mA or A

The maximum current that the transistor is designed to handle

Electrical characteristics

DC current gain

Ic

90 @ 10 mA

 

Gain with 10 mA current flowing

Ic

50 @ 500 mA

 

Gain with 500 mA current flowing

Collector-emitter saturation voltage

Vce

(sat)

0.3 @ 100 mA

1.0 @ 500 mA

Volts

Volts

Voltage drop across collector and emitter at various currents

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.97.248