Week 4 : Electronic Production
Summary
This week I made a microcontroller board, and I tested it with a simple code.
Assignments
Group Assignment
- Characterize the design rules for your in-house PCB production process send a PCB out to a board house.
Individual Assignments
- Make and test a microcontroller development board extra credit: make it with another process.
Design Rules Characterization
This part was done in group and is accessible on the group page.
Making a Microcontroller Development Board
Starting from PNG
The first phase involved testing different tools to generate gcode (machine instruction code) from the PNG files supplied by FabAc.
Using FlatCAM
FlatCAM is a software program that generates gcode files from various types of file: gbr, svg, png, etc. To do this, I need to program the software, supplying the necessary machine information.
Here I’ve tried importing the png slightly modified with GIMP (color inversion) to be able to set the color as the one to be isolating by the CNC.
Then I had to generate the machine path by performing an isolation routine, but this crashed the software.
I preferred to look for an alternative rather than trying to fix the bug.
Using Fusion 360
The alternative I came up with was to try using Fusion 360 to generate the gcode.
To do this, I first create the copper plate in Fusion 360, and import the SVG on the top surface. The previous PNG file was vectorized with Inkscape (Tool -> vectorize an object).
Next, I need to configure the machine operation. To do this, I go to the “Manufacturing” section and define a set-up. Select the machine to be used - in this case, a Bantam CNC Milling Machine - and the space on which to operate.
Then define the manufacturing functions. I select the 2D contouring operation. Various things need to be defined: the tool to be used, the path to be followed, the parameters to be used (feed szpeed, tool rotation speed, etc.). With this operation, I’ll draw the contours of the traces. I also need to define a drill operation for the holes and a contour operation to separate the PCB from the rest of the copper plate.
It is possible to simulate the operations after defining them, which is very interesting.
I didn’t get to the end of this because a simpler alternative appeared. Nevertheless, this way of generating gcode should work.
Starting from GBR
The alternative was that our intructors Nicolas and Axel provided us with a gerber file of the PCB we had to produce. This has been slightly modified, in particular the width of the traces is wider than before, to make the subsequent soldering work easier.
Our CNC milling machine for PCBs is a Bantam. This brand has dedicated software that handles gbr files directly. The first step is to import the gbr file into the software and connect the CNC to the computer via USB.
I then have to configure the software by setting up: the dimensions of the manufactured part, importing the file, configuring the position of the operation.
I also configure the operation to be carried out. I start by making tracks and holes. For this step, two tools are needed: .3mm flat end & .6mm flat end. The software knows when to use which tool, having been pre-configured in the gerber file by Nicolas. During the operation, the software will tell me when to change the tool. I start with the .3mm flat end.
I then launch the milling. The machine automatically detects the length of the tool to know the position of its tip. The machine can also detect the thickness of the material.
When the operation is launched, I can follow the progress via the control screen.
The outlining is done separately to ensure that there were no problems during tracing before separating the PCB from the copper material.
For the outline, this time select the “Outline” operation and use a .8mm flat end as the tool. Several passes are configured in the gerber file to do this cleanly without risk of damaging the tool or the machine.
That’s it ! the PCB is done !
Soldering differents elements
To start soldering, I first have to prepare the board by removing any oxidation layer that may have formed on it. In fact, copper will oxidize with air over time, creating a less conductive or even non-conductive layer.
To do this, I clean the PCB with soap and a metal sponge, which will strip off the oxidation layer. I dry the plate and clean it with alcohol.
I can now start soldering with the following equipment: a soldering station, a manual vacuum cleaner to remove the material if necessary, and a multimeter to test the soldering and connections.
The list of components to be welded is as follows.
Components | Amount |
---|---|
SEEED STUDIO XIAO RP2040 | 1 |
CONN HEADER SMD 10POS 1.27MM | 1 |
CONN HEADER SMD R/A 6POS 2.54MM | 1 |
Tactile Switch SPST-NO Top Actuated Surface Mount | 1 |
LED BLUE CLEAR 1206 SMD | 3 |
RES 1K OHM 1% 1/4W 1206 | 4 |
RES 470 OHM 1% 1/4W 1206 | 1 |
CONN HDR 7POS 0.1 TIN SMD* | 2 |
I proceeded step by step, starting with the “easy” connector, the button, the resistors and diodes, and the other connectors.
Each time I solder, I test that the connectivity is at the solder terminal and not with the rest.
I managed to get a functional result! However, many of the welds are not clean at all…
Now it’s time to check that everything works!
Testing the board
I started by following Adrian Torres' tutorial on Arduino :
- Adding additional board URL.
- Adding Pico library.
- Choosing XIAO-RP2040 & selecting right COM.
After that, I tried to use the Blink code from Arduino modifying the used PIN. The result was good !
I finish by creating a small code to say hello which is presented below.
Source code :
/*
Based on "Blink" from Arduino. I create a small C code to speak in mors language.
Teo Serra
*/
// Define LED_PIN.
int LED_PIN = 26; //Led pin number
int PointTimer = 250; //Point timer
int LineTimer = 500; //Line timer
int PauseLetter = 1000; //Pause timer between two letters
int PauseWord = 2000; //Pause timer between two words
//Blinking function : "nbr" is the number of blink in a row, "timer" is theselected timer to do a point or a line, "led" is the pin number of the led.
void morseBlink(int nbr, int timer, int led){
for(int i=1; i<= nbr; i++){
digitalWrite(led, HIGH);
delay(timer);
digitalWrite(led, LOW);
delay(timer);
}
return;
}
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_PIN as an output.
pinMode(LED_PIN, OUTPUT);
}
// The loop says "HI" in Morse code by blinking the led.
void loop() {
// H letter : 4 points
morseBlink(4, PointTimer, LED_PIN);
// pause
delay(PauseLetter);
// I letter : 2 points
morseBlink(2, PointTimer, LED_PIN);
// pause
delay(2000);
}