Please enable JavaScript to use CodeHS

Circuits · Electronics · CAD

What Is a Printed Circuit Board (PCB)? How electronics are built, layer by layer

Open up a phone, a game controller, or an Arduino and you will find a flat board covered in tiny parts and thin metal lines. That board is a printed circuit board. Learn what its layers do, how engineers design one on a computer, and then route your own copper traces without causing a short circuit.

Electronics ~25 min 3 hands-on labs
MCU-32 U1 R1 C1 D1 J1 TP1 TP2 PCB 101 · REV A
01 / The basics

What is a printed circuit board?

A printed circuit board, or PCB, is a flat, stiff board that does two jobs. It holds electronic parts in place, and it connects them with thin strips of copper metal. Those copper strips are called traces. A trace does the same job as a wire, but it is printed flat onto the board.

Think of a PCB like a tiny city. The parts are the buildings. The traces are the roads. Electricity travels along the roads from building to building, and the city only works if every road goes to the right place.

PCBs are everywhere. Your phone has a main board packed with parts smaller than a grain of rice. A game controller has a board under its buttons. Learning boards like the Arduino and the micro:bit are PCBs too. If you have ever plugged one into a computer, you were holding a PCB in your hand.

Before PCBs, people connected every part with real wires, one by one, by hand. That was slow, messy, and easy to get wrong. Printing the connections onto a board lets factories make millions of identical circuits that all work the same way.


02 / Peel it apart

The layers of a PCB

A PCB looks like one solid board, but it is really a sandwich. A simple board has four kinds of layers, stacked from the bottom up:

  • Substrate (FR4): the stiff core in the middle. It is usually FR4, which is woven fiberglass cloth soaked in hard epoxy glue. FR stands for flame retardant, so it resists catching fire. It does not carry electricity, which keeps the copper paths apart.
  • Copper: a very thin sheet of copper, often about half as thick as a human hair. This is where the traces live. A two-layer board has copper on both the top and bottom.
  • Solder mask: a thin plastic-like coating over the copper. It protects the copper from rust and stops melted solder from bridging two traces by accident. Small openings leave the pads bare so parts can be attached.
  • Silkscreen: printed ink labels on top, like R1, C1, a + sign, or the board's name. The labels help people build, test, and fix the board.

So why are most circuit boards green? The green is the solder mask. Green became the standard color early on, and it stuck because white labels and shiny gold pads are easy to see against it. That helps both people and inspection cameras spot mistakes. Boards can be any color, though. Arduino Uno boards are famously blue, and many fancy boards are black or purple. The color does not change how the circuit works.

Lab 1: Exploded layer viewer

