Electronics Design
Description
This week we do a step backward from [ week 4.
Assignments - Learning Outcomes
# | Assignment | Fin |
---|---|---|
1 | Select and use software for circuit board design | 1 |
2 | Demonstrate workflows used in circuit board design | 1 |
Spirals - Have you?
Spirals | Description | Done |
---|---|---|
A | Documented what you have learned in electronics design | 1 |
B | Explained problems and how you fixed them, if you make a board and it doesn't work; fix the board (with jumper wires etc) until it does work. | 1 |
C | Included original design files (Eagle, KiCad, - whatever) | 1 |
D | Included a ‘hero shot’ of your board | 1 |
E | Loaded a program and tested if your board works | 0 |
F | Made a fun design | 1 |
Hello World
Using KiCad.
The program was downloaded from KiCad.org/download and can be opened using the contextual menu to bypass MacOS gatekeeper software.
We add Fabacademy libraries following the instructions on gitlab These libraries contain symbols and footprint of regularly used components.
We can then place the components on the board. And make sure we have everything. Henk just tells us which they should be.
We then have to connect them. There are a few parts that we already know where they go from the preperation talk:
- VCC and GND go together
- LED and resistor go together
Where the other components go is also told to us by Henk, who sometimes has to consult the datasheet.
He then shares the result with us through a screenshot and we can follow his steps on our own design.
You can then annotate all symbols automatically. This puts little letters and numbers next to the symbols to make it easier to tell them apart.
Part of the Fabacademy library is the footprint of all components. The footprint is the actual real-world size of a component. Having this allows you to start placing them on a board and see if this works.
Kicad shows you with white lines which components have to be connected how. As we are milling copper traces these should not intersect. The zen-puzzle of this week is to align and place the components in such a way that the traces do not overlap.
Autorouting the way to go?
Following the stress-related decisions of Tessel, I decided to go down the same path and check the autorouter option.
Freerouting issues
Installation and run Tessel claims you need Layout.app. Maybe this is true on Ubuntu, but on MacOS the standlane app Freerouting from Github is more then enough to get going.
If you get the error that This app is damaged use xsudo xattr -cr /Applications/Freerouting.app
and provide password to get it working.
From KiCad to Freerouting
To be able to open your desgin in Freerouting you have to export it from KiCad. For this we use the Spectra DSN file format.
Six autoroutes
I use the autorouting feature several time (six in total) before I came to a satisfactory result. I can imagine that this is a great help on even more complicated boards as an aid to check if a routing is even possible. Carefull, manual examination should always be conducted after autorouting.
I am doing something even tshirts say I shouldn't.
Onwards with the autorouted traces.
The exported file contains the traces as a form of mask. This mask is overlayed on the existing drawing with the components in KiCad.
The file with auto-routed routes is then re-imported into Kicad and appear there nicely as red copper lines connecting all the parts. This looks nice and very clean.
In their turn these files can be exported to SVG, which in their turn can be openend in Illustrator for cleanup , modification and further export to PNG.
I had some fun with making the lines less square and dragging them into more natural shapes.
The result was a more rounded shape in which one can see a bear stealing honey when squinting (a lot). I proudly posted this to our chat chanel and promptly got a comment from Erwin that something was wrong...
After carefull examination of the files I found that I had labeled pin3 on the ATtiny with a BUTTON tag. It should have a SENSOR-tag.
Without giving myself to much trouble I rerouted this by hand in Illustrator.
In the end I have two PNG to feed to mods and one SVG I could modify in case anything goes wrong.
Yes we mill
Things go wrong
While milling I was preparing the next file, the interior trace, in MODS. That is something you should not do. The mill suddenly stopped milling...
Also then I noticed that in the bottom right part the milling was not as deep as it should be.
I wanted to start the milling again, but I wanted to prevent that everything had to be milled again. As this would
a. take a lot of time and b. there is a change that existing traces will be damaged.
I took the very blunt route of opening the PNG in GIMP and painting most of the already milled traces black. I thought that this would be a smart way to prevent mods from milling everything again.
Super smart, no? No...
Of course some of the traces now end somewhere and the mill cuts through the existing traces...
Stupid, yes? Yes...
So now I am milling all over again.
Another big/small mistake: I somehow did not tighten the screws that hold the bit enough. It came loose and started drilling really deep.
Soldering the lot
I had to collect 9 parts from the various boxes.
Label in Kicad | name | value | haz orientation | Notes |
---|---|---|---|---|
R1 | Resistor | 10ohm | 0 | |
R2 | Resistor | 5ohm | 0 | |
D1 | LED | Red & green (second try) | 1 | |
M1 | Phototransistor | NPN-1206 | 1 | |
SW1 | Button | b3sn | 0 | |
J1 | UPDI Connector | Male | 1 | Soldered upside down |
J2 | FTDI Connector | Male | 1 | |
U1 | Microcontroller | ATtiny412 | 1 |
NOTE I added the orientation column to this table after finding out this is important information.
I had to redo the LED, as this was soldered the wrong way around. And, by luck, the Phototransistor was soldered correctly.
this LED is the wrong way around
I found out that the LED was wrong by reading some documentation of last years student Tessel Renzenbrink.
She also showed me the way to some important datasheets where I extracted the information I needed to find out the orientation of the different components.
This is the final result:
I used the multimeter to check all routes and all seems connected.
Why are you upside down?
There is just one small problem. The UPDI connecter is upside down.
If I would have soldered it correctly, the two pins would have formed a very effective "accident push button" cover. But also would have prevented normal operation of the button.
As this seems very undesirable I followed the following steps that always solve any problem:
- turn connector around
- document that it is the other way around
- forget about it
- profit
But Henk says no. Not only is it a bad idea to have connecters upside down, there is also ample space to connect a connector as the pins do not overhang over the edge enough.
So I go back to Illustrator. Change the lines slightly so that the UPDI connecter will protrude from the side of the board and the pins will be connected correctly. I pass the file via mods to the milling machine, mill the board, get all the components again and solder the lot. Whistle southern bells in london sing* and smile at life. Things go way smoother if you do them for the second time.
Left is the old board, on the right its new sister.
Hangover.
The new board seems to function. All traces *beep when tested with the multimeter. Al directionality seems fine. There is just one small hangover. Or maybe two. But they are related, so they count as one.
In the redesign of the board I placed the little squares where the feet of the UPDI connector go too close to the edge. The connecter has a nice little black piece of plastic that stabalises it on the board. But If I would follow the correct positioning of the feet in their beds, this stabalising piece of plastic would fall over the edge.
So I soldered it in a compromising position. The plastic is half on the board and the feet are just outside their beds...
For this week. This is it. Thank you for reading. If you like the contents of this documentation, consider making a donation to an NGO fighting for civil liberties today.
Test the board.
To test the board I use Arduino IDE 1.8.13. This app has several libraries on board to interface with microcontrollers, but the ATTiny412 is not one of them.
Adding ATTiny to Arduino
These steps were shamelessly copied from Electronics-lab.com
- Open the preferences window from the Arduino IDE. Go Arduino > Preferences.
- On the preferences window, locate the “Additional Board Manager URLs” text box and enter http://drazzy.com/package_drazzy.com_index.json into the field as shown below and click the OK button
- Next, open the Arduino board manager. Go to tools>Boards>Boards manager
- When the board manager opens up, enter megaTinyCore into the search bar and scroll, you will see “megaTinyCore by Spence Konde”, click on install. Mind you. this can take longer then you expect; wait the proces out...
- Also, search for the “Official Arduino megaAVR boards” package and install the most recent version of that too.
With all of that done successfully, you should now see the Attiny boards all listed under the boards’ section (tools -> Boards) of the Arduino IDE. If that is so, it means the board installation was successful.
The hookup
(the following happened in week11, after I had some more experience)
I connect the board to my UPDI and to my UART cable, functioning as the powersource and the Tx and Rx.
Using some tips from Nadies documentation I try to connect to my board using miniterm.
I had a small issue where there was no response, but as soon as I switched the Tx and the RX around, that was resolved...
Group assignment - Measure something
We measured Erwin. He has a lot of resistance. (21,17 kilo Ohm to be exact)
We have multimeters in sort and sizes in the fablab and all to basically the same thing. I want to make special note of one nice one: the Tweezer-Multimeter.
This one is great to use for super-small components.
And we measured an Arduino with an oscilloscope. But that burned the LED. In the end it took a lot of time to get a nice wave pattern on the screen and it was not entirely clear what this brought us.
Key take away: the multimeter is very handy, the oscilloscope is a disaster to work with (but sometimes you have to)
Links to work files
Al files I used in this weeks project can be found here