ESP8266: How to design custom ESP-12E PCB. Typical TCP client-server application.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back to our series about esp8266 wifi module in previous videos we have covered a lot of practical examples with this esp development board but in this video i would like to cover more details about its central part which is p12e module you might ask the question what's the reason to use this lightweight version of esp module while we most development board already have all necessary stuff such as usb 2 serial converter 3.3 volts power supply and others so the answer is simple it is price vmos development board might cost you around two dollars while esp12e module you can get just for one dollar this way if you are planning to make some cheap mass production for your project then definitely sp12e ibsp 12f is your choice and here i would like to solve the first challenge this module basically doesn't fits into breadboard to make simple testing this way i will design special adapter board using keycard this adapter pcb will have pins with standard pinch size of 2.54 millimeters so it will be pluggable into classic breadboard there are multiple existing solutions on the market already but i have found them not very useful as you can see in this example once this adapter is plugged to the breadboard you no longer have any access to put your wires also i have ordered here few additional esp modules just to try to build sample wi-fi client server application so i will be showing corresponding demo in this video this is the package how it comes from aliexpress nothing special here usb modules themselves are sealed within real tape containers and you might notice that currently there are two popular versions available on the market one of them is esp12e and another one is newer version which is esp12f so you can use any of them with examples which i will provide in this video as footprints for these two modules are absolutely the same in this way we'll be covering the following topics in today's video which includes the sp adapter pcb schema and layout design and keycard also we'll be covering some basic wi-fi client server application to demonstrate how to work with these modules so here i have my keycard version 5.0 and at this point i just would like to create a new project as we have discussed our goal is to design and fabricate adapter pcb to be able to test the sp-12e module on the breadboard the first stage which we'll be having here is a schema design and i will start with the usb component placement now we need to find our module in this list you might notice two available versions so you can pick it up accordingly this link below will redirect you to official datasheet here you can find a lot of useful information this includes footprints layout metrics various connection schemas for different applications and power supply reference design so definitely i do recommend to download this document and make detailed reading on it back to our schema design now let's place our esp module also i have to make here some label positions adjustments as the next step we have to find and place corresponding connectors which will be compatible with breadboard we'll be using generic type with 11 pins accordingly once connector is placed on the schema we can use c key in order to make a copy we have to use two of them because of we'll need 22 pins in total and now we have to place netlist node labels this will help us to establish connections between esp pins and corresponding breadboard circuit connectors i will be starting here with labels placement against esp module itself at this point we can use c key in order to duplicate corresponding node labels this way we can establish which usb pins to which connectors pins needs to be hooked up also i will be placing ground connection here this can be defined using gnd symbol so it will go under pin number 11. and the similar way i will place power supply node which can be defined by corresponding 3.3 volt symbol now we have to use wiring tool in order to connect everything together so this way we have finished our schema design and wiring and now we have to annotate all of our components once annotation is done we can run design rules check as you can notice here we have two errors this is because of our usb power lines are not in connection with special power flag i will try to fix it by placing direct connection between 3.3 rail and power flux the same way i have to do it for ground line and the power flux itself you can find in the same components list under power section now i just have to place this symbol on the schema and wire it accordingly so we can run design rules check again and now we don't have any errors the next step will require to make components associations with specific footprints so here on the right side you can look up corresponding footprint layouts this way we need to pick up 11 pins connector which will be compatible with breadboard so pinch size should be 2.54 millimeters also you might notice here that esp module footprint is already associated and as the final step on a schema design we have to generate netlist file so this file can be used in our next stage which is pcb layout design in order to work on a layout design we have to use special editoring keycard once it is started we have to make sure that we do define correct design rules these restrictions usually are defined by pcb manufacturer in case of glc pcb you can visit their corresponding web page so minimum clearance values are defined here minimum trace width and other restrictions i will start with track width and clearance definitions as they are defined in meals by glc this way it will be convenient for me to set them in mills now we can switch to millimeters and configure other parameters like minimum wire diameter minimum wire drill size and then the same wire parameters for default net class at this point before we'll jump into pcb design we have to review our breadboard layout the critical distance here will be between these two points so our pins layout on pcb should be matched otherwise we'll not be able to plug our adapter board into breadboard you can measure this distance using caliper and it will match exactly 300 mils which is a standard size for breadboards and deep package pins layout this way i do recommend to draw pcb outline on a piece of paper you have to use some reference point as a center of coordinates so you would know exact x and y positions for each corner point now let me set the grid size to 25 mils and at this point we have to draw some reference to set the center of the coordinate system i have to switch to user drawing layer to make fiducial marker so this way will not interfere with any other fabrication layers here using space key you can reset coordinates against harvard point then we'll need to use line tool to draw horizontal segment i will establish line thickness to 1 mil for further convenience and now we can draw the second line to establish the cross reference the final part will be a circle now if you restart pcb layout editor in this case your coordinate system will be reset so you can zoom in into this cross and press space button to restore the coordinates the next step will be drawing of actual pcb edges at this moment we have to use our paper drawing and make a reference of coordinates for each corner point so now we are ready to import our netlist file which we have created on the previous stage of schema design and this will bring all of our components to the table let me pick up our usp module footprint i will be moving this part to the left section of our pcb and here you can make some minor positions adjustments using arrow keys also i have to make sure to do not place any silk screen labels outside our pcb now let's move to connector footprints while you are moving this part you might notice that certain pin is used as a reference point so we have to place it at the exact position as we have outlined in our paper design i will be using arrow keys again to make the final position adjustments and now i will be repeating the same process for the second connector accurate position by coordinates here will guarantee us that we'll have exact 300 mil spacing between these two connectors now with help of keycard built-in caliper tool we can see that we have met our critical distance of 300 mils as the next step we have to place additional silk screen markers this way our pcb will have labels in place it will make better understanding which connector pin to which corresponding esp pin is connected we just have to place these silk screen text captions in appropriate positions once all pin labels sign place you can use 3d viewer tool to check the silk screen as you can see here we don't have any issues with labels positioning now we have finished with our components positioning hence we can remove our coordinate center reference point at this step we can start to make pcb tracks routing it is not a difficult procedure you just need to have some basic practice here if you will have a situation when you need to road specific track through bottom layer then you can press v button to establish my connection this will bring your track to bottom layer now you can notice that we have finished all of our tracks routing except ground and power rails and i have done it on purpose to use field zone tool instead let me adjust the grid size to 10 mils this way it will be more convenient to set the field zone the first field zone will be for 3.3 power rail also we have to make some adjustments here just to make sure that we'll meet glc pcb requirements so this field zone will be placed on a front copper layer now i have to outline this zone then i will repeat exactly the same procedure for ground connection and it will be placed to bottom layer accordingly once this step is completed we can run design rules check so we don't have any errors it means our ground and power rails connections have been established correctly and this is the final look of our pcb and 3d viewer no issues here now we have the final stage so we have to generate gerber files on the left side here you need to select necessary layers to export there are nine of them to be included i will set output folder name to gerbers and we have to generate drill files separately this is the only checkbox which needs to be set here and then we have to click generate drill files button now we have to click plot button to generate main set of gerber files so files generation is completed and now we can find them under gerber's folder which we have specified previously let me compress them into zip file so for further manufacturing you can submit this zip archive to glc pcb website you just have to click this quote now button and find the relevant file location there are a lot of different youtube videos about this glc pcb service and how to use it so i will not go through details here once uploaded you can review top and bottom pcb layers outline few days later i have my pcb package delivered so let's get it opened usually it comes with quite nice and robust cardboard box no exceptions in my case let's check the content here and here we are our completed pcb which we have designed in keycard let me use this high tech tool to unpack it i have ordered 5 of them in total so pin labels positioning looks good here also no issues with soldering pads bottom layer also looks accurate here so the next step will be soldering on the first step i would like to check parts positioning alignment as you can see our esp module can be placed here without any issues and we'll start with one single part thinning with solder for instance this one so i have to apply some flux here and then we can tint this part here we have our results this way we have tin single pin only and there are specific reasons for that it will be much easier for us just to hold this pcb and melt solder on this certain part so our esp module will end here completely flat this is because of other parts will be empty without any solder now let me apply some flux again at this point we are ready to solder our first pin now it is done this way as you can see this single point have secured our module in place now we are ready to proceed with other pins so as usually we need more flux again and here we can start with soldering itself as long as we have applied flux in at once and our parts have a lot of it then we can place solder to the iron tip directly and transfer to desired location sometimes you can find it more convenient rather than supplying solder directly to pcb part once the initial stage of soldering is completed i do finalize my soldering results for this purpose usually i do append extra flux here and then i do make final touch on each of these pins it will make connections nice and clean as a result finally we have our esp12e pcb soldered so we don't have any issues with connections all solder joints looks nice and shiny now let me grab some pin connectors each section here should consist of 11 pins exactly so this way will cover all 22 usb connections and this is the last thing which we'll need to solder to our adapter pcb in order to hold pins section in a proper position i will use piece of clay and overall soldering procedure is quite trivial here i have shown some details in my first video about esp module introduction so in terms of pin soldering i will not pay a lot of attention here to show different details so now we have finished with first header section all shoulder joints looks good here and now we have to repeat the same procedure for the second connection again i have to use my piece of clay to hold everything in the correct position now we have finished our soldering process and all header connectors looks good here no issues with pins alignment the first thing which we'll need to check here is whether our adapter pcb will fit into the breadboard so we have perfect placement here this way no issues to use breadboard with our esp12e module here i have prepared some basic connection schema in order to run and flash our esp module schema details are also available on my website in esp adapter pcb downloads section unto this design you have to pay additional attention to gpr number zero as in a standard run mode it should be pulled up to high level while if you are planning to flash application this gpi zero pin should be pulled down to ground all of the required connection details you can find in esp12 module documentation this is the document which we have downloaded from keycard link in the beginning of this video here you can refer this table which indicates esp pins configuration it shows which of them needs to be pulled up either pulled down depends on your setup also you might find another useful diagram here it indicates how the receive and transmit lines should be connected to external uart board so the connection scheme is standard here esp receive lines should be connected to external ur transmit line and as opposite esp transmit lines should be connected to external receive line so let's place our adapter board on a position and as you might notice here we have a reset button on breadboard but one hardware feature is missing here it is esp out reset circuit which we had before on a vmos development board this way flashing shell script which i have shown in my previous video needs to be split into two separate parts first part is optional it is just to erase previous content from esp memory and the second part is mandatory it is used to flash actual application here you have to pay additional attention to this now reset extra arguments they do indicate that you need manually reset usb chip just before flashing or running the application and please do not forget about gpa zero pin which needs to be pulled down in case if you want to write the program also it might be reasonable for you to have these two corresponding build targets defined in eclipse so you could manually set gpio pin and click reset button before each necessary step this is the next stage we have to connect our esp uart receive and transmit lines to external ur port you can try to use some standard usb to serial adapter but there is one trap here 3.3 volt supply rail might not be powerful enough to provide sufficient amount of current so this way usb device might be constantly rebooting while you will try to flash either to run application and i will try to avoid such issues by using my bible bone black it has quite powerful 3.3 volt supply rail also it has uart port onboarded so i will be flashing esp application from this device here we have everything connected now let's power it up i'm using second ur port on my beaglebone so i have made corresponding parameters adjustments on my flashing shell script and to demonstrate the main steps in terms of how to flash application i will try to upload our existing link example at the step number one you have to make sure to pull down gpio0 this way esp boot mode will be switched to firmware flash option as the second step you have to click reset button so a speed chip will be ready to accept new firmware by uart connection third step will suggest to trigger corresponding mag file target from eclipse i'm using modified version here as i'm triggering why beaglebone is the proxy host flashing procedure itself looks similar as i have shown in my first video about esp module once firmware is flashed and verified we can switch our gpi zero back to pull up mode this way our esp module is ready to execute new application at the final step you just have to reset usb chip again and this will trigger execution of uploaded example as you can see here our blink application works just fine so this concludes 4 main steps demo which you will need to follow in order to flash applications into usb 12e module this will be applicable if you will try to flash it with manual reset option at this point i have prepared second adapter pcb this way using our breadboards we can try to build some sample tcp client server application here i will use my beaglebone black again this time it will power server usb node while client node will be powered using my custom made power supply with 3.3 volts output it is based on a ms 1 7 module so using this configuration we'll try to transfer some data chunks from client node to server node and here i have assembled everything this way on a server node will have three leds which will be responsible to indicate receiver data while on the client node we'll use these three buttons to form one byte of data for further transfer to usb server here you can refer schema details for server node and this diagram represents client node connection details now let me power up my beaglebone black so this way we have our server up and running the client node i will power up using my usb power bank so it will drive my custom a 3.3 volt supply module at the initial stage you might notice that esp leds are blinking and later on they ignite it on a constant basis this way blinking mode indicates that esp wi-fi session is active already but tcp connection is not established yet and once you get leds constantly on it means client server tcp socket connection has been established successfully so once client and server are connected we can try to click any button as you can see here while we are pushing specific button we have corresponding leds ignited on the server's side it works by transferring corresponding byte value with encoded information about button state here you can see the basic byte encoding principle so we have three less significant bits indicating which leds needs to be ignited all of the source code of this application can be found on my website from the video description this sample project is also available on my github repository and now once we have finished all client-side testing the most interesting part is coming so now we can just remove the side completely and you might ask the question how could we send our data to server side in this case the answer is simple you can use any mobile device with wi-fi support for these purposes in my particular case i will try to use android tablet this is the first point we have to enable wi-fi module on our android system so esp server session will becomes visible for our tablet device this can be checked in corresponding settings menu and here we have our session in place wi-fi session name and the password will be set exactly the same as you have specified in asp server application so let me try to connect to this session here we have our wi-fi connection established successfully and it also indicates that there is no internet access this is because of internet gateway is not configured on asp server side but it will not cause any issues as in our case tcp connection is just local as the next step i will try to establish direct tcp connection to the server port i will use plain telnet session for these purposes as you can see here already have predefined telnet connection details on the specific port this port is also defined in our esp server application moving to the next step let me open this telnet terminal and here we can try to transfer some encoded sample bytes it represents the similar way as it was used with the esp client node so you can type any corresponding number and then click enter button within your terminal as you can see here led state has been updated accordingly you will have exactly the same behavior if you'll decide to use your mobile phone instead of tablet so any device can be used which support tcp data transfers under wi-fi connection this concludes our video about esp-12e module introduction i hope you have found it useful so thanks for watching and see you next time
Info
Channel: Sigma Projection
Views: 9,297
Rating: undefined out of 5
Keywords: esp8266, KiCad, esp12e, eclipse, esp, tcp, socket, esp12f, IoT, DIY
Id: 1Z2kSx1YNiA
Channel Id: undefined
Length: 31min 51sec (1911 seconds)
Published: Sun Jan 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.