Build a circuit board
Want to build Raspberry Pi or Arduino add-ons, but don’t know one end of a soldering iron from the other? Mike Bedford provides the advice you seek.
Want to build Raspberry Pi or Arduino addons but don’t know one end of a soldering iron from the other? Mike Bedford provides the guidance you need.
When the first personal computers hit the street, many users were proficient at building electronic circuit boards. Indeed, some of the early models were sold as self-assembly kits.
Needless to say, times changed and very soon, most PC users had no interest in, and no knowledge of, the inner workings of their computers. Now, thanks to the popularity of single-board computers (SBC) like the Raspberry Pi and Arduino, we’re coming full circle.
Once again, technically minded computer users have a need to delve into electronics, but unlike those computer enthusiasts of the 80s the relevant experience in electronics is lacking. The purpose of this article is to take a first step in providing that knowledge for today’s generation of SBC users.
This is not something that can easily be tackled in a single article, so we’re starting with the basics and that’s how to build a PCB. Not all Pi HATs and Arduino shields are available ready built and ready to go. Just like the old Sinclair ZX80 of the 1980s, some of these SBC add-ons are available only as kits of parts, comprising a PCB (printed circuit board) and its associated components, that you have to build yourself.
Some designs aren’t even this advanced. If you look on the Fritzing open source development initiative site
(http://fritzing.org), you’ll find lots of circuit boards that users have contributed to the community. For these designs you’ll need to buy all the components first, before building the PCB.
We’re going to help you tackle both these approaches. We’ll provide step-by-step instructions on constructing a PCB, discuss how to buy suitable components for a project, and tell you what each type of component looks like so you can identify them when a pack of components drops through the letterbox.
Building a PCB
Instead of using a Pi HAT or Arduino shield as an example, we’re going for a standalone solution. This way, you won’t have any nagging doubts that a lack of expertise might have the knock-on effect of damaging your Pi or Arduino.
To cater for the increasing interest in hobby electronics, several companies are now providing kits of parts. We’ve chosen one such kit from www.kitronik.
co.uk. It’s categorised as intermediate in difficulty, although don’t let this dissuade you: some of the “easy build” kits are trivially simple. The kit in question is a micro-switch operated alarm and it costs just £6.14. All you need in addition is four AA batteries.
In the case of the Kitronik kit, full constructional details are available online, but because we’re also catering to those who might need to build a circuit on a third-party PCB supplied without a kit of parts, we’re providing illustrated step-by-step instructions. This walkthrough only refers to soldering in passing, but because this is one of the most difficult skills in building a PCB, be sure to read the following detailed instructions on how to carry out this important step.
School of soldering
Start by turning on your soldering iron and waiting a few minutes for it to heat up. While you’re waiting, wet the sponge in the base of the soldering iron’s stand. Soldering irons only work properly if the tip is clean and shiny. So, wipe the tip across the damp sponge a few times to remove any old tarnished solder, or just general grime if you’re using it for the first time. Now, apply solder to the iron’s tip and wipe off any excess on the sponge. Hopefully, this will result in the tip becoming tinned (covered with a fine layer of bright new solder). It might be necessary to carry out the wipe-apply solder step a few times to get a properly tinned tip. In addition, note that you might also have to tin the tip again if you wait long periods of time between making solder joints while the iron is turned on.
With the iron’s tip tinned, you’re ready to make your first solder joint. With the PCB horizontal and the noncomponent side uppermost, apply the soldering iron to the PCB so it touches both the component lead and the pad. That’s the circular or rectangular area around the component lead hole. Now apply the end of the solder to the opposite side of the pad. Within a second or two, the end of the solder should start to melt. As soon as this happens, remove both the solder and the soldering iron to allow the solder to solidify.
Check that you haven’t used too much solder and, in so doing, bridged the pad to an adjacent pad. If you have, you’ll need to remove the solder using a de-soldering pump and try again. Alternatively, you might have used insufficient solder with the result that the component lead isn’t attached to the pad all the way
round. In this case, you can apply a bit more solder. Check that the solder joint is shiny. If it’s dull then this is a dry joint, and might result in a poor electrical connection, so remove it with a de-soldering pump and try again. Note that keeping the soldering iron in contact with the pad for too long is a common cause of dry joints, so try to make joints as quickly as possible. Bear in mind that some components, particularly integrated circuits, can be damaged by over-heating.
Name that component
When you receive a kit in the post, it’s important to be able to identify components. Often the instructions with the kit will help you out, but you really ought to know what the various types of components look like. As well as reading the following descriptions, be sure to take a look at the photo of various components.
Resistors are easy to identify. These have small cylindrical bodies, perhaps 6mm long and 2mm in diameter, and leads attached to each end of the body. They have several coloured band which identify their value – see the box (below) on how to read resistors.
Capacitors aren’t as easy to identify because there are so many types, but the photo (left) will help you to identify the most common variants. Generally speaking, though, if it has two leads and it’s not a resistor, diode or LED, it’s probably a capacitor. Unlike resistors, the value will be printed on it as text. Large-value polarised electrolytic or tantalum capacitors might have a value shown in full, such as 47µF or 47µ, although it might appear as just 47 in which case the µF is assumed. Smaller-value capacitors might just have a value with a prefix, such as .47µ, but more likely it’ll be just three figures, often with a letter afterwards. In this case, the first two digits are significant figures and the third is a multiplier, so the number of zeros, and the value is in pF. So, for example, 103 means 10000pF = 10nF.
Diodes have small cylindrical bodies with leads attached to each end of the body. Unlike resistors, they don’t have coloured bands. They usually have black or transparent bodies with a single band that identifies the cathode – that’s the negative lead. The part number is printed on the body, for example 1N4148.
LEDs (light emitting diodes) typically have small transparent domed bodies and come in various colours, the colour usually indicating their colour when illuminated. Both leads are attached to the non-domed end of the body. The non-domed end of the body is flattened at one side to identify the cathode.
Except for high-power devices, transistors have black or metal cylindrical bodies, sometimes flattened along one side, or occasionally black rectangular bodies. The part number is printed on the body, for example BC548. They have three leads. The identity of the three leads differs between transistors and can only be determined from the speciation sheet, although a PCB design will usually show the device’s orientation.
Voltage regulators look rather like transistors
although the most common types have black plastic rectangular bodies. Their part number will be printed on them. Like transistors, you’ll need to consult the specification sheet to identify the leads, but a good PCB design will show the orientation.
Common integrated circuits (ICs) are black plastic rectangles with pins along two edges. Devices tend to have eight, 14 or 16 pins. The device type will be printed on the body. There’s usually a notch on one of the short edges. This identifies the position of pin 1, which is to its left. Once you know what an IC looks like, you should be able to identify their associated DIL sockets, if used.
Buying components
If full details of every component are available, and perhaps even specific manufacturer’s part numbers, it couldn’t be simpler. Often, though, only sparse details will be available, in which case you’ll need to make some assumptions. It’s also a good idea to get hold of the PCB first so you can make any necessary measurements.
We’re only going to consider “through-hole” components, that is the type in which leads pass through holes in the board. The newer surface mounting devices (SMDs), which are common on professionally manufactured PCBs, are very small and fiddly, and require special construction methods. So shun any surface mounting devices for the time being.
Resistors are normally simple, even with limited information. At the very least you’ll be given the value which will be in ohms, Kilo ohms or mega ohms which will be abbreviated to or R, k or just k, or M or just M, respectively. Sometimes the abbreviation replaces the decimal point so 2.2k might be written as 2k2. If this is the only information you have it’s safe to assume that the power rating and tolerance are irrelevant, so go for a small and cheap resistor which will probably be rated at 250mW and have a one per cent tolerance.
Capacitance is measured in farads, although real- world capacitors never have such a large value. They will be pico farads, nano farads or micro farads, for which the abbreviation is pF or just p, nF or just n, or μF or just μ, respectively. Again the abbreviation might replace the decimal point so 4.7nF might appear as 4n7. If this is the only information you have it’s safe to assume that the voltage rating and the dielectric type (ceramic, polyester and so on) is irrelevant so go for a low voltage rating and pick any dielectric. Large-value capacitors, 1μF or greater, will usually be polarised and hence specified as electrolytic or tantalum. The construction method and size are critical so, before choosing, take a look at the PCB and measure the lead spacing for the capacitor so see what will fit. Capacitors can have either axial leads, that is they exit at different ends of the capacitor body, or radial leads, that is they exit from the same side. In the case of axial leads check the length of the body and, in the case of radial leads, check the lead spacing.
Most other components – and here we’re including diodes, transistors, LEDs, and integrated circuits (ICs) – will be adequately specified so there should be no ambiguity. Note, however, that the full part number of ICs you see for sale will often be a lot longer than the number provided by the designer and might differ from one manufacturer to another. So, if the designer specifies a 74HC138 its full part number might be something like SN74HC138N. The other thing to bear in mind about ICs is that although you can solder them directly to the board, it’s a good precaution – especially when you’re just starting out – to plug them into sockets that are soldered on to the board. This way, you’re not likely to damage the IC by overheating it while you’re soldering and, if it fails, you can replace it without having to de-solder it. The type of sockets used for most ICs are called DIL (Dual In Line), and are specified by the number of pins, so the appropriate part for the 16-pin 74HC138 would be described as a 16-pin DIL socket. Turn the page for our guided walkthrough!