Skip to content

7. Electronics design

This week I worked on designing, producing and programming a PCB.

I worked on a few simple designs of hello boards, starting from ATtiny44 and ATtiny45 microprocessors and adding the components needed for their functioning, with the addition of a switch and a LED diode.

The software I used for the design is Autodesk EAGLE, I generated CAM files with FabModules

Design

It took me a while to understand how to design boards: not only it was problematic to understand what components I needed, but also to put them together. I also often found that my designs would not necessarily be ready to be milled straight away, but I had to make modifications so that they would be milled correctly.

Libraries

Before starting to design my boards I added the libraries of components I would need for my boards.

I download the Fab library from github for the components and the Sparkfun power symbols library to clean up my schematics page and to more easily understand what was happening on my board.

In Eagle a library is added by:

  • moving the library file to the correct directory (Documents/EAGLE/Libraries)

Aed76

  • activating the libraries by clicking on the gray dot in the drop menu

Aed77

Schematics

The first step in the PBC design was finding out what components I needed and compile a Bill of Materials.

Aed51

I used the command Add to start navigating the libraries to find what component I needed. It’s important to select the components’ right package for the PCB.

Aed14

Left click to position the component in the schematic, right click to rotate them.

Once a component is placed, you can return to the libraries menu by pressing ESC.

I connected some of the components by placing them one next to the other, some others by using the command Net.

Aed62

Once a Net is generate, you can connect them by giving two or more the same title with the command Name

Aed52

For the components that need one you can add a value notation with the command Value

Aed64

I tried to keep my schematics tidy and put the most closely connected components together in order to help me in the following steps.

I encountered some problems in the beginning when choosing pull down resistors, but I generally understood quite quickly how and what to connect.

Here are some screenshots of my schematics design process.

Aed15
Before connections.

Aed19
Aed29
Aed30
Aed35
Aed37
Various trial and errors. Sometimes I changed positions after having tried connections in the board viw and not managing to place and connect everything.

Aed39
Final version.

Aed64
Aed64

ATtiny45, Schematics

Schematics, ATtiny45

ATtiny44, Schematics

Schematics, ATtiny44

BOM

A Bill of Materials is generated by:

Aed78

  • clicking on Run ULP

Aed79

  • selecting Generate BOM

Aed80

  • choosing the preferred options and saving

ATtiny45, BOM

Bill of Materials, ATtiny45

ATtiny44, BOM

Bill of Materials, ATtiny44

Generate\Switch to board

Aed18

In order to pass onto the final step of the design you have to click on the Generate\Switch to board.

This button will generate the components chosen in the schematics area and place them in the board view, and can be used to switch back and forth between the two modes for further modifications.

Board design

In this view you can move and rotate components by using the same commands as in the command area.

Aed54

The layer on which to work can be selected with the drop menu, for my designs I only used the Top layer for components and traces and the Dimensions layer for the outline of my board.

Aed83

As opposed to the Net command in schematics, traces are placed by using the Route command.

Aed61

Traces are instead deleted by using the Ripup command, Ripup ; will instead delete all connections.

Aed58

Other useful command are Align (to distribute the components on the grid), Miter (to smooth the angles) and DRC (to check that the design respects the design rules)

Aed84
Aed85
Aed86

In the dimensions layer the outline is designed using the Wire command.

Aed60

Components, routes and dimensions are cancelled using the Delete command.

Aed59

The process of routing my boards was quite long as it took me a while to discover a workflow that was functional, as well as a way to prioritize routes and componets that would make this process easier.

It was a long trial-and-error process, but I found it extremely pleasant as there was an element of gamification as I started interpreting the routing as a puzzle.

Aed20
Aed22
Aed23
Aed27
Aed34
Aed38
Aed40
Aed42
Aed43
Aed44
Aed63
Aed66
Aed67
Aed68
Aed69
Aed73
Aed82

I designed 6 boards in total and I think it took about 3\4 versions of each to finally get to a correct and complete routing, sometimes I tried the AutoRouting function in order to get an idea of how I could proceed, but I found it much more satisfying to solve the puzzle myself. I also found that my own routing were generally tidier and more visually pleasing than the ones generated by AutoRouting.

I only finalized two boards (the ones I considered best), in order not too waste too much material and components.

Grid

Aed87

To make the board design process easier its helpful to carefully decide the grid options.

I decided to select the base movement as wide as 3 traces and the alternative movent as 1 trace, this helped me as I knew that in between componenent I would always have space for at least 1 trace.

Design Rules

The two sections that I modified in Design Rules were Clearance and Dimensions.

Aed88

