Week 06: Electronics Design

Group assignment: use the test equipment in your lab to observe the operation of a microcontroller circuit board

Personal assignment: redraw an echo hello-world board, add (at least) a button and LED (with current-limiting resistor), check the design rules, make it, and test it, extra credit: simulate its operation

This week, I:

re-designed an echo hello-world board using KiCad

KiCad EDA is a "Cross Platform and Open Source Electronics Design Automation Suite". We used the schematic editor and the PCB layout designer to design our boards.

This is what the schematic editor looks like:

kicad01

You begin by first putting all components into the schematic, by clicking this symbol on the right bar:

kicad02

After you've placed all of the symbols, representing components, you must label all of the connections. When the schematic is ported over to the PCB, it will connect all matching labels with each other - so you would designate one pin on the microcontroller (here, pin 7 on an ATtiny412-SS) as 'LED', and label a wire coming off of the LED symbol as 'LED'.

kicad03

After placing and labeling all of your components, you must run the Annotation tool:

kicad04

kicad05

and then the Electrical Rules Checker

kicad06

to ensure that all connections are valid.

You then generate a netlist by clicking on these two buttons, which will be saved as a separate file.

kicad07

kicad08

Lastly, you click the PCB button to move onto the next step.

kicad09

designed a double-sided PCB using KiCad

When you enter the PCB editor, it is blank.

kicad10

You then import the netlist that you generated earlier and Update PCB.

kicad11

It will first appear as an absolute mess. That's okay.

kicad12

By dragging the components apart, you will start to see some sense. Each white line marks where a trace needs to connect the two component parts.

kicad13

I eventually connected all of my parts; however, as an extra challenge, we made our PCB designs double-sided.

Top side:

kicad14

With the bottom side added - the circles are 'vias', which are a copper path cutting through the board so it can form connections between the two sides.

kicad15

We then flooded the bottom side, so there would be a very large 'ground' plate.

kicad16

We added an Edge Cut to mark out the borders of the PCB design, and then added a Dwg (Drawing) layer on top of it - this is the file that is used to designate the actual boundaries of the board when it is milled.

kicad17

kicad18

Lastly, we added margins. The margin needed to by symmetrical across one axis - I chose the Y-axis - so when the board is milled once and flipped, the designs will still match up. The margins are also important for when importing the designs into mods.

kicad19

We then exported the design as SVG files

kicad20

kicad21

kicad22

And passed them to mods. To get the vias to show up for mods, you need to take the file for the front copper traces, import it into Inkscape

mods01

Select any point on the black traces and delete them. When you highlight over the (seemingly) blank image, you will see the holes designated for the vias.

mods02

Fill them in with black, then save as a separate SVG file.

mods03

milled and stuffed a double-sided PCB

The milling process has remained the same as specified in week 04; however, the order has slightly changed to accomodate for the vias. First mill the traces(.4mm bit). Then mill the vias(.8mm bit). Then mill the outline(.8mm bit).

milling01

milling02

After completing the top side, carefully remove the board, flip it along the axis you previously used (Y-axis for me), and place it back in the empty spot, centering it as best as you can. Then you may run the file for the back traces.

milling03

To stuff the board, first start with the vias. They're very tiny copper tubes with a flared end on one side, and are gently tapped into each hole and subsequently deformed and soldered to ensure that they connect both sides of the board effectively.

stuffing01

Gently but firmly first deform the back end of the via with the pointed tool and a rubber mallet, and then

stuffing02

flatten it with the other tool.

stuffing03

Reinforce each via with a bit of solder, test the connections, and you are on to stuffing with the components!

stuffing04

This was my completed board:

stuffing05

tested my new board

My board had a button and three LEDs, building off of the original echo hello-world design.

To test the board, I first plugged the FTDI cable from a USB port to the connector on the board. I then used my USB to UPDI programmer board to connect the UPDI pins on my new board.

programming01

To program my board, I needed to do several installations.

I first installed Python 3.7.7. I then installed pyserial using this command:

        pip install pyserial

I then installed pyupdi

        pip install https://github.com/mraardvark/pyupdi/archive/master.zip

I also installed the megaTinyCore boards for the Arduino IDE. I used the blink program and brought it into the Arduino IDE. In the IDE, you need to change the board to the ATtiny412 board:

programming02

Then Verify/compile the code, but do not upload it anywhere. We want the .hex file that is generated, which we will upload to the hello-board via our USB to UPDI programmer.

        pyupdi.py -d tiny412 -b 19200 -c COM7 -f C:\Users\bluet87\Documents\Arduino\build\412blink.ino.hex -v

However, this is where everything failed. I received the following error messages:

programming03

After some debugging, my teacher spotted my mistake - I had stuffed the board incorrectly, hence why I couldn't program my board.

programming04

did not fix my board in favor of milling a new one for future assignments

At the time of this assignment, I didn't have the adequate tools to resolder my board. As a result, I resolved to improve my design (and be more careful) for future boards, but this one I will be leaving unfinished. See week 11: Output Devices for my latest attempt at having a programmable board.

used a multimeter to determine the resistance of a hand-made variable resistor (week 16)

Please refer to week 16 to see a video of me using a multimeter to determine the resistance of a pressure-sensitive variable resistor.

Files

PCB design, .kicad_pcb format

Schematic, .sch format

Front traces, .svg format

Back traces, .svg format

Vias, .svg format

Margin, .svg format

All KiCad and Mods files, .zip format