Let’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:
- Part 1: What is a microcontroller?
- Part 2: How to choose your microcontroller?
- Part 3: How to design a circuit diagram for your microcontroller?
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:
Download the Microcontroller Tutorial
A step-by-step guide on how to make a microcontroller board you can build at home using standard hobby tools.
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
The 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.
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
Download the Microcontroller Tutorial
A step-by-step guide on how to make a microcontroller board you can build at home using standard hobby tools.
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?
Since there are a few through-hole components on the board, this will mess things up if you repeat the design on both sides. But if make them into surface mount devices too, the you can do it. It shouldn’t be too hard.
I think it should work on Raspberry Pi, but I haven’t tried, so I can’t guarantee it.
Cheers!
Oyvind
Thanks you are a great teacher.
U are really an awsome teacher….it helped me a lot
u r a great teacher .thanks am reli learning a lot
I’m glad to hear that =)
Oyvind
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.
Haha, yes it can be helpful with some through-hole components to get your traces to tricky places :)
Cheers!
Oyvind
Hi,
Great tutorials, I learned a lot out of it. Thanks you Øyvind.
Great to hear =)
Oyvind
you are good thanks bro:
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.
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
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
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
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
Hi,
These are all pretty standard, so you can by them from most online stores. For example Jameco: http://tinyurl.com/pc68jv4
Cheers!
Oyvind
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
Aah… I forgot something:
Can I just put servos those JP3 lines? And what is that big metal thing there?
this metal thing :)
Hi, I don’t have time to make custom board. But you can find people for that on for example elance.com
The metal thing is the USB connector ;)
Cheers!
Oyvind
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.
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?
It is called “decoupling capacitor” and used with almost all types of MCUs.
Shouldn’t we connect the two GND tracks (two big tracks on the layer) together? Or is it connected to each other somehow?
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
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.
If you have registered for the newsletter before, the system does not understand it. I’ll try and find a fix for this soon. But if you send me a message, I’ll send it to you:
https://www.build-electronic-circuits.com/contact
Best,
Oyvind