Week #6

Electronics Design





If you are into electronics, Printed Circuit Boards (PCBs) are the most common things you will see. These boards make our projects easier by eliminating all those connecting wires and breadboards. If properly designed, it will reduce the size of your device.


Learning:


Group Assignments

Testing

In group assignment we used the digital multimeter to check the continuity between ground pins and VCC pins. Also, we measured the VCC to GND voltage, which should be 5V.

GND (Ground) Continuity

We measured the continuity between the GND pins of the ATtiny44, SPI header and FTDI header. The digital multimeter should beep and read around 0 Ohm. This means all the three pins are connected.

ED_40
VCC (5V) Continuity

We measured the continuity between the VCC pins of the ATtiny44, SPI header and FTDI header. The digital multimeter should beep and read around 0 Ohm. This means all the three pins are connected.

ED_41
VCC to GND Voltage

We connected the board to the FabTiny programmer and then to USB. We measured the voltage between the VCC pin and GND pin. The digital multimeter read 5V, which is the USB port voltage.

ED_43

Individual Assignments

Design Echo Hello Board

EagleIcon

In this week, I’ll talk about the process of designing a PCB. For me I chose EAGLE from Autodesk to design my board.

PCB design in EAGLE is a two-step process. First you design your schematic, then you lay out a PCB based on that schematic. EAGLE's board and schematic editors work hand-in-hand. A well-designed schematic is critical to the overall PCB design process. It will help you catch errors before the board is fabricated, and it'll help you debug a board when something doesn't work.


I started by making a new project folder for my design. In the control panel, under the Projects tree, right click on the directory where I want the project to be (by default EAGLE creates an "eagle" directory in the home folder), and select New Project.

ED_1

The project folder will house both schematic and board design files. To begin the design process, I need to lay out a schematic. To add a schematic to a project folder, right-click the folder, hover over New and select Schematic.

ED_2

Immediately a new page open.

ED_3

Before, when I was working at Fab Lab Irbid, I was using a library that contains most of the electronic parts, but I wanted to download and add the library they provided us with Fablabs Library.
So, from Library then Open library manager.

ED_4

Then in Available select Browse and open all components in the library.

ED_5

The ADD tool -- EagleIcon_1 -- is what you'll use to place every single component on the schematic. Here I used the library fab & fabirbid.

ED_6

To actually add a component from a library either select the component you want and click "OK", or double-click your component.


Schematics

After I added fab & fabirbid libraries, I started to add the components. The first component is ATtiny44 which is an integrated circuit.
To understand where I'll connecting the other components, I took a look at the ATtiny44 Datasheet. The pinout is shown below.

ATtiny44Pinout
ATtiny44DataSheet

Besides the first component, I added the rest of the components I needed.

ED_7
ED_8

The NET tool -- EagleIcon_2 -- it's a wire between the components.

The NAME tool -- EagleIcon_3 -- that I used to avoid having wires all over the place.

I did a little trick; I named the main parts only, and left the other parts without names like leds and push button.
The reason is you have to connect the main parts first, you can't change the names of the parts because they are main, but the rest of the parts, just where to put them, find the nearest connect place and just tag it.

ED_10

When I was choosing my electronic components, I thought of making a beautiful shape for the PCB.
I went straight to my favorite software Fusion 360.
Since my final project is a hexapod robot, I thinked to make the shape looks like a spider. Using the ellipse shape, I sketched the main body.

ED_11

And added an upper limb.

ED_12

By Patterns and Mirror, I built the rest limbs.

ED_13

Finally, I added Fillets for the corners to reduce acute protrusion.

ED_14


Board

To generate your board design, just press -- EagleIcon_4 -- Generate/switch to board in the schematic window.
When you turn your schematic into a PCB layout file, you’ll get a new window that looks like this.

ED_15

When you are in Board desgin window, presss on -- EagleIcon_5 -- to Switch to Schematic window.
Before start routing, you need to check the Design Rule Check "DRC" -- EagleIcon_6 -- where I select Clearance and Sizes as the picture below.

ED_16

Then, I modified the Grid unit -- EagleIcon_7-- to mm.

ED_17

Finally for the setup, I imported the sketch dxf from Fusion 360 to be the outline of the PCB, and deleted the yellow rectangle.

ED_18

And here's the outline shape.

ED_19

Before I start distributing the components, I changed the CONN_01 into SMD2_PAD.
And brought the electronic parts that are already connected from the FAB ACADEMY site to connect the components as the picture.

ED_20

After that, I started Routing by press Route Airwire -- EagleIcon_8 -- To be able to do routing, you can change the position and orientation of the components to find the easiest way to route them.
You’ll also notice a bunch of lines connecting between your components. These are called airwires. You might also hear it referred to as a Ratsnest -- EagleIcon_9 --. What ratsnest does is that it shortens the connections between the components for easy routing.

ED_21

