Exercise06 Electronics Design...
This week the assign task for this week is design electronic circuits with as many software tools such as Eagle Cad, Fritzing, KiCad, and then familiarize with the PCB production workflow. The workflow consist of designing electronic circuit with software tool of choice, route the electronic circuit into the form of Printed Circuit Board (PCB), making sure the designed circuit and the routed PCB went through the Electronic Rule Check (ERC) and Design Rule Check (DRC), respectively. Once satisfied with ERC and DRC, generate the necessary machine code for the PCB to be manufactured on available machines. Popular format are gerber, and gcode.
Yours truly is no stranger to PCB designing. I have used both fritzing and eagle, and both of these tools have their own quirks, advantages, and what nots. I have written a tutorial on PCB design & Fab using fritzing targeted at the novice . Last year, I wrote an instructables on design and fab Maker’s IoT kit to enable the home brew IoT crowds.
Back in week2 I have presented my final project to neil and class, and neil spoilt my game plan by explaining the workflow of weekly assignments to contribute to the final project over the air. Hence for this week’s assignment, I planned my fab academy workload accordingly to my unavailability (3 days away: 1 day to conduct workshops to year 1 students, and 2 days to attend corporate training) by completing the PCB design for my final project that uses ESP8266. Unfortunately the tall order came, all FabLab@SP participants to design and fabricate 1. hello ATTiny44 board 2. Use fab.lbr and do not deviate from it. I have to re-do this week’s assignment work on a board that I am not going to use in my final project. The content for this week’s submission might appear to be a WoT, but not intentional.
critical information: too little, too late
I was at my 6 th iteration on the ATtiny44 hello board designed in Eagle Cad. That is after I have designed a few iterations of ESP8266 board to be submitted for this week’s assignment. I was caught off guard on several issues. I am always finding the best optimum routing by hand, but unable to achieve what I have saw in the demo or tutorial. After this episode, I conclude that if the following information can be made available earlier would save me significant amount of time and effort to get the hello board done.
At the Last day before submission, local instructor and another class mate of mine mentioned that one can use the non-default 1206 package available in fab.lbr; the 1206 fab packages with wider foot prints to allow traces to pass through it. That was the first gotcha. In the later sections, I mentioned some of my colleagues ran 3 traces beneath the ATtiny44 footprint, this is something I wanted to avoid. I simply assumed the traces were given a smaller trace width e.g 12mils or 10mils to be squeezed within the limited space. Little did I realized, the placing of 3 traces that are so close to each other was achieve with ALT+Move, instead of the regular move. Local instructor and one of the classmates mentioned this at the same instance of “gotcha1”, making this gotcha2. The 5mils flexibility with alt+move makes significant difference in the effort taken to route.
Having said the above, I think we should have a heads-up section on pro-tips and tricks to minimize the frustrations, save time and effort to be rendered on the said project. The third gotcha: the hellow board designed by me sans gotcha1 and gotcha2, 16mils trace width looked at it’s best as per described in the sections below could not generate the complete gcode due to the ground pour with the polygon tool in eagle cad. The section below describes it.
I have done the following in due course of this electronics fabrication week.
1. Hello board ATtiny44 designed with Eagle Cad (6 iterations), and fabricated with al-cheapo PCB milling.
2. ESP8266 ESP01 board designed with Fritzing, and fabricated with LPKF103
3. ESP8255 ESP12e board designed with Fritzing, and fabricated with LPKF103 as iteration0,
4. ESP8255 ESP12e board designed with Fritzing, with fab.lbr parts
5. ESP8255 ESP12e board designed with Fritzing, without fab.lbr parts
Source files Download
The Hello board ATtiny44 schematic designed in eagle cad can be downloaded
The Hello board ATtiny44 PCB board designed in eagle can be downloaded here
The 6th iteration Hello board ATtiny44 board file is available here
The 6th iteration Hello board ATtiny44 board generated gcode file is available here
ESP8266 ESP01 designed with Fritzing design files available here
ESP8266 ESP01 designed with Fritzing Gerber files archived in zip file available here
ESP8266 ESP12E designed with Eagle Cad Schematic file available here
ESP8266 ESP12E designed with Eagle Cad Board file available here
ESP8266 ESP12E designed with Eagle Cad using fab.lbr parts schematic, board and gerber archived in zip file
ESP8266 ESP12E designed with Eagle Cad using generic parts schematic, board and gerber archived in zip file
Hello board Attiny44
Yours truly highly recommend this excellent tutorial on end to end of designing the Hello board Attiny44. This tutorial was done by one of the fablabs, AS220.
I have done several different design of schematics instead of following the one presented in the tutorial, hoping to find the perfect routing of traces, but come to realise there are not much difference all together. I have tried both auto routing, and manual routing, and the observations made was, auto routing is still not as optimised as a human’s manual routing. When it comes to manual routing, my rule of thumb is to arrange or place the components such there are as few overlaps as possible, and do not run traces too close to each other, especially below an IC. Even though the electronic circuit and PCB traces are fabricated successfully, soldering such boards might be prone to human error. The above is from my fourth iteration of designing hello board, with and without auto routing. The traces used by default are 16mils for the hello board. One of my fellow classmates had chosen to use 12mils, to pack more traces within limited space.
The following screenshot describes my schematic used for hellow board attiny44. Note the different pin is used for the LED and button as compared to the tutorial. For the sake of simplicity, I have used the net command to indicate the wires. Never use the wire command to indicate the wire, the wire here is for aesthetic. To join the electrical connections, instead of drawing them manually, I have use the name command on corresponding nets. Finally, use the label command to give the nets a name. Hence the schematic is both visually appealing, and functional. Be sure to use the ERC command to check for any missing links. The schematic designed in eagle cad can be downloaded here . Remember to use the polygon tool to generate the ground plane.
The following screenshot describes my auto routing of the PCB traces + manual modifications (and many runs of auto routing plus shifting of the components). Note the 3 traces beneath the ATtiny44 IC, and also using of the non SMD headers. The 3 traces beneath the IC is unforgiving to be fabricated using a low end PCB milling machine. It has a high chance of messing up the traces. Even it is fabricated successfully, a mistake in soldering affects many traces at one spot.
The next iterations are try to avoid the issues mentioned earlier. The output looks legit. Take note on the traces beneath U$1 right between the switch and 2x3 SMD headers in the following diagram. The traces appear to be quite close. I will explain later in the DRC portion. Many tries later with by auto routing and manual shifting the routes, my best guess to optimize the routing, it still has to be done manually by hand
the following screen shot is the most legit auto routed PCB, but not accepted by local instructor due to not optimized routing.
The following 2 diagrams describe the manual routing of attiny44 hello board. The 3 traces beneath IC were eliminated, the traces too close are eliminated too. Take note on the screenshot on the left, there is one air wire left hanging, and that is connected to the ground. The ground plane generated with polygon is the saving grace. The screenshot on the right depicts the eliminated air wire. The PCB board designed in eagle can be downloaded here
Take note on the gotcha moment described in the gcode generation section.
Eagle ERC and DRC
If all done well in eagle cad schematic, we should run the ERC. Once the traces are routed on the eagle cad PCB, we should do a DRC. One of the many parameters to be set in the DRC, is the clearance. Depends on the machine used to fabricate the board, there is a need to be forgiving in the quantity set. To be specific, allow tolerances for the machine to make mistakes. The al-cheapo PCB milling is set at 10mils as describe in the following screenshot
. Once the DRC rules are set, check the routed PCB boards. The DRC might pick up errors such as the following screenshot
where the clearance parameters set earlier not satisfied. In other words, the traces are too close to each other. It is either back to the designing board to reroute the traces, or chuck it. The manual PCB routing passed the DRC check and ready to be generated.
Generate Machine Code with Eagle
The steps to generate the gerber file for eagle cad is described in week 4
. I shall not go into the details.
To create gcode with eagle, first install the PCB Gcode software. Extract the content of the folder, then copy it into the directory. Take note on the name of the ULP file that is going to be used when generating the gcode, as per described in the following screenshot
The directory of the ULP also need to be set up in eagle cad environment. The following screenshot describes this
In eagle cad go to file, follow by ULP, then choose the ULP as mentioned in the first screen shot in this section. If this is the first time using, we need to setup the ULP. The parameters to be used in this PCB GCode and it’s quirk is native to the PCB milling machine used. Do not expect the values to be the same across different machines. Even on the same machine, the values might need a tweak over time.
Local instructor has and my classmate has done an excellent work at describing the generation of gcode with eagle cad. It is available here
gotcha: eagle cad pcb gcode ground pour with polygon tool
In the previous section, I have generated a functional and almost optimized routing by hand. But when I try to generate the gcode, I was greeted with this incomplete tool path.
One of my class mates mentioned that ground pour with polygon could not work with this pcb gcode. Nonetheless, the 5 th iteration and the files attached will still work with machines such as LPKF
6 th iteration of hello board ATtiny44
Having been informed at the 11 th hour on gotcha1,2,and 3, I then redesigned the board, and manual routing by hand. The following screenshot describes this 6 th iteration board design. This version is the one sent to the PCB milling machine.
The board files are available here
Generation of gcode with eagle cad proceed as planned. The tool path can be seen clearly in the following screenshot.
The generated gcode files are available here
ESP8266 ESP01 designed with Fritzing and fabricated with LPKF103
Fritzing design files available here
Generate the gerber in fritizing is as easy as 2 clicks.
Gerber files available here
This gerber file was sent to the LPKF103 to be milled. The following picture describes the milled PCB.
ESP8266 ESP12e designed with eagle and fabricated with LPKF103
File available here
Board file available here
problem: the traces in design are 10mil but some of the traces are broken during milling. The traces appeared to be thinner that the designed 10mil after milling. Thin traces might not be able to carry the amount needed to power up ESP12e.
ESP8266 ESP12e designed with eagle variations
One With fab.lbr parts upon recommendation of one classmates
Gerber files available here
One with generic parts the initial design
Gerber files available here
stuff the boards
ATtiny44 hello board
The following diagram describes the milling of 6 th iteration of hello board.
The following picture describe the PCB milled. Note on the second trace from the top, the trace is not cut thoroughly by the al-cheapo milling machine. Two options, either re-mill the pcb, or apply some TLC (tender loving carre) to the board by scoring along the trace with a pen knife. The latter was chosen.
The following picture describes the post TLC board. The traces are clear now. Continuity test was done on this board, and no shorts was found
Without further ado, the TLC-ed PCB is stuffed with the necessary components and as long as it doesn’t smell like roast chicken, it is fine.
Gerber viewer: gerbv http://gerbv.sourceforge.net/
PCB GCODE http://www.pcbgcode.org/