Peel the board
    Drag the slider to pull the layers apart. Uncheck a layer, or press Peel top layer, to see what is underneath.

    Two-layer boards are common in hobby projects. A phone's main board is far more crowded, so it can have ten or more copper layers glued into one thin stack, with fiberglass between each one.


    03 / Vocabulary

    Traces, pads, vias, and parts

    Every PCB is built from the same few features. Once you know these words, you can read almost any board.

    • TraceA flat copper path that carries electricity between parts, like a wire printed on the board.
    • PadA bare metal spot where a part's leg is soldered on. Round pads with holes hold through-hole parts. Flat square pads hold surface-mount parts.
    • ViaA tiny copper-lined hole that acts like a tunnel. It lets a trace hop from the top layer to the bottom layer.
    • Silkscreen labelWhite printed text and outlines. Letters name each part type: R for resistor, C for capacitor, D for diode or LED, U for chip, J for connector.

    Through-hole vs. surface-mount parts

    Parts attach to a PCB in two main ways.

    Through-hole (THT)

    The part has long wire legs that poke through holes in the board. They are soldered on the bottom side. These parts are big and strong, and they are the easiest to solder by hand, so beginner kits use them.

    Surface-mount (SMT)

    The part sits flat on pads on the surface, with no holes. Surface-mount parts can be smaller than a grain of sand, and robots can place thousands per hour. Almost everything inside a phone is surface-mount.

    Lab 2: Spot the part

    Found 0 of 5

    Find the LED

    Click or tap a part on the board, or Tab to a lettered part and press Enter.

    Hint: real boards print a letter next to each part. Turn on the silkscreen labels if you get stuck.

    04 / From idea to board

    Breadboard to perfboard to PCB

    Engineers almost never start with a PCB. They build the circuit in steps, making it a little more permanent each time they are sure it works.

    1. 1. Breadboard

      Temporary · no solder

      Push parts and jumper wires into spring clips. Nothing is glued or melted, so you can change your mind in seconds. See how to use a breadboard.

    2. 2. Perfboard

      Permanent · hand-wired

      A board full of evenly spaced holes. You solder parts in and connect them with bits of wire or blobs of solder. It is sturdy, but every connection is built by hand.

    3. 3. PCB

      Permanent · mass-produced

      The connections are designed on a computer and printed by a factory. Every copy is identical, small, and reliable, which is what you need to sell thousands of devices.


    05 / CAD for circuits

    How PCBs are designed in CAD software

    Engineers design boards with ECAD software. ECAD stands for electronic computer-aided design. It is a cousin of the CAD software people use to design 3D-printed parts and buildings, but it understands electricity. Popular tools include KiCad (free), EasyEDA (runs in a web browser), Autodesk Fusion, and Altium Designer.

    A PCB design always has two drawings that stay linked together. The schematic is a map of what connects to what, drawn with symbols. The layout shows where everything physically sits on the board.

    + BT1 9V R1 470Ω D1
    Schematic: symbols and lines show connections. Distances do not matter.
    BT1R1D1+
    Layout: the same circuit, with real part sizes, pads, and traces.

    Here is the workflow almost every engineer follows:

    1. Draw the schematicPlace symbols for each part and draw lines to connect them. Each group of connected pins is called a net, like the net named GND that links every ground pin.
    2. Pick footprints and place partsEvery symbol gets a footprint: the exact pattern of pads its real part needs. Then you drag parts onto the board outline. Good placement makes routing much easier.
    3. Route the tracesDraw copper traces that follow the schematic's connections. The software shows thin "ratsnest" lines as a reminder of what still needs connecting.
    4. Run a design rule check (DRC)The software checks your board against the factory's rules: traces too close together, traces too thin, missing connections, and accidental shorts.
    5. Export Gerber files and orderGerber files describe each layer as a picture the factory's machines can read, plus a drill file listing every hole. You upload them, and a few days later your boards arrive in the mail.

    Programming and PCB design go together. The board gives a microcontroller its body, and code gives it a brain. A board like an Arduino exists so you can write programs that read sensors and blink lights.


    06 / Your turn

    Routing rules and the trace puzzle

    Routing is a puzzle. Every connection needs a path, but the paths have to follow a few rules:

    • No crossing on one layer If two traces touch on the same layer, electricity takes a shortcut. That is a short circuit, and it can stop the circuit or make parts overheat. Use a via to hop to the other layer.
    • Keep your clearance Traces need a small gap between them, often about the width of a hair or two. Too close, and the factory might leave a tiny copper bridge that shorts them.
    • More current, wider trace A trace is like a pipe. More electric current needs a wider path, or the copper heats up. Power traces to motors and batteries are much wider than signal traces.

    Lab 3: Route the board

    2 layers · 4 nets

    Connect each pair of matching numbered pads. Circuit 1 is a battery, resistor, and LED loop (nets 1 to 3). Circuit 2 sends a light sensor's signal to a chip pin (net 4). Drag from a pad to draw a trace. One pair is impossible to connect without a crossing, so you will need a via.

    Drawing on: top layer

      Keyboard: focus the board, move with the arrow keys, press Enter on a pad to start a trace, then use arrows to draw. V places a via, Backspace undoes a step, Esc stops drawing.

      Pick a numbered pad and drag to its matching pad. Orange traces are on the top layer. Blue traces are on the bottom layer.

        Real boards have hundreds or thousands of nets, so ECAD tools include an autorouter that tries to solve the puzzle automatically. Many engineers still route important traces by hand, because they know which signals are sensitive and which carry big currents.


        07 / The factory

        How PCBs are made

        Making a PCB happens in two big stages. First the factory makes the bare board (fabrication). Then it adds the parts (assembly).

        Making the bare board

        1. Start with copper-clad board. A sheet of FR4 fiberglass comes covered in copper on both sides.
        2. Print the pattern. The trace pattern from the Gerber files is printed onto the copper with a protective coating.
        3. Etch. A chemical bath dissolves all the copper that is not protected. Only the traces and pads are left.
        4. Drill and plate. Machines drill the holes, then coat the inside of each hole with copper so vias connect the layers.
        5. Mask, finish, and print. The solder mask goes on, bare pads get a coating like gold or tin, and the silkscreen labels are printed. Then each board is tested for opens and shorts.

        Adding the parts

        1. Solder paste. A thin metal stencil spreads a gray paste of tiny solder balls onto every pad.
        2. Pick and place. A robot with suction nozzles grabs parts from reels and sets each one on its pads, often thousands per hour.
        3. Reflow oven. The board rides a conveyor through an oven. The paste melts, then cools into solid solder joints that lock each part in place.
        4. Inspect. Cameras check every joint, and through-hole parts are soldered by a machine or by hand.

        The pick-and-place robot learns where each part goes from a file exported by the ECAD software. The same design data drives every machine in the factory, from the drill to the robot.


        08 / FAQ

        Frequently asked questions

        What is a printed circuit board (PCB)?

        A printed circuit board, or PCB, is a flat board that holds electronic parts and connects them with thin copper paths called traces. The traces act like wires that are printed right onto the board. Almost every electronic device, from phones to game controllers to an Arduino or micro:bit, has at least one PCB inside.

        Why are circuit boards green?

        The green color comes from the solder mask, a thin protective coating over the copper. Green became the standard early on and stayed popular because white labels and shiny metal pads are easy to see against it, which helps people and inspection cameras spot mistakes. Boards can also be blue, red, black, white, or purple. The color does not change how the circuit works.

        What are the layers of a PCB?

        A simple two-layer PCB has a stiff core called the substrate, usually FR4 fiberglass. Copper layers on the top and bottom carry electricity. A solder mask covers the copper to protect it and prevent accidental connections. On top, a silkscreen layer of ink prints labels like R1 and C1. Phones and computers use boards with many more copper layers stacked inside.

        What is a via on a PCB?

        A via is a tiny hole lined with copper that connects a trace on one layer to a trace on another layer. It works like a tunnel or a bridge. Designers use vias when two traces need to cross, because traces that touch on the same layer would cause a short circuit.

        What is the difference between through-hole and surface-mount parts?

        Through-hole parts have wire legs that poke through holes in the board and get soldered on the other side. They are big, strong, and easy to solder by hand. Surface-mount parts sit flat on pads on the surface of the board. They are much smaller and can be placed by robots, so most modern electronics use them.

        What software is used to design PCBs?

        PCBs are designed in ECAD software, which stands for electronic computer-aided design. Popular programs include KiCad, which is free, EasyEDA, which runs in a web browser, Autodesk Fusion, and Altium Designer. Designers draw a schematic, place parts, route traces, run a design rule check, and export Gerber files for the factory.

        How are PCBs made?

        A factory starts with fiberglass covered in copper. It prints the trace pattern, then uses chemicals to etch away the copper that is not needed. Machines drill holes, plate them with copper, and add the solder mask and silkscreen. To add parts, a stencil spreads solder paste, a pick-and-place robot sets parts on the pads, and a reflow oven melts the solder to lock them in place.


        09 / Check yourself

        Quick quiz

        1. What does a trace on a PCB do?

        2. Which layer gives most circuit boards their green color?

        3. Two traces need to cross. What should the designer use?

        4. A trace carries a lot of current to a motor. How should it be drawn?

        5. Put these PCB design steps in order: route traces, draw schematic, export Gerbers, run DRC.

        Keep building

        You now know how the boards inside your gadgets are designed and made. Next, learn the circuits that go on them and the tiny computers they carry, then write the code that brings a board to life.