As I mentioned at the beginning, I'll connect the major parts first, and then, according to the distribution of the rest of the minor parts, I'll name them.
After I distributed the rest of the parts (LED's and Resistors), I found the closer pin and can be connect to them is MOSI. And for Push Button to pin PA7.

ED_22

Actually I needed a zero ohm resistor, I hit a dead end, so I had to use it.

ED_23

I decided to name the pcb relative to my final project. So HEXI_01 is the name!

ED_24

And here the board ready by connections.

ED_25

And finalized the schematic by collect the components into groups.

ED_26

To save the the design, We must hide all layers from Layer Settings -- EagleIcon_10 -- and keep Top Layer.

ED_27

Then export the file as image.

ED_28

Next, I hid all layers one more time, then showed the Dimension Layer. And export file as image again.

ED_29

The images are almost done, one more thing to do.

ED_30

For the Outline image, the cut occurs between black and white, and because Outline image has black on the outside and the white line and black on the inside, the cut will happen twice (between the black outside with white, and between the black inside with white), so one difference must be kept (black outside with white).
What I did is I brought the image into the Paint, and I filled the inner black space with white, and here is the result.

ED_31

Mods

After that I inserted the images to the Fab Mods set the settings for the Traces as seen below.

ED_32

And the tool path:

ED_33

For the Outline.

ED_34
ED_35

Then I calibrated the Roland SRM-20, chose the X & Y and the zero for the Z.
Here's the Traces cut and Outline cut.

ED_36

And here's my HEXI_01 PCB : ).

ED_37

I wanted to see the board in 3D model. So by clicking in Fusion 360 icon at the right, a new window shown.

ED_55

then selet the folder to create the 3D model.

ED_56

Automatically the file pushed to Fusion 360.

ED_57

And here's the model in Fuison 360.

ED_58


Soldering

Now it's time to solder the components.

My PCB needs the following components:

  1. ATtiny 44 >> 1
  2. Voltage Regulator 5v >> 1
  3. Resonator 2o MHz >> 1
  4. Capacitor unpolarized 1uF >> 3 (2 with V.R and 1 close to the IC)
  5. Push Button >> 2
  6. Resistor 100 Ohm >> 7 (6 at the corrner and 1 for the V.R)
  7. Resistor 10 KOhm >> 1 (Pullup resistor with push button)
  8. Resistor 0 Ohm >> 1
  9. LED >> 7
  10. ISP Header 3x2 >> 1
  11. FTSI Header 6x1 >> 1
  12. Header 2x1 >> 1 (with V.R)

And these components stick to the board : ).


Unfortunately, while soldering the penultimate piece, I cut the trace that connected to the ground. Luckily I was able to connect the trace and it worked again.

ED_38

Finally, my HEXI_01 pcb is alive : ).

ED_39

Programming

The third part of electronics is to program the board that I designed using Arduino. I had a simple background on how to deal with Arduino, So I did not find much difficulty in dealing with programming.

To work my PCB, I should program it, and to program it I should using the Arduino as a programmer, so I used the Arduino as an ISP to programe my board.

The Arduino ISP is an In-System-Programmer that is used to program AVR microcontrollers.

First, I searched in google about attiny arduino github, then click on installation guide to follow these steps in this tutorial.

Then, I copied the below URL link to used in Arduino Software (IDE).

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

Next, I opened ArduinoIDEIcon Arduino IDE Software.

ED_44

Then, "Preferences" in Arduino.

ED_45

The dialog shows the preferences, in the "Additional Board Manager URLs" I clicked to paste the link that I have copied.

ED_46

Next, I wanted to define the Attiny44 into Arduino, I opened "Boards Manager".

ED_47

Then I wrote in the search Attiny44 to install it. I define the ATtiny boards in the Arduino environment, because the Arduino boards it was not built in ATtiny boards.

ED_48

After that, I did a Google search on Arduino UNO as ISP Pinout for an image, to know which pins that are [VCC, GND, REST, MOSI, MISO and SCK]

ArduinoUNO_ISPPinout

Then, I connected Arduino to the laptop by USB data sync cable for Arduino, and the PCB board to Arduino by jumper wires according to the image above.

ED_49

Next, I programmed the Arduino as ArduinoISP using the examples available in the Arduino IDE by following the below steps.

ED_50

The new dialog shows the code that make the Arduino as programmer.

ED_51

Then I clicked on "tools" and choose the options below.

This code upload on Arduino to be a programmer by click on Arduino_1.
I wanted to write a code that lights both LED, but one after another and the time between them is half a second. The image below shows the code.

ED_52

Then I clicked on "tools" and choose the options below.

After that, I clicked on "Burn Bootloader" from the "tools", the ISP programmer will start to burn the bootloader into the target Arduino. It usually takes few seconds to complete burning bootloader. Arduino IDE will display "Done burning bootloader" when it is done. You can read about Bootloader.
Finally, I clicked on "Upload Using Programmer" to upload the code to the PCB board.

ED_53

For more effects, I turned the lights off and run HEXI_01 : ).


***Note:
This week I noticed that 4 LED's only work when I connect the board through the ISP Pin Headers and the remaining two don't. And when I connect the board through the Voltage Regulator, the remaining two only work and the four do not work.
After thinking and going back several times for the scheme and consulting some friends, I discovered a simple mistake I had made and it is not my fault 😜
Go to the Week8 "Embedded Programming", where I explained what happened in detail.


You can download my files here:


Previous Week Next Week