How to design your first PCB – Printed Circuit Board

In this post we will go over how to design your first PCB (Printed Circuit Board) and we will go through a simple example that you can follow along to design, order, and test your own PCB.

What is a PCB (Printed Circuit Board)?

Many of the previous posts in this blog have been based on testing while wiring using a bread board, but what are you supposed to go when you are ready to go from breadboard to the next level? Enter Printed Circuit Boards! Printed Circuit Boards are simply boards used to connect electronics components together in a condensed way. You have seen these in most modern electronics (i.e. TV remote, computer keyboard, etc).

Example Scenario

Example: Turn on LED Flash if PIR sensor gets triggered

We have written some posts on PIR sensors, transistors, and turning on LED Flash based on sensor’s signals, so feel free to take a look at these posts:

HC-SR501 PIR Sensor
How to use the 2N2222 Transistor
How to use a Light Dependent Resistor (LDR Sensor)

We will now combine these to design a circuit that turns on the LED Flash when the PIR is activated. Go ahead and setup the breadboard circuit shown on the image and test it. You will see that when the PIR sensor is activated, the LED Flash lights up. Now that you have tested your prototype and confirm it works just the way you want it to, you are ready to move to a PCB. So let’s get started!

Software to design PCBs:

I recommend using EasyEDA to design PCBs due to simplicity to use and great integration with JLCPCB, allowing for simple online ordering of PCBs. To download EasyEDA, go to the following link: If you want to try EasyEDA first, they also (as of when I wrote this) have an online version that does not require a software download (I use the Desktop version).

PCB design in EasyEDA

Once Easy EDA is installed, go ahead and draw up the following circuit in a new sheet. Make sure when inserting components to look through the library (left end of the screen) and search for actual components so that the dimensions of the component are considered in the actual PCB design.

You can have simply make you the PCB only or also have them add the components to the PCB before shipping to you. If you want this, then make sure to pick components for which JLCPCB is listed as the supplier (in the Library, under Classes, pick the “JLCPCB Assembled” option).

Once your design is ready, you can click on the top menu on “Design” and then click “Convert Schematic to PCB”. Note that for the PCB I designed, I simply added connector blocks that can be easily used to connect wired components (you can see this in the final pictures shown at the end of this post).

One key thing to remember is that the copper trace width needs to be specified. The copper trace are the lines through which the electric current will flow in your PCB. The width (and board thickness) will basically be the equivalent of a wire gauge, where you need to pick a thicker wire as the design current increases. For this design I used the following online calculator:

You need to evaluate every single trace at every single current to ensure that all traces are properly designed, or for simplicity (if feasible) you can break it into a couple of current flow categories and design based on the longest trace for each current limit.

To determine the length of a trace, simply click on it on the physical design view and read the track properties on the right end of the screen (one property will be “Length”). For the calculation, select a thickness based on whatever you want to order from JLCPCB, they offer 1oz/ft^2 and 2oz/ft^2. If you don’t need 2oz/ft^2 (based on your analysis), then go with 1oz/ft^2. You also need to input a design current. The LED has a spec current of 15mA. I recommend adding a factor of safety to the design current. For this application the required trace width is very small, so it shouldn’t be an issue fitting on the PCB.

Notice on the screenshot showing my PCB design that there are blue and red lines. The red line denote the copper trace routed on the top layer of the PCB, while the blue is on the bottom layer of the PCB.

Once you have finished the physical design, including routing, placement of components, physical dimensions of the PCB, etc, then you are ready to order your PCB!

Ordering your PCB from JCLPCB

Placing the order

Once you have fully design your circuit and defined all parameters for the PCB (i.e. component placement, trace routes and width, etc), then (within the PCB view) proceed to click on “Fabrication” on the top menu, then on “One-click Order PCB/SMT”. This will open JLCPCB where you will then proceed to specify the final details of the PCB before ordering (create an account if you don’t have one).

For this example I picked blue as the color of the PCB, so you can see in the following image how the PCB will look like once fabricated (prior to component install). The images below also show the settings I used before ordering my PCBs, including the settings for SMT (surface mounted technology), which is basically the preferences for the components that they can solder before shipping to you. At this time, JLCPCB only supports placing components on one side of the board, so if you need to place components on both sides, you will have to do one of the sides yourself. Before proceeding with the order, ensure all of your components have JLCPCB as the supplier (if available), that way they can install the component for you. Now, go ahead and click “Next”, then “Next” again, then pick the components you want them to add (cost will be shown). Then, proceed to a final review before adding to the shopping cart.

What I got in the mail for my order

My order from JLCPCB looked like what’s shown on the following images. Good box and safely packed. I was happy with what I got!

Adding final components to the Printed Circuit Board (PCB)

When ordering the PCB we had the following components added by JCLPCB: 2N2222 transistor, 2k ohm resistor, and wire connector blocks. The following components were not added by JCLPCB and had to be added by myself (see pictures):

  • LED Flash – will simply be wired to the wire connector block.
  • Battery & battery connector – will simply be wired to the wire connector block.
  • SR602 PIR – Not available at JLCPCB and will solder wire to terminals to then connect to sensor.

Testing our PCB

Once fully wired, with battery plugged, we are ready to test our PCB! For this, I also went ahead and 3D printed a casing to get a better a sense of testing a fully functional prototype for this example project.

Components used in this example

*As an Amazon & Ebay Associate I earn from qualifying purchases.

Printed circuit boardOrder via after uploading your designIncluded the following provided by JLCPCB: 2N2222 transistor, wire connector blocks, 2k ohms resistors.
Super bright LED Flash
SR602 PIR Sensor
Duracell A23 12V BatteriesLink to product
A23 Battery HolderLink to product

Leave a Reply

Your email address will not be published. Required fields are marked *