How to design an ESP32 PCB with KiCad (in less than 25 minutes)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video within just a few minutes you're going to learn how to design a custom printed circuit board using an ESP 32 module so this is the schematic that we're going to be designing the board around and we're using the esp32 S3 um which is a newer version of the esp32 we're using the esp32 S3 Mini module with the uh PCB antenna built into the module and then we have over here we just have a micro USB port we have our power and our two data lines coming in and then we have ESD protection for those pins and then down here we just have our linear regulator which takes the 5vt USB and steps it down to 3.3 volts now in this shortened version of this tutorial specifically for YouTube we're going to keep things a little bit extra simple for example I'm not going to connect up any of the io header pins also this design has no peripheral functions and but however in the link in the description below you'll be able to access the full unedited version of this tutorial where we actually design a slightly more complicated board all of these IO pins will actually connect those up to header pins so you can actually use the board on a along with a breadboard then we'll also add a temperature humidity sensor and an RGB lad that you can control and then also instead of a just an older USB micro connector we'll use use a USBC connector and if you happen to be a member of my Hardware Academy I've got this full tutorial for the more complicated version of this board setup as a course with easily digestible lessons you can easily access all of the design files and of course you have access to me and other experts to ask any questions that you have and then also we're going to order the boards and get those back and program and test them and as a member you'll be able to get one of these boards shipped to you okay so let's take a quick look look at each of these subcircuits here we have this is the main esp32 module we have a whole lot of IO pins that you were not connecting up for this project but you could bring those out to header pins or connect them to other peripherals this is also where you'll access other serial interfaces like i2c and SPI and then so those are none of those are connected we have our 3.3 volt Supply this is output from our linear regulator that powers the esp32 then we just have our two decoupling capacitors for that then we have the module has a whole bunch of ground pins this symbol just has them all on top of each other so you just need one ground connection it just makes it a little bit neater but you can see there's a bunch of pin numbers here you may see some symbols where they actually have each ground pin listed separately I just like this one because it's a little bit easier to hook up and a little bit cleaner schematic then we have the only thing left we have is our enable so this has got a pull-up resistor a capacitor and a push button so what happens when power up this capacitor C3 acts like a short because it's not charged up yet so the enable pin is pulled low and then it's pulled High by being charged up through this 10 Koh resistor that charges the the C3 and pulls up the enable pin eventually to the 3.3 volt Supply so what this does is it just gives you a power on reset as soon as you power it on the enables low and then it goes high and that does a reset you can also force a reset at any point by just pressing this reset button which grounds the enable pin and then when you release it it goes back high re-enabling it so that's a reset function then the other thing we have down here which is nearly identical except there's no pull-up resistor we just have this capacitor and a a push button with just boot that goes to ground and what this is used for is for putting it in programming mode then the only other pins we have here are the two Ur pin which we're not using this is just to transmit and receive okay so that is an overview of the schematic for the printed for the esp32 module keep in mind since we're using the module some of the other circuitry is already embedded inside the module so it's pretty simple when you use the module then over here we just have our micro USB we have our Shield in our ground we have our USB uh power supply the 5vt supply then we have our two USB the positive and negative these are two this is a differential pair so we'll get into how you go about routing these because they need to have some level of impedance matching and then down here we have our estd protection diodes this is a chip that has four protection diodes we're using three one for each data line and one for our 5 Vol Supply then down here the only thing left is our simple linear regulator which takes 5 volts in uh we have an input capacitor and then we have 3.3 volts out with our output capacitor for any regulator you need to have an input and an output capacitor to both stabilize the feedback loop that happens inside the regulator but also to help with any transients then we just have the enable pin pulled High to the end so it's always enabled whenever 5V USB is present we output 3.3 we're using an adjustable version of this linear regulator so that means we just have the resistor divider the feedback divider is external so for fixed linear Regulators fixed voltage outputs this resistor divider is just internal to the chip but on an adjustable which generally ends in an 01 part number then you can just bring the resistors external so you can set the output to whatever you want in this case i' set it these resistor dividers to give us 3.3 volts on the output and you can refer to the data sheet or for the simple formula for calculating these resistors and then the only thing left is we have our just our power on LED that illuminates whenever we have power and we just have a 5.1 KO Ohm resistor to limit the current through that led okay that is everything in the schematic now we're going to convert this over into the PCB layout and begin connecting everything up okay the next step is we're going to go under Tools and we're going to do update PCB from the schematic and what that will do is place all of the components and we'll do update and close and we can drag it right here okay you can see all of our components here I'm going to just start quickly whoops I'm going to start let me pull out those passives so we have our there's our main module we'll have our USB connector here at the other end of the board we'll have our rid of the we'll have our ESD will be down here by the USB connector let me just get rid of these part numbers okay and then we just have our ldo our low linear regulator and our power on LED which we'll just move over here near it and oh and then we have our let me actually move this back down let's put our two switches here okay there are the primary components then we just have our RS and C's so what I'm going to do now is I'm going to draw our board Edge so I'm going to go and I'm going to select Edge cuts and then I'm going to do a rectangle and we want this here so this is the the PCB antenna on the uh esp32 module and we just have to make sure that this hangs out over the board you don't ever want any ground above or below this antenna so the safest way is to have this just hanging out over the board so I'm going to I'm going to just start my board edge here and let's go down here and there's the you can see the PCB Edge there for the USB port connector there we go Center this up a little bit more let me zoom in here okay so there we have our uh the module placed we have our uh USB connector okay it's just a matter of we start connecting things now we can bring in all the passives in a moment but the first thing I want to do is connect up the USB data lines now the esp3 2 S3 only supports up to full speed uh USB so it's not going to be the high speeed USB that you may be familiar with it's it can support low speed and full speed and these two speeds are typically slow enough that the data lines for the USB port aren't super critical you could get by with probably not doing impedance matching and just make sure that you rot them the two lines near each other and you'll be fine but for this I want to show you the proper way to do it in the shorten version of this video I'm not going to do the actual calculations for figuring out the exact specifications for the differential pair but in the description below you can find a link where you can access the full unedited version of this video that shows you all of the steps so we what we want is we want our lines to run right over this uh ESD okay so we have our n on this side our p on this side let's get those and what we're going to do is we're going to go here and I'm going to select the differential pair and what it should do is it automatically knows these are n and p so it knows these are this is a differential pair and it's going to try to keep the spacing that we set but I'm going to just make sure because I don't think I've set this yet I'm going to just do a custom and we'll do oh this is actually let me go under differential pair okay so we want our width was 61344 and our Gap is six and then the B is I'm not concerned about so what you'll sometimes see happen is it does weird things when you get to the other connector so sometimes you have to when you're in differential mode just draw it close and then we'll go in and do single-ended connectors I'm going to actually just scoot this over and then we can just go in here with our go single-ended and just connect those up okay so there's going to the ESD so it's not really that critical this is not where the impedance matching is super critical I'm going to just short these across and now we're going to Route differential again and this is where it comes in more handy and let's do it to there okay okay and what I could even do is just scoot all this over a little bit make it where it lines up and now let's go into our single wi mode now the only other thing we need to do is to finish this and we'll do this in a moment is this has to have a ground plane underneath of it and ideally nothing else next to it okay now let's start placing some of these Capa these passive components I'm going to go back here and take a look at the schematic so we have a C6 and 7 R six and 7 go by the ldo okay so let's take a look at those we have six and or seven me and then here's six then we have I believe let me can't see these I think the it's these two here okay let me get rid of these values oops okay and then R8 Al That's goes with our LED here D2 okay so let's go in here I'm going to scoot these down I'm going to get rid of these values okay so we have let's go back here we have six on the input and our input is right here is pin six so what we're going to do is we're going to rotate this around and something like that and then this one here we'll rotate around and put like that and then let's of course we can't have these on our USB data lines let's scoot this over and I'm going to move this D designator here and I'm going leave that one there okay then we have our two these are the two feedback resistors and these are very non critical where they're you want them place near the ldo but they don't have to be any certain position okay let me get rid of this as well and that okay and let's rotate these around so there's our 3.3 there okay so there's our inner point just increase this let's go and do this up to 12 just to even though the minimum six Ms can handle the amount of current that we're doing it's just I like to beef up the power lines a bit okay and now we just need to tap this tie that there so this is just sensing the output and then it's going to feed it back into the feedback pin of the ldo and here's our enable which is just tied to uh BN okay so there is our regulator let's we need to scoot this down so there's no overlap now I'm going to actually just I'm going to change those put those up here and let me move this back up a little bit okay so what do we have left we have R8 over here which is our current limiting resistor for our diode for our [Music] LED once again this is I'm just going to increase it a little bit it's not necessary but okay ground will be grabbed by our ground planes and now we just need have to we'll connect that up over here we'll do that in a second and then we have C1 2 3 4 and R3 let's see where these go okay R3 C3 go with reset one R3 C3 I can put those over here by our reset button and let's actually rotate these and then that way I've got the enable on this side and just tie right up there shwi those together and then we need our 3.3 let's actually take it off of there this is no current whatsoever going down to this resistor but okay and then ground should pick that up by the ground plane and then we just have there's that and then we have C4 goes with boot one and okay and then we just have one and two which oh those are the decou Lan for our esp32 we really need those CU our we have to grab the pin here I'm going to I'll route that on a different layer going to move this a little bit lower and let's bring all and let's just get rid of that we reconnect okay so I'm gonna 3.3 okay that goes there and we going to Tri these again okay now we have room for our C1 C2 let's get rid of the values here now I'm going to connect these together with a let's just do it 12 and then we going to do a via and let's make sure yes we have so I've got four layers set up we'll use the second layer for a ground plane the third layer will be for a ground plane but also some power routing and then the top and bottom layers will be most of the other routing Let's uh need to connect this via to 3.3 and then we'll do another via actually let's go ahead and just start routing I want to be on layer three yeah layer three and then place a via okay there we go I see what else we have we've got ground pins that will have to be connected we need to connect up our two switches to our yeah here we go let's see I'm going to gpio zero is here so let's go and I'm going to be a okay so now I'm on the bottom side and let go that in here there's that one now now we need this one go in the other Corner okay so let's go ahead and be a down and okay so now we're going to just draw our our copper fill or copper pore or fill Zone they go by lots of different names but I'm going to I'm going to go back up to my layer one and I'm going to do it play fi Zone and I'm going to just start here and we want this to connect to ground I don't want to remove Islands minimum width let's do six clearance six okay now just have to draw the [Music] other I'm drawing this approximately which is should be fine okay close outline okay there we go and now I'm going to select that zones I want to duplicate it and let's duplicate it on the other layers as well and it duplicated it but it kind of shifted it so I need to move it back up where whoops where it aligns with the other ground plane okay now I'm going to go and let's just just fill all copper zones let's check one thing here did not want thermal reliefs necessarily set on I me I'm just having to go through each of the four copper pores now and I want to okay that one's on there and then or solid okay now okay and let's go to the top level I'm going to actually turn off these other layers so you can see there's the copper poure you can see it grabbed the Via pins over here and here the last thing we need to do is add ground Vias to make sure the grounds are the very on the various layers the ground copper pores are all connected together and I'm going to just start by adding a via here let's connect it to ground and then we'll copy it maybe if we can get one up here here these are all grounded and it's where the power dissipation can happen so we want to make sure we have a really good solid ground here for the heat transfer okay then we have a ground up here ground there here there and then I'm going to to do grounds next to every ground pen okay and last thing I'm going to do is just it's not really that important but I just want to move this VI a little bit away from the data lines me drive this line over here here okay let's make sure we're not going to here this here should be good move that a little bit further away okay and one more thing we have our U1 die designator way up here off the board I'm going to actually move that down let's just put that maybe right here okay now we just need to fill our copper pores and run design rules check and we can do that all as part of One Step here refill zones before performing uh DRC and then we also want to check to make sure our PCB matches the schematic we have zero violations zero unconnected items and zero air differences between the schematic and the PCB
Info
Channel: Predictable Designs
Views: 34,210
Rating: undefined out of 5
Keywords:
Id: jiJGbWOSdMo
Channel Id: undefined
Length: 22min 46sec (1366 seconds)
Published: Tue Feb 20 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.