Week 4 : Electronics Production

☛ Group Assignment

☐ 1. Characterize the design rules for your PCB production process

☛ Individual Assignment

☐ 2. Make an in-circuit programmer by milling and stuffing the PCB, test it, then optionally try other PCB processes


▸ Making a PCB using the lasercutter machine

This week Jonah taught us to produce a PCB using the laser cutting machine, and to solder SMD components. We followed a tutorial to make an in-circuit programmer and set up an environment were we could program it.


▸ Group assignment

Distance between traces and the size of the tyniest traces our tool can produce efficiently is an important parameter to know ot make a working PCB. As a group assignment, Ambroise modified the traces milling test pattern and added text in different sizes in order to evaluate the precision we could have using the Epilog Fusion M2 40 laser cutting machine. This is a test patter for milling processes but the result seems satisfying but the focus might not have been precise enough as the glass fiber under the copper layer is "coppered-colored".
Nevertheless 16 traces on 20 are good, and up to 18 "between traces" spaces seems to be ok too. The text in a small size are too damaged to be read. Also, we have to admit that the cleaning process of the board may damage traces as we rub the pcb to take off the burnt layer : Straight lines are easier to keep than angles and it has to be done smoothier when working on a more detailed project.

Sample.img

We made a second try using Ambroise file, with a better focus on the material.

Sample.img
Sample.img

The tiniest and usable trace we can produce on the Epilog Fusion M2 40 is 0.4mm. But our PCB production practice is also determined by the components we have : the Fablab Digiscope uses mostly 1206 components, it is solderable and also, it allows to use components to jump traces on the board.

Sample.img
Sample.img

Here I tried to zoom more on the calibration test, and we can clearly see the pixels all along the lines.

Sample.img

Here is a capture of the text part, we can also see te pixels on the outline of each letter. On the second image we can see that on the second "2021" the 2 is damaged, the traces has been damaged during the cleaning process (sorry traces) - on the first "2021", between the 2 and the 0, on the picture we can see a short-to-be - This is why the cleaning process and the microscopic check are so important. This is not a PCB board but if it was, you totally would like to avoid this copper powder between you traces.

Sample.img
Sample.img

▸ The FabTinyIsp fabrication

To produce our in-circuit programmer we are following this tutorial to build the FabtinyIsp.
In-System programming is a sort of communication process allowing to program and reprogram microcontrollers that are already soldered to a board.

Sample.img

To start we have to download the PNG files to get the board traces and outline, from the tutorial above. Then we can go foward the steps to make it :


▸ Preparing the FR-4 PCB

FR-4 PCB is a composite material composed of woven fiberglass with an epoxy resin binder that is flame resistant, and a layer of thin copper foil on one side. We used double-sided tape to fix it to a thick steel plate so there is less risks that the PCB moves, even a little bit, during the laser cutting process. Then we can put all of it on the machine's bed.

Sample.img
Sample.img

▸ Preparing the files

We imported our PNG files in Corel Draw and put the traces file and the outline file in different layers so we can use it one at a time. We are going to use the fiber laser fisrt, to engrave the copper layer of the board and remove it. Then we will use the CO² laser to cut through th FR-4 layer. Wavelengths of these two lasers are different, the fiber one can't go through FR-4, and CO² wouldn't engrave coper. It also means that we have to modify the focus and parameters of the machine between those two steps.

Sample.img

▸ Fiber laser engraving

So, we use the fiber laser first and use the tool to focus it on our material's surface.
Then we enter our parameters in Corel Draw :

Sample.img
Sample.img

To recognize a good focus when rastering copper, the green colored light at the surface of the material is a good indicator.
The job lasted five minutes and a few seconds, at the end of it we can use the multimeter to check is the copper is sufficiently removed between the traces. If it is not the job can be restarted - it has to be done before moving the PCB plate from the laser cutter's bed.

Sample.img
Sample.img

▸ CO² laser cutting

