Hi guys, my name is Robert Feranec, I’m from FEDEVEL Academy and in this video, I would like to speak about Arduino Everybody knows Arduino, and many people use the Arduino schematic as a starting point to design their own boards Today, I would like to show you 14 different points or 14 different tips, which you may want to consider when you will be designing your own board, based on Arduino Uno design The first point what I would like to speak about is very simple one It’s the USB type B connector This is the first component or first change what I would do, when I would be designing my own Arduino Uno based design I would replace it by what do you think, USB micro connector, yes, because it’s smaller, takes less space and what do you think It’s used everywhere so everybody has the USB cable, everybody has charger or adapter because you know, every mobile phone, every tablet use this kind of adapters And you can use it for power up your boards then Point number 2 Here, I would like to speak about RESET There are only few very important pins, on each microcontroller And one of these important pins is RESET What do you think, why? Because if reset is not connected properly, your board may not start properly Your board may not be reliable enough Your board may reset randomly Be careful about this signal Have a look how they connected it I click on this schematic, and you can see in the original design, there is only very simple connection Like RESET pin, a diode, a pull up, RESET button connected directly to the RESET signal, couple of connectors and an unusual connection through this series capacitor with the other microcontroller This connection is used for auto reset when firmware of this microcontroller is updated Now, have a look how Atmel recommends to connect reset signal of AVR microcontrollers You can google for it Yeah Click on the application mode, there are actually a couple of very important points, one of them is RESET I jump to the RESET section and you will see how they connected it This is the recommendation from the Atmel Diode, pull up and a capacitor If you are planning to use debugWire, you cannot place this capacitor to the RESET signal because you know, it will influence the signal and you would not be able to debug the microcontroller Here is how I connected it, in my schematic Here is the RESET The RESET pin and it goes to this buffer Before the buffer, there is the diode The pull up resistor and the capacitor These components, they will guarantee the proper RESET, pulse width I also place here the RESET button Again, these components, they will help to debounce this RESET button and also, when you press the RESET you will always get the proper RESET pulse width Don’t forget, this buffer, it is

open drain buffer and you need to place there a pull up resistor, which is here The point number 3 is about power decoupling and filtering When we have a look again on the Arduino schematic, you can see there is only one capacitor, placed on VCC and AVCC Open the AVR hardware design guide, find the section about decoupling and filtering, and you will see Atmel recommends you to do a little bit more So, you should use decoupling capacitor for every pin on your microcontroller, and sometimes also you may want to consider to place there a ferrite bead This is what I did VCC pin, it has decoupling capacitor of 100nF AVCC has its own decoupling capacitor Also, sometimes it is recommended, to put there one bigger capacitor, in uF, like here, 10uF, 10uF, and especially, in the cases when you use analog parts inside the microcontroller or even processors You really may want to use, beads to filter the power pins Here you can see, here is a bead which, filters the analog power pin Here is a bead, which filters the digital power pin If we have a look on this, power section, which is here, you can see I don’t use the analog to digital converter, in this microcontroller, so we just place here two 100nF capacitors 1 bead and 1 bigger capacitor This is not recommended only by Atmel design guide, it is recommended by many, many other design guides, including AMD design guides or Intel design guides So this is the way how you may want to consider to connect power pins of microcontrollers or processors The point number 4, series termination resistors In case in your design, you configure some of the pins as clock outputs, like in this example here, you may want to consider to place there 22 or 43 Ohm resistors close to these pins I don’t want to go too much into detail, but it helps, okay It’s done because of, it improves crosstalk situation between this signal and the signals, which are routed close to this signal and it’s because even the microcontrollers are not very high speed components, but the buffers, which are inside the microcontroller they are still very quick They can change the level from 0 to 1, or from 1 to 0 in like 3 – 4 nanoseconds, which is very very quick and in case you route signals, sensitive signals like RESET or Interrupt, close to this, you could get some crosstalk and false interrupts or false resets Okay This is the reason why if you have some clocks in your design, you may want to put there series termination resistor You don’t have to understand at this point just, it is recommended by many design guides The point number 5, is about 3.3 Volt IO voltage Most of the boards are running now with 3.3 Volt IO voltage and 5 Volt is not so used anymore If you have a look into data sheet of the

