Skip to content

7. Electronics design

This Weeks’ Task:

Group Assignment

  1. Use the test equipment in your lab to observe the operation of a microcontroller circuit board.

Individual Assignment

  1. Redraw the 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.

Group Assignment

Here is a link to our group assignment page.

Individual Assignment

To begin with, we had to design the echo hello world board ourselves using circuit board design softwares. The one that I used was Eagle. This was my first time using it and therefore, I had to look up some tutorials to help me get started.

These were the three tutorials that helped me:

  1. Tutorial 1: Schematic design
  2. Tutorial 2: Printed Circuit Board Layout
  3. FabAcademy week7 tutorial

These tutorials will help you get started with eagle including how to open, create a new project, adding a library, how to start a schematic and PCB. If you’re not familiar with circuit design softwares, please make sure to watch a tutorial beforehand. This surely helped me out quickly.

Library

The first step was to add the fab lab library in eagle. Here is a link to where you can find the library. Go to ‘eagle’ > ‘fab.lbr’ and click on the download icon at the top right corner. Save the library in your eagle > library folder that will appear when you install the software. Then open eagle and go to the top toolbar ‘Library’ > ‘use’ and open the library you just downloaded. You can now start adding components from this library while designing your schematic.

Schematic diagram

This is the schematic of my circuit that I have designed. As per the requirements, I have added the LED and button in which you will find them at the right of the schematic. I have also shown some of the basic tools that I have used to design the schematic. I did face quite issues while designing the PCB later since I wasnt able to connect one trace due to the overlapping problem. I did change my circuit design twice, changed the positions and orientations of the components but it did not work. I was always left with one overlapping trace, therefore, I placed a 0 ohm resistor which connects the VCC of the capacitor to the VCC of the AVRISP. This can be seen as R4 at the bottom left of the schematic.

Download schematic file

PCB design

Moving on to the PCB design, the intial step is to create a PCB from your schematic drawing. In order to do that, you can find the icon at the top toolbar which will convert you schematic to PCB. Or, you could go to ‘File’ > ‘Switch to board’ and then the pcb page will open.

The next thing is to specify the position of your components by moving them around and rotating them until you find their best position. This might be confusing and time consuming if you are new to this, just like me, but you will get used to it once you proceed further. After placing them in their positions, try to reduce the size of your pcb by dragging the outer yellow outline of the black page by using the move tool. This might help you position you components properly according to the size of the board. You can always increase and decrease the size depending on your design.

Before starting to draw the connections or traces between the components. Check your design rules. You can find this icon at the bottom of the toolbar as ‘DRC’. Ask your instructor for the design rules. This will include the width of the traces, clearance, distance between each trace etc. Start drawing the traces by selecting the ‘route’ icon in the toolbar. Draw the route by dragging from one end of the component to the other end of another component.

Here is the PCB design. As i mentioned earlier, I added a 0 ohm resistor to connect between the overlapping trace.

This is the design rules used for designing my PCB

Download PCB file

Exporting the PCB

Go to ‘View’ > ‘Layer settings’ and select hide layers. This will remove all the layers on your board. You only want to show the top layer, therefore just click on the left side of the ‘Top Layer’ row, so that the eye icon appears. Something like the image below will be displayed.

Then go to ‘File’ > ‘Export’ > ‘Image’ and change the resolutions settings to 500 DPI and select the monochrome. This wil give you a black and white PNG image.

Editing the board

After exporting, I opened the image using GIMP to edit it.

  1. Go to ‘Image’ > ‘Canvas size’.
  2. Link the width and the height together by clicking on the link icon at the right of the boxes. Then add 20 px to the width. Automatically the height will change as well.
  3. In the Offset settings, click on centre to centre your image.
  4. When you’re done, click Resize.
  5. Go to ‘Image’ > ‘Flatten image’.
  6. This created a white border around your image which will be considered as your board outline.
  7. Save the file. This is the file that you will use to create the traces. You can add a white text if you want and it will be milled out with the traces.

  8. Use the bucket tool with black colour to fill in all the traces and only keeping the white outline.

  9. Save this as a separate file since this will be used to mill out the outline.

Milling the board

After saving the the png images, I used Fab Modules to prepare them for milling.

Traces
  1. Insert image as png.
  2. Choose the output format as the machine you’re using for milling. In my case it was Roland mill (.rml)
  3. Choose the process as PCB traces (1/64).
  4. Adjust the output settings found at the right side of the image.
    • Set the machine. In my case it was SRM-20
    • Speed: 3mm/s
    • x0: 0mm
    • y0: 0mm
    • z0: 0mm
    • zjog: 12mm
  5. Click calculate and the image preview will show how the traces will get milled.
  6. Click save.
Outline
  1. Insert image as png.
  2. Choose the output format as the machine you’re using for milling. In my case it was Roland mill (.rml)
  3. Choose the process as PCB outline (1/32).
  4. Adjust the output settings found at the right side of the image.
    • Set the machine. In my case it was SRM-20
    • Speed: 0.5mm/s
    • x0: 0mm
    • y0: 0mm
    • z0: 0mm
    • zjog: 12mm
  5. Click calculate and the image preview will appear.
  6. Click save.

Open the VPanel to adjust the origin settings manually before milling. This defines the starting point of where the drill bit will be to start cutting. After adjusting the origins, allow the spindle to spin for 5 minutes atleast and then add the file you want mill and click on cut. Dont forget to change the drill bit while milling the traces and outline. The tool bit for traces is 1/64 and for outline is 1/32.

Soldering

Tools used:
  1. Sharp tweezers
  2. Solder flux pen
  3. Solder iron
  4. Solder
Components used:
  1. 20 MHz Resonator
  2. 0 ohm Resistor
  3. 2 10k ohm Resistor
  4. 200 ohm Resistor
  5. 1uF Capacitor
  6. IC1 ATTiny44
  7. J2 FTDI
  8. J1 AVRISPSMD
  9. Push button
  10. Blue LED

Here is an image showing how I soldered the resistor.

Here is an image showing how I soldered the microcontroller.

Here is an image of the final PCB.

Programming

Before programming, I did the continuity test using a multimeter to check whether all the connections are right. I found one connection which was not done properly due to the solder and I fixed it.

In order to program the board, I used an arduino and the software Arduino to program it. First of all, we need to install the attiny44 in the arduino software. I followed this tutorial to help me do that. These are the steps I did.

  1. Install the ATtiny support using the built-in boards manager. I found the link to install in the above mentioned tutorial. You can also just type in google ‘attiny44 programmer arduino’ and you will find many links. Then, go to File > Preferences, paste the link in the ‘Additional Boards Manager URLS’ as shown below and click ok to save.

  2. Go to Tools > Board > Board manager. You must find the ATtiny at the bottom of the list. CLick install and after its done you should see the word ‘installed’.

  3. Go to Tools and edit the board, processor, clock, port and programmer settings depending on what you’re using.

  4. Go to File > Examples > Basics > Blink to test out if the LED works in your circuit.

  5. For programming the board to turn the LED on, I used the blink example code in arduino to do it. This is the code example:

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(PA3, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(PA3, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(PA3, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

I replaced the pin in the example with the pin that I connected the LED to the ATTiny44 in my schematic. In my schematic its connected to pin 10 which is PA3. Before uploading the code, I did the burn bootloader just to ensure that the programming will follow the code accurately. It is recommended to do that once at the beginning of a new code just to ensure that the program flows systematically with the code. Go to Tools > Burn bootloader.