Once the board is engraved we have to change the laser we are using and the parameters to work with the CO² laser in order to cut vectors this time. We can select our second layer in Corel Draw (don't forget to click or unclick the printer icon in the layers, so it can actually be printed). Then we modify the parameters :

Sample.img
Sample.img

▸ Cleaning the board

This part is important because the fiber engraving produces "copper powder" that could create shorts on our board. To clean the board we are going to use Isopropanol : We have to use a mask, gloves and protection glasses to do so. The process is to put isopropanol on a cloth and to rub the board with it. It has to be done efficiently, so that the burnt layer is removed, but gently enough so we don't damage our traces.

Sample.img
Sample.img

▸ Using a microscope to check the board

Using the microscope allows us to check the board and see if the dust/burnt is well removed, if there is no apparent risks of shorts. Just a detail but using the microscope we can clearly see that the fiberglass is woven too.

Sample.img
Sample.img

The digital microscope were a using above, and the microscopic view below.

Sample.img
Sample.img

▸ Soldering tiny components (or trying to)


▸ Soldering basics

How to solder :

  1. Tin the soldering iron with solder, it has to be silvery and clean before starting
  2. Use a sponge to clean the iron
  3. Heat both oart to solder, so they are at the same temperature and the heat can flow easily
  4. Approach solder wire
  5. Remover solder wire, then the Iron


▸ Get your components and schematics ready

Before soldering our board we are gathering our components, using paper and double-sided tape so we can identify those tiny things later.

Sample.img

▸ Soldering the FabTiny ISP

To solder on a board it is important to begin by the components from the center to the outside of the board. It is also better to begin by the most complicated component to solder, in our case it is the ATtiny45 microcontroller.

Sample.img
Sample.img
Sample.img
Sample.img
Sample.img
Sample.img

Here are photos of the board with all the compoents soldered on it. The usb traces and the jumper are missing. (I forgot them)

Sample.img
Sample.img

I don't know if it is perfectly smooth, but the sun makes it shiny.

Sample.img
Sample.img
Sample.img

Here are pictures of the board when using the analog microscope.

Sample.img
Sample.img
Sample.img

▸ Before programming : Software installation

Again, this step was made following the FabtinyIsp and this part particularly, regarding the environment set up on Windows.


▸ (not) Setting up the development environment on Windows 10

Before the Fab Academy I was an Adobe user on a computer and that only had to double-click an exe file to install my working environment. The part coming is much more complicated, from my point of view, and I wasn't prepared.

The first thing is to create a GCC-Toolchain, a set of tools for software development in order to program our microcontroller. This step consist in dowloading softwares and put their files in the right directories so the computer can find them when needed. It was that easy beacause some of the links from the tutorial are outdated.


▸ Update PATH

Once everytool is on the computer, we need to update the PATH in the environment settings Control Panel > System > Advanced options > Environment variables > PATH > Edit
From here we can creta a new path and enter the folder location on our computer.

Sample.img

Microchip Studio installation

As I was going to use an Atmel Ice Programmer, I chose to install Microchip Studio (the new Atmel Studio).


The installer warned me that I had to be warn about my Operating System Version and my Video Card Driver. So far I had no idea how to resolve this part, and I went forward.


Sample.img
Sample.img
Sample.img

Microchip Studio asked for the permission to install several Drivers.


Sample.img
Sample.img

Once installed, the installer warned me again, about the Atmel LibUSB0 Driver (x64), but no information regarding what this warning is about. I went on again.


▸ Check installation

Now that everything is installed, this is time for the sanity check. We are using Git Bash to check if the commands we installed are working :

Sample.img
Sample.img

▸ Install MingGW

I tried to find support searching answers on the Worlds Wide Web. I got lost several times into too technical things I could not understand with my actual understandment of what a computer is and how it works and communicates.
I went on several forums where MingGW was installed with Git Bash and I assumed it was the tool missing so that my computer can understand what I am trying to do, I used this tutorial to do so : How to install gcc in Git Bash MingGW

Sample.img
Sample.img

▸ Check again

Once MingGW was installed I run the AVR-GGG version check command again, and nope. I left my computer on this note.

Sample.img

The next morning, I woke up determined to find why it wouldn't work. I ran the command again and it actually worked. So maybe I should have restart my computer after installing all these tools.


Sample.img

As it was resolved I went on with the sanity check :


Sample.img

Similar issue which seems to have a resolution

To read further


▸ Install the Driver

I downloaded Zadig in order to install the driver for the USBtinySPI, in case it would change something. It didn't.

Sample.img

▸ How it works when it works :

Jonah helped me to go through the FabtinyIsp programmation steps on his computer. Below is a picture of the FabtinyIsp not yet programmed, connected to the programmer to become one.

Sample.img

▸ Building the Firmware

I did not go through this step using Windows. I used Jonah's file during this process. Later I could build the firm using the Ubuntu environment, it is documented at the bottom of this page.


▸ Programming the device

He uses Atmel Studio 7 on Windows 8, the first step is to open this software and to click on the Device Programming icon.

Sample.img

In the Device Programming window we have to specify the programmer we are using : An Atmel-Ice, the device to be programmed : an ATtiny45, and the interface with which it will be programmed. Then, when we click on "read" the microcontroller signature appears "0x1E9206".
We need to go to "Memories" in the left panel, from this menu we can import the firmware HEX file which contains the procedure the microcontroller has to follow. When everything is set up, we can click "Program".


Sample.img
Sample.img

▸ Setting the Fuses

The before-last thing to do in the Device Programming windows is to reach the Fuses menu in the left panel, from there we are going to "set the fuses that control where the microcontroller gets its clock source from" (quoted from the tutorial). This step will allow us to test the USBfunction of the board.

Sample.img

When clicking "Program" in the Fuses menu, a Driver Software Installation appears and the programming process begins.


Sample.img
Sample.img

▸ Checking the USB Functionality

Once the board is programmed, and before desoldering the jumper that will restrain us from programming this programmer again, we have to make sure it works. To check this I connected it to several devices :

Sample.img
Sample.img
Sample.img

So it seems to be working !


▸ Blowing the Reset Fuse

As the usb function seems to be working perfectly well we can't blow the reset fuse. Once this fuse is set, it will disable this chip's ability to be programmed again, it disables the reset pin of the board so it can be used to program other boards. The value to change is written in the Makefile.

Sample.img

I don't think I am doing it well, it could have been better, cleaner, but I multimeter-checked it and no connection between these pins, and no shorts around. At this point the board finally becomes a programmer.


▸ Using the FabtinyIsp

To make sure this is an efficient programmer we have to make it program something.


▸ Burning a bootloader to an arduino

I followed a tutorial to burn a bootloader on an Arduino, using the FabtinyIsp and the Arduino IDE : Utilisation tutorial for the FabTinyIsp

Sample.img
  1. Connect the ISP in the right orientation on both the programmer and the board to program.
  2. Open the Arduino IDE
  3. In the menu select Tools > Board > Arduino Uno (in this case)
  4. In the menu select Tools > Programmer > USBtinyISP
  5. Go back into Tools > Burn bootloader
  6. The next step that should appear is our communication LED blinking as well as those on the Arduino board.
  7. The burning bootloader is done.

▸ Programming an Arduino using a USBtinyIsp with the Arduino IDE

Then I followed another tutorial to flash a program from my FabtinyIsp : Instructables tutorial

Sample.img
  1. Connect the ISP in the right orientation on both the programmer and the board to program.
  2. Open the Arduino IDE
  3. In the menu select File > Exemples > 01. Basics > Blink - Open the Blink Sketch
  4. The sketch is using the built-in led to make it blink which is the pin 13, but it is also a pin used by the SCK connection, so we have to change it to another pin, the 9th in this case (So a LED, a resistor, two wire jumpers and a breadboard.).
  5. Once it is set, go to menu and select Sketch > Upload Using Programmer
  6. This is the programmation step again and a lot of LEDs are blinking.
  7. The LED on the breadboard is blinking, yay.

▸ How it works on Ubuntu

I installed Virtualbox on my computer, created a Virtual Machine and then installed Ubuntu in it. From there I could follow the starting tutorial following the Linux Software installation. This was much easier :


▸ How to get an Hex file using the Arduino IDE

I followed another tutorial to get Hex files from arduino sketches, this will be useful and it is pretty simple. Here is the tutorial, and here are the steps :



▸ Using the programmer with Ubuntu


I tried to flash a program to an arduino using Ubuntu's Terminal. I first had a issue as avrdude could not find the USBtiny device. This was quickly resolved by clinking on the device in the Ubuntu's Device menu.
Then I tried to flash the sketch I got the hex file from (a blinking LED which is blinking faster than the previous sketch). To do so I typed the command avrdude -c usbtiny -p m328p -P usb -U flash:w:Blink_ino.hex but it resulted in an error. I can't find why at the moment.


Sample.img

I gave it another try, I changed the file's name which was "Blink.ino.hex" to "Blink_ino.hex", and kept the same command, it worked !


Sample.img

▸ Conclusion of the week

I learned a lot this week, and I everything did not work like the tutorials pretended it did, mainly because of outdated links. But at the moment I have an environment which cannot program a FabtinyIsp into a programmer yet, but which can program other boards using it as a programmer. Then I have a second environment, where I can maybe program a programmer (I still have to make another FabtinyIsp in order to test that part), and with which I can also program another board using the programmer I've made.



‹ Previous : Computer Controlled Cutting   •   Next : 3D Scanning & Printing ›