ATmega328P microcontroller, you can see, the operating voltage is from 1.8 to 5.5 If you have a look on the other microcontroller, the ATmega16U2, you can see operating voltages 2.7 to 5.5 Volt There is no real reason why, we could not power the 3.3 Volt IO voltage The only catch is the crystal frequency You need to be careful if you would like to run on 3.3 Volts, you have to check Go here Electrical characteristics -> Speed grades, you have to check this oscillator frequency When it is running from 5.5 you can use 16MHz crystal If it’s running from 2.7 V, you have to use 8MHz crystal For the other microcontroller, again, go to the Electrical characteristics -> Speed grades, 5.5, it runs up to 20MHz but for 2.7 Volt, you need to use 10MHz crystal When you change crystal, you may want to recompile your firmware That’s quite not the best but 3.3 V IO voltage it really is an advantage So, again, think about it The point number 6 is about firmware update Always, when you are designing boards like this, with some chips, which need to be programmed, think about the simplest way how you can program them One of the ways how you can do that is program the chips before they are fitted on the board One of the things or one of the ways how you can do it, you can use an external programmer, but it’s always really good to have an option to be able to update the firmware on the board when it is already assembled just by using some software This is not possible on the Arduino Yes, you can say, yeah it is possible because for example you can update firmware of this 328P microcontroller from the Arduino environment Yes, that’s true, but you already need to have this chip programmed because there has to be series bootloader program before you can use it with the Arduino environment So, how are you going to program there the series bootloader if you cannot use external programmer or if you don’t have it and the chip is already fitted on the board And I was very surprised because there already is this option, there is already this different chip, which can be used as a programmer And it’s not difficult to do only the thing what is problem, it’s this RESET here I found this project, it’s called LUFA Inside the project you can find firmware for AVRISP-MKII Programmer When you compile it and you load the hex file to this chip, it becomes a programmer And everything what we have to do is just connect this connector to this connector, except this RESET pin This one has to be replaced by this PB4 signal That’s exactly what I did in my schematic, I’m going to show you Here is the ICSP connector of the 328P microcontroller, you can see the RESET is connected to the RESET of the microcontroller Here is the ICSP connector of the programmer, let’s call it programmer of this 16U2

and there are more options how this RESET pin can be connected Here is a jumper or link, which you can use and this is the RESET, when you fit this link, it’s connected to the chip RESET when you fit this link, it’s then the PB4 pin So when you fit this link between 2 and 3, then you can use this header as a programmer You can use the cable like this Can you see the cable? It’s a direct cable between 2 headers and you can simply program through this chip, you can program this big chip Very simple That’s also Point number 7 Always think what, how you could make this board even better Not only for your application maybe also for some other applications And if you put there this support with this jumper 3, this board can be also then used as a general programmer That’s the Point number 7 Make it also a general AVR programmer Tip number 8 Connector pinout I googled for this very nice picture of Arduino, where you can see all the pin descriptions, and if you would like to stay fully compatible, with Arduino board, you cannot change the pinout But if you are designing your own board You really, really, really should consider to place at least one ground pin on each header For example here, this analog inputs It’s very important that a ground pin is placed in this area Here Digital pins, there is not ground pin Okay, be careful about this Another thing what I noticed when I was doing some experiments with Arduino, I always had to connect at least 2 connectors I always had to connect some wires from this connector, and then other wires from this or this or this connector, which is here Because, do you know why because? Because there is these 5 V here So what I would do probably, I would place these 5V also on this connector, which is here Then in many many cases, I could just use this one connector because there would be ground, there would be +5V and some digital inputs and outputs This reference signal, which is here, really belongs to this analog connector, which is here down, so I would move it here Tip number 9 When you are doing layout of 2 layer PCB, it is very important that you try to make as big solid ground plane on one of the layers as possible Usually this ground plane is placed on the bottom layer of the PCB Here you can see how I did it On the top layer, most of the signals are routed here On the bottom layer, this is ground plane, as big as possible, as solid as possible These are the planes here They are power planes and only minimum signals are routed on the bottom layer These are here because they are crossing all these tracks, which are here on the top layer So try to create as big and as solid ground plane as possible It’s important It’s always important not only for 2 layer PCBs But it’s very important for 2 layer PCBs

