Skip to content

6. Electronics design

Week’s Assignments Group Assignment:
● Use the test equipment in your lab to observe the operation of a microcontroller circuit board.

Individual Assignments:
● Redraw the echo hello-world board.
● Add (at least) a button and LED (with current-limiting resistor).
● Check the design rules, fabricate it, and test it.

Antti Mäntyniemi , Fablab Oulu Manager and Fab Academy 2016 alumni, gave us the local lecture about Electronics design with KiCad and PCB production by LPKF automated machine.

1. KiCAD PCB design

We decided to use KiCAD to design the PCB circuit diagram and the layout.

1. Settings

First, install the kiCAD from https://kicad.org/, and install the Fablab related libraries https://gitlab.fabcloud.org/pub/libraries/kicad.

For the preferences, these 3 parts need to be set. 1. Preferences > Configure paths
Put the path where is the libraries are installed with name of “FAB” (note: Capital letters of FAB).

  1. Manage footprint libraries
    Put the folder path where is the footprint (fab.pretty) library is installed with nickname of “fab”

  2. Manage symbol libraries Put the folder path where is the symbol (fab.lib) library is installed with nickname of “fab”

2. Drawing the circuit schematic

First, File > New > Project then create a file of project.
Open Schematic layout editor, the blank schematic sheet is appeared and created the .sch file.
In schematic editor,
Place > Symbol* then Choose symbol window is come up, you can find the component by putting the name in the search box.

These components are needed to insert to editor.
- ATtiny412 (Main IC) - C (Capacitor)
- R (Resister)
- BUTTON_B3SN (Push bottun, OMRON)
- LED (LED)
- Conn_FTDI_01x06_Male (6pin connector for FTDI)
- Conn_01x03_Male (3pin connector for serial&power)
- VCC, GND

And the connections of components are drawn by line,

as datasheet of IC and the reference of Neil’s PCB layout with electronics circuit manner.
Annotation can be deployed by Preferences > Anotate Schematic, click Annotate.
Other symbol properties, such component value, can be editted by right click the component > Properties > Edit Properties.

After all schematic and values are set, check the design by Electrical Rules Checker (ERC), Inspect > Electrical Rules Checker. If you cannot see any critical error, violating the design rules, you can close the schematic editor.

3. Drawing the PCB layout

Open the PCB layout editor.

Three settings are needed.
1. Track width
2. Grid size
3. Interactive drag

Track > Edit pre-defined size, Tracks Width is set 0.464mm (equivalent with 16 mils)

Choose the Grid 0.1270mm (5.00mils).

Route > Interactive Router Settings, select interactive drag

Select Route tracks then route the connections of components.

After finished all the routings, make the board cutting edge. First selected the Edge.Cuts layer, then draw the edge of the board by Add graphic line tool.

Filled the GND plane by Add filled zones tool with selecting GND, then draw the area of filled.

Used Text tool, put texts on the Cupper layer.

After all layout drawing, checked the design by DRC Control.
Inspect -> Design Rules Checker

Then File > plot, plot the layout with only F.Cu and Edge.Cuts layers and with uncheck the Generate Gerber job file.

Finally, the data files for PCB milling were made for each layers (front Cu and Edge cutting).

2. LPKF milling machine

We made milling the board using LPKF ProtoMat® S62 in Fablab Oulu at Protopaja. It is very nice milling machine with automation functions including drills replacement. Here is the procedure to mill the board.

The vacuum machine is located at the underneath, there is a power switch, I means automatically vacuum run, II means all the time vacuum activated.

1. Before milling

Cleaning is always important. Especially burrs are made after drilling, milling the board edge into the stage. Get rid of those burr with stiff materials then vacuum clean the stage.

After cleaned up, put the raw PCB board, this time was FR1 board into the stage. The PCB board is fixed by vacuum pressure of sacking air, but for making sure, it’s also fixed tight with masking tapes.

2. Open CircuitPro

Next is setting up the machine by PC. First open the App of LPKF CircuitPro PM 2.7. After checking no tool left on the stage, no milling bit at the main clamp, then click None and then proceed with load default template in case of new project.

Milling setting procedures are basically followed by the wizard of these 8 icons from left to right.

First chose the most left one, process planning wizard.

There are selection wizard menu come up, choose,
- Process PCBs
- Single-sided Top
- FR4/FR5

Then click done to finish this wizard. *)note, this time used FR1 board, not FR4, but FR1 setting moves quite fast drill movements and not good result. FR4/FR5 is the best one.

Next is import the PCB layout files. Click Import wizard button and choose the files of both Front side Cupper layer and the board edge cutting.

Skip 2 wizards then choose this Technology Dialog.
Generate isolation and contour routing toolpath

Change the Copper layer thickness from 18um to 35um.
From Isolate, set the isolation method as No.4 Complete rubout.

From Contour routing, set the contour routing method as No.2 Horizontal gaps. This is easy to be taken out the PCB from the substrate.

And then click Start buttun.

Some warnings but can be ignored.

After setting up the Technology dialog, the drilling layout came up.

Check the tool magazine with wizard,

Check the drills whether if fits with this time milling.

Finally in wizards, choose Board production going to be milling.

Define the locations of P1 and P2. P1 is the left front location, P2 is the right behind location and the region you selected is the milling area.

First make the location of P1, clicking by mouse the location where you want to place the P1 left front.

Then use the arrows on Processing window, you can adjust the machine head with details where you locate the working area edge. When the location is okay, click P1 button.

P2 positioning is same, click the approxiemate location first, details with arrow and then push the P2 button.
After click continue in Placement, put the PCB image to where you want to mill the FR1 board.

Save document then click Yes.

Click ignore.

Finally, set the Line length as 10 mm and Accept Width.

Milling done. Got the board by just rotated the board edge, also the life of tool....

Soldered the component and the ATtiny412 based micro computer board is done.

3 ATtiny412 with Arduino IDE

Connecting the ATtiny series board, need install the megaTinyCore from the board manager of Arduino IDE.

  • File > Preferences, add http://drazzy.com/package_drazzy.com_index.json in Additional Boards Manager URLs

  • Tools -> Boards -> Boards Manager, search “megaTinyCore by Spence Konde” and click Install.

The sketch of hello.t412.echo.ino is taken from here

Before upload the sketch to the board, set up the board related settings,
- Board name : select ATtiny412/402/212/202, if other board, choose the equivalent one.
- Port: COM 6 (The number can be different by the board by timing)
- Programmer : Serial Port and 4.7k (pyudpi style), this is for ATtiny series UPDI connection.

When upload the sketch via UPDI connector. Jumper pin is this side to set for UPDI connection of below green part.

Sample code is from Neil’s blink code to check the LED function.

LED works!

Secondly checked the serial function by FTDI connection using example of [Neil’s echo code]http://academy.cba.mit.edu/classes/embedded_programming/t412/hello.t412.echo.ino)

4. Group Assignment

Group work is done with Antti, Mona, and report is here.

Reflections

  • Learned about the design rules of Circuit diagram and PCB layout towards the real production with the professional automated machine, LPKF, by the Gerber files with the industrial grade professional manner.
  • In PCB layout, the letters of PBC is covered by the connector, so need to think about the mechanical aspect for the design.
  • LPKF is an automated machine and handy to use. But there are some problem happens in operation, need carefully check for the operations especially when the exchange of milling bit. Many failure happens when exchange the milling bit and LPKF doesn’t have the sensor to detect wrong operation of grab/release the milling bit. (In case of failure, open the lid makes machine stop, can prevent the damage of machine)

Used files


Last update: April 23, 2021