In week 4, we already covered the downstream steps of PCB production by taking an existing circuit of the FabISP and going through the CAM process. This week, we will start at the beginning by actually designing the circuit. I will use Eagle for the layouting process, starting with the schematic view and then proceeding to the boards layout drawing the traces. Afterwards, the finished design will be exported into *.png
files for the internal engravings of the circuits and the external cutting of the board.
So here are the tasks for Week 06:
I will use the ATtiny44 for this assignment, which versatile little chip. The data sheet can be found here.
The ATtiny44 is an 8-bit microcontroller, can run at 16 MHz and has overall 12 pins on two ports for inputs and outputs. PB0 and PB1 are dedicated to the external crystal (marked with XTAL1 & XTAL2). Page 26 of the data sheet how it needs to be connected, including two capacitors.
Apart from VCC and GND, SCK, MISO and MOSI have to be connected to pin headers to program the microcontroller via the serial programming interface (SPI).
The defined input pin PA7 for the button needs to be pulled low in order not to be in a so-called floating state. Connecting it to GND required a pull-down resistor to avoid a short circuit. A 10K resistor will limit the current to 0.5 mA, which won't damage the microcontroller.
The LED needs to reach the recommended forward voltage V_f in order to light up (2.2 V), which you can find in the data sheet. A current limiting resistor is needed to stay below the forward current of 10 mA. With the supply voltage U_s of 5 V, we can calculate the resistance of current limiting resistor to 280 Ohm, R=(U_s-U_f)/I. I used 1 K and it worked, but a smaller resistor of 0.5 K would have been sufficient as well. The resulting power dissipation with 0.1 W (P=I²*R) is also way below the resistors power limit of 0.25 W.
Eagle uses libraries to add the correct parts. I imported the Fab library which contains all relevant parts for this task, including switches, LED, resistors, capacitors, crystal and the ATtiny44. I used the label function to keep everything organized. The schematic is basically drag and drop. Just pay attention to the GND as there should be a common one.
In this manual mode, it took me some iteration to arrive at the final design. In this rather simple setup, it was possible without any "zero Ohm" resistors or bridges. More difficult layouts with several layers however cannot be done manually.
After exporting the monochrome layout, the preparation for the CAM process is done in GIMP. We need to create two files for the internal milling path of the traces as well as the external cutting path.
Final results for the internal and external path:
Use these files as an input for Fab Modules.
By the looks of it something was already wrong here.
In my first trial, I forgot to set the isolation of the traces but I didn't occur to me until the milling was done.
In my second trial, I set the isolation to 0.015.
I had to do the cutting twice as it did not go deep enough in the first place. In the second go, I went 0.3 mm deeper. After the second run, removal was no problem.
However, the external path image was to narrow by design, so I had to decrease the tool size (originally 2 mm to 0.5 mm) in Fab Modules to calculate the path. This made the mill hit the inner structure at the lower switch. As these are not connected, the board was still good enough to move on with soldering. Next time, it would leave a bit more space for the external path.
The soldering is not very complex, as there is enough spacing between the individual components and the wires are well insulated. I collected all the parts and started soldering. In doing so, I mixed up the two resistors, so I had to remove the 1k resistors using copper wire which went without further damages. I used the multimeter to check the connections.
Bill of materials
For programming the board, I needed the Arduino IDE as well as a patch for the ATtiny44 which could be found here . I used an Arduino Uno to burn the bootloader onto the ATtiny in the first place. Therefore, the Arduino needs to act as an in-serial programmer (ISP). Choose the correct example file from the respository, set the board as well as the port and upload the ArduinoISP
program.
Connect the Arduino to the board using the SPI connection.
In order to burn the bootloader, select the ATtiny44 from the board menu. and set the clock to external 20 MHz.
I took the Blink sketch from the Arduino examples to verify the function. I was using PB 2 or pin 8 in Arduino language, so I had to add the respective line of code. Then, I flashed a test program onto the chip to make sure that it works...but it did not. It turned out, that most things where done correctly. Except for the fact that I used a 1M (1004) resistor for the LED instead of a 1k (1001) resistor. However, I could show with a multimeter that the voltage of the output pin was actually switching between HIGH 5 V and LOW 0 V and that the board was working. I will change the resistor as soon as possible.
After changing the resistor, the LED worked as you can see in the video. The code however needs to be modified to act on switching. Have a look at week 8 to learn about details.
I designed and made a board for a weather station before. The board was a slightly modified Satshakit. As I had to solder a bunch of sensors to the board for the data acquisition of the weather station, I thought about soldering the DHT sensor directly to the board instead of wiring it. Therefore, I disconnected pin PC0 which will be the DHT's data pin. Additionally, ground & VCC were rewired, as well as a pullup resistor for the data pin. I added an MA04-1 component from the library which carries four pins. Pin 3 of the DHT does not have to be connected.
As we have to solder a bunch of sensor to the board for the data aquisition of the weather station, I thought about soldering the DHT sensor directly to the board instead of wiring it. Therefore, I disconnected pin PC0 which will be the DHT's data pin. Additionally, ground & VCC were needed as well as a pullup resistor for the data pin. I added an MA04-1 component which carries four pins. Pin 3 of the DHT does not have to be connected.
The standard manufacturing process involves a lot of steps involved also soldering of the components as well as testing of these. For this week, we will focus on the manufacturing of the PCB only (Milling step). Use GIMP to prepare an internal and external cutting path as in the lecture before.
The settings for the milling of the circuits of the board can be found here:
For the programming part of our MEGA328P chip, we will need an additional microcontroller that already has a bootloader in installed as with the Hello_World board in lecture 5.
Download the ATMEGA328 bootloader here and follow the instructions to install it.