Tip number 10 The gap between tracks I googled for another picture This time it’s from Sparkfun website Here you can see Arduino bottom layer, and you can notice that these tracks are routed quite close to each other If you have a look on the EAGLE PCB file of Arduino, you can see the tracks are routed quite close to each other There is a big free gap routed close to each other A big free gap If you have a situation like this try to spread the tracks through this free space Try to make the gap the space between the tracks as big as possible Do you know why? Because of crosstalk Arduino is not really high speed board but as I explained before there are buffers, which are still quite fast You know, the pins, the buffers, which are connected to the pins are quite fast And for the crosstalk, is important how fast the edge of the signal is How fast the signals changes from the low to high signal, from high to low signal Crosstalk, what does it mean? When you have a track routed, then this track can influence the tracks, which are routed close to this track That’s something what is called crosstalk And For example, again, I mentioned it a little bit before For example, if you have a clock routed and then you route RESET signal or Interrupt signal very close to this track, then the crosstalk from this clock can generate noise on this RESET or Interrupt signal so high noise that you will receive false interrupts or your board will reset randomly So, if you have space like this, make the gap as big as possible, it will help you Especially, because this is design on 2 layer PCB, it’s very hard to do 2 layer PCBs You cannot really meet impedance Impedance would improve this cross talk situation, and you cannot really have solid ground reference plane or solid reference plane under these tracks or above these tracks Again, this would improve the crosstalk situation 2 layer PCBs are really hard to design I’ll show you here, how I did it See Tracks are spread as much as possible The gap between them is as big as possible Especially, this is clock signal Okay You can see around this clock signal, the gap is even bigger than between the other signals And here in this clock signal, you can see also the series termination resistor, which we mentioned before RESETs, I’ll show you RESETs This is a RESET signal This is ground and RESET signal is routed far away from this other signal This is also RESET signal routed far away from this signal Reference, this is not going to change It will not influence the RESET signal This ground is not going to change so it will not influence the signal The RESET signals can be routed a little bit closer These signals are going to change so it’s routed far away from them Okay, when you are doing the layout, think about this stuff Point number 11 Simple board shape I read somewhere in forum, that Arduino guys, they designed this shape intentionally to look like this but maybe when you are designing a board for cost sensitive applications, you may want to keep the shape as simple as possible

because to create this shape, which is here, it requires one more PCB manufacturing step, which will cost you money If you just make it as a square, it’s cheaper The tip number 12 Mounting holes When you are designing or placing mounting holes, be sure there is enough space around the mounting hole For example, here If you tied up a screw, you may easily make short circuit between this ground, which is here and between this track here You can damage this track The easy way to prevent this situation is to use big pads around mounting holes As big as the head of the screw So you are sure there are no other tracks routed very close to the hole Sometimes you may want to connect this big pad around mounting hole to ground for example The tip number 13 We are almost done The tip number 13 is about Always mark pin 1 on connectors You know it’s really, really good to do it On Arduino you can argue there are nice descriptions for the pins., so you don’t really need to know where the pin 1 is located You do. If you have a connector on opposite site and on the connector you have mark on the pin 1 How are you going to plug it in, into this board if there is no pin 1? You have to look into PCB It’s very easy to do Just put there number 1, number 1, number 1, number 1 Many engineers also do that Use a square shape for pin number 1, see, square, round, round, round On the Arduino, all the pins are round It’s not required but it is good practice It helps a lot The tip number 14 Connector placement Always when you finish your component placement, fit also all the mating parts for every connector, which you have on your board Just to be sure you can plug it in For example, I know in Arduino, they added these 2 pins later and they have to stay compatible with the previous boards, but in this board, which is here, you cannot really plug in this connector I’m not sure if you can see that Because it’s too close And in case you would like to connect this header with this header, you would have to somehow bend the cable, again, the connection is not the best as it could be This is what I’ve done on this board I keep a lot of space around the headers, and pin 1 is in the same direction so these 2 headers can be connected directly with a simple cable It’s very useful when you plug in all the mating, you may be surprised how many times you can make a mistake and you have to move the connector or components around the header And that’s it! I hope you found this video useful, if you would like to download the files, which I used during the video, these Altium files, this Altium project, you can find it on the www.28pins.com 28pins because the microcontroller has 28 pins I really couldn’t find a better name for it And, here on the bottom, you can download the full Altium project You just need to register but otherwise, it is open-source project, you can use the files for your

personal project or even for your commercial projects Thank you very much for watching this video Don’t forget to check out our other videos and I would like to wish you a really great day, BYE