In Clearance I chose the distances in between components and traces, 0.42mm is a little wider than the mill end I would use in the CNC. In Dimensions I also chose measures related to my mill end.

Aed89

ATtiny45, Board

ATtiny44, Board

CAD to CAM

Once the board design is finalized, it’s time to generate a CAM file.

The way I operated was to generate a .png file, and feed that to FabModules.

Aed90

In order to export, you have to first hide all layers.

Aed91

Than I selected which layer I wanted to export (Top, Dimensions).

Aed92

For each layer you have to generate a Monochrome image at 1000dpi.

Aed93

I noticed a small bug for that the images generated were 3 pixels bigger than how they were supposed to be exported, whith such high dpi, 3 pixels amount for a very small dimension distortion.

Aed49
Aed49

I then used Photoshop to fill the inside area of my outline layer, enlarge the black layer around the outline (so that it’s easier for FabModules to interpret the design), and then to match the dimension of the Traces image with the Outline image, so to assure alignment when machining.

Aed71

Here are the images exported via EAGLE and adapted via Photoshop of all 6 boards I ended up designing.

Aed1
Aed2
Aed3
Aed4
Aed5
Aed6
Aed7
Aed8
Aed9
Aed10
Aed11
Aed12

When generating CAM files i realized that even if I placed correct design rules, and my designs respected them (as checked with DRC command), sometimes FabModules would still not interpret them correctly, especially along diagonal lines.

Sometimes this meant I had to go back to my board to change the designs, sometimes I could trick FabModules by slightly reducing my tool size.

Aed70
Example of a place were traces were fused together by FabModules.

Aed72
Every mistake in one of my boards.

Aed74
Every mistake in another one of my boards.

Aed75
The CAM after fixing such mistakes.

ATtiny45 & ATtiny44 CAMs

Machining & Stuffing

For these two processes I followed the same workflow I described in my Week 5 page.

These included:

  • characterizing the machine

  • milling the boards

  • cleaning, deburring and sanding the boards

  • stuffing and soldering

  • testing my board with the voltimeter

Bed4
These are two of the failed machining:

  • the one on the left was already presenting mistakes in the CAM I didn’t notice on FabModules

  • the one on the right failed because the board got detached from the sacrificial layer during the outline milling process

Bed3

These were two board that I failed at soldering:

  • the one on the left was far too messy and I broke the led, but did not manage to finish solder

  • the one on the right was actually machined with a slightly off Z axis, soldering it was wuite complicated as the microprocessor barely fit, I also broke one of the traces

Programming

I also tried to program both final boards using the programmer I produced during Week 5 and Arduino IDE.

I installed the ATTiny CORE library in order to use my programmer.

Aed81

I used my FabOptimus ISP programmer that I prodeced a few weeks ago to program my boards.

Ced1

Only one of my two boards was actually programmed, as the second one is to be modified as the back of the FTDI connector touches a trace, generating a shortcircuit.

The board that is programmed has a slight problem at the moment as the internal clock seems to work erratically but I don’t yet know how to solve this.

Multimetre

Whenever I have been producing PCBs during the last few months, I have been using a multimetre in order to double check my traces and my soldering.

I have been doing this at various moments of the production phase.

Continuity

Eglob1

THis is the function used for continuity: if the red and black probes are touching traces that are connected, the multimeter will beep.

If there were some messier \ less precise milling, or very nrrow traces, I double check they are all correct just after machining.

After I solder the first necessary components to simply upload an empty sketch (ISP connector, reset capacitor and microcontroller) I check continuity of these.

After everything is soldered, I double check connections. If I had caused short circuits with bad soldering, I can try to fix them, I get confirmation I fixed it if there isn’t continuity anymore.

In this case, I have a badly milled board: in the video I show how, trying to follow the VCC line, some of the traces are connected (when it beeps) some are broken (when it doesnt’t).

Resistance

I have also used to check resistors value. This happened in the case I wasn’t sure I remembered the notation correctly, or when a soldered resistor had its value erased.

This video shows the value of a resistor used in this capacitive sensor (10megaOhm).

Current

Another way I used this tool was to check wether a board received the correct power supply, and that such current would go to the parts of the circuit where needed.

The current in this board is correctly 5 volts.

Pictures

Bed1
My ATtiny44 hello.world board (programmed, but internal clock in is malfunctioning).

Bed2

My ATtiny45 hello.world board (FTDI,trace interaction to be fixed).

Files

-Schematics, ATtiny44 -Board, ATtiny44

-Schematics, ATtiny45 -Board, ATtiny45


Last update: July 13, 2021