Microcontroller Tutorial 4/5: Creating a Microcontroller Circuit Board

Photo of a PCB Design screenLet’s get ready to circuit board desiiiiiiiiign!

We are now in the fourth part of the microcontroller tutorial. We have a microcontroller circuit diagram ready. It’s time to make a circuit board. I love this part. This is the “magical” step that takes the idea we started with and turns it into something real.

But let’s recap. So far we have learned:

In this fourth part, we are going to create a circuit board for our circuit, then get this board created in one way or another. This can be done in several ways, as we’ll see later.

To design our circuit board we’ll use Cadsoft Eagle. It’s available in a free version and works on Windows, Mac and Linux.

Designing Schematics For Our Microcontroller Circuit

The first thing we need to do, is to put our schematic design into Eagle’s schematic editor. If you are not familiar with this process, check this out: How to create schematics with Eagle

In the previous part of this microcontroller tutorial, we decided on which components to use and how to connect them. Here is the circuit diagram we ended up with:

Microcontroller Tutorial ATmega32U2 circuit with values

The ATmega32U2 microcontroller, is not in Eagle’s default library. I could have designed my own custom component, but to save time I used a library that I found here: https://github.com/civanovici/roduino/tree/master/eagle/eagleLibrary

For the USB connector, I used one from Sparkfun’s library here: https://github.com/sparkfun/SparkFun-Eagle-Libraries

Designing Our Board Layout

Create board from schematic in eagleThe next step is to design the board.

In Eagle, we can click on the «Board» button in the toolbar to open the design editor. If no board design exists for your schematics, you will be asked if you want to create one. Answer «Yes» to this.

I always start out by defining my board size. I know that I can get really cheap prototypes if I stick to 5cm x 5cm (1.9685 in x 1.9685 in), so I will set my board size to this.

Now it’s time to place the components onto the board and draw the connections.

In this design, I wanted to draw only on one side, so that it would be easier to mill or etch the board – just in case I wanted to do this.

ATmega32U2 circuit board layout

You can download the finished design here: Microcontroller-tutorial-files.zip

Making the Board

There are three main ways of making a board from an Eagle design; etching, CNC milling or ordering from a prototype manufacturer. Earlier, I’ve written an overview of the three methods.

In my opinion, the easiest way is to use a PCB manufacturer. It takes a bit of time to wait for your board, but at least everything will be done properly. This does not have to be expensive. You can order 10 boards for $10 at some places. And the cheapest shipping option can be only a few dollars.

To find the best option for you, I recommend checking out pcbshopper.com that allows you to enter your board details and country, then find both price and delivery time to your country.

To see exactly how you can prepare an order of cheap PCB prototypes, check out this video:

I ended up ordering my boards from seeedstudio.com. Because I wanted to get my boards fast to continue the tutorial, I paid for the fastest shipping option. Hopefully I will get it very soon.

Getting Components

A board without components isn’t very interesting. So we need to get out hands on some components too.

There are many stores that sell components online, check out my recommendations here.

Complete Parts List

Part Description Value Package
C1 Capacitor 1µF SMD 1206
C2, C3 Capacitor 12-22pF SMD 1206
C4 Capacitor Polarized 10µF Through-hole
JP1 USB Connector USB Type B Receptacle Through-hole
JP2, JP3 Header 8 pin Through-hole
LED1 Light Emitting Diode 1.8V Through-hole
Q1 Crystal 8 MHz SMD C49UP
R1, R2 Resistor 22 Ohm SMD 1206
R3 Resistor 200 Ohm SMD 1206
R4 Resistor 10k Ohm SMD 1206
S1 Momentary Switch Through-hole
U1 Microcontroller ATmega32U2 TQFP-32

If you can’t find a specific part, you could use findchips.com to find out which stores that have the part you are looking for.

Now we just need to sit back and wait for the boards and components to arrive.

Continue to part five where we’ll solder and program the circuit >>

More Microcontrollers Tutorials

28 thoughts on “Microcontroller Tutorial 4/5: Creating a Microcontroller Circuit Board”

  1. Will it work to do a dual sided board and just repeat the same thing on the other side of the board to save space on my robot?

    and will my raspberry pi be okay to program it with?

    Reply
  2. Thank you again Oyvind for all of your tutorials. They have been so informative and inspiring. This has to be my 2nd favourite part of the process. I like the way u have used through hole components to ‘jump’ over other circuit traces. I also like to use Ground pour for all my GND points. I will be definately purchasing your book for Xmas.

    Reply
  3. Oyvind,

    You said that you used a library you found on GitHub for the AtMega 32U2. How would I install that into Eagle?

    Thank you.

    Reply
    • Hey Rick,

      Download the .lbr file. Then in Eagle choose the “Library” menu in the schematics view and select “Use…”

      The find the file you downloaded.

      Or you can put the .lbr file in your Eagles library folder.

      Cheers!
      Oyvind

      Reply
  4. Hey,
    Great tutorial, I have a question, I only see top layer GND pour, isn’t it better to have bottom layer GND pour as well?

    would be awesome if you shared your thoughts on why you didnt chose to do that

    Reply
    • Hey Pranav,

      Often you have one VDD layer and one GND layer. In this tutorial, I wanted to draw everything on one side only.

      Cheers!
      Oyvind

      Reply
  5. Hello!

    Can You give to me those components links? I didn’t find any componets but I tried.

    I mean this
    Part Description Value Package
    C1 Capacitor 1µF SMD 1206
    C2, C3 Capacitor 12-22pF SMD 1206
    C4 Capacitor Polarized 10µF Through-hole
    JP1 USB Connector USB Type B Receptacle Through-hole
    JP2, JP3 Header 8 pin Through-hole
    LED1 Light Emitting Diode 1.8V Through-hole
    Q1 Crystal 8 MHz SMD C49UP
    R1, R2 Resistor 22 Ohm SMD 1206
    R3 Resistor 200 Ohm SMD 1206
    R4 Resistor 10k Ohm SMD 1206
    S1 Momentary Switch Through-hole

    Reply
  6. Hello!
    Can you make custom circuit board for me. (I just need JP3 lines more, no led etc) I mean something this I know, I’m very bad :D But if You can catch the idea what I mean

    Reply
  7. hello, thanks so much for your tutorial. i was going to get my circuit board from oshpark.com but it requires a board outline can you give me one? thanks again.

    Reply
  8. I was wondering why you have a polarized capacitor, C4, on the vbus and gnd lines? I looked at the data sheet but I never saw that. Could you explain why you did that?

    Reply
  9. Shouldn’t we connect the two GND tracks (two big tracks on the layer) together? Or is it connected to each other somehow?

    Reply
    • The ground tracks are connected. I’m using a ground plane, so the ground is the three bigger “islands” on the board which are all connected.

      Oyvind

      Reply
  10. I am not able to get the microcontroller book PDF I have tried 4 times and it is now 1 hour from my first request. Please help me to get the ebook.

    Reply

Leave a Comment