Week 08: Electronics Production

Assignments:

Group Assignment

  • Characterize the design rules for your in-house PCB production process
  • Submit a PCB design to a board house
  • Document your work to the group work page and reflect on your individual page what you learned

Individual Assignment

  • Make and test an embedded microcontroller system that you designed

Things to Complete This Week

  • Re-design Final Project PCB with updated components
  • Document design process of the object
  • Learn how to use the CNC machine
  • Include design files!

Here is my schedule for this week.

Weekly schedule

Here is the link to my schedule


Group Assignment

You can access our group assignment here.

Extracted template files
This week, I was able to gain a strong understanding of PCB production. As a group, we explored different fabrication settings. Learning how milling works allowed me to design and produce a PCB of my own ๐Ÿ˜.

Individual Assignment

I started this week by re-designing my Final Project's PCB ๐Ÿ˜ฎโ€๐Ÿ’จ. Based on feedback (From Sir Rico and Sir Anith) and research, Iโ€™ve made these three changes:

1. Reducing pin usage
Connect all ultrasonic "Trigger" pins to a single pin on the microcontroller. This reduces the number of pins used - YAYYY! ๐Ÿ˜„.

2. Signal-Based Navigation
Iโ€™ve decided to move away from the whole "camera tracking a specific colour marker" and am planning to implement a Bluetooth following system ๐Ÿ’™. I want to design a small wearable device that will continuously send Bluetooth signals so that the backpack can follow that signal. I feel like this will be more reliable than the camera, because in the camera's case, I'd have to consider a lot of other factors like lighting.

3. Microcontroller
To support these new changes and keep the project realistic, I am switching to the XIAO ESP32-C3 ๐Ÿ˜

Note to self: These changes are really different from your initial plan ๐Ÿ˜…

XIAO ESP32-C3

Extracted template files
Image source

The XIAO ESP32-C3 will read distance data from three HC-SR04 Ultrasonic Sensor modules placed at the front, left, and right to detect obstacles. I will also use the built-in Bluetooth on the C3 to communicate with a small device carried by the user, allowing the backpack to follow the Bluetooth signal.

The backpack will move using two DC gear motors controlled by a TB6612FNG motor driver. By changing the motor directions, the backpack can move forward, reverse, or turn. The motor speed is controlled using PWM from one GPIO pin.

I will also connect a DFPlayer Mini MP3 Module through UART so the backpack can play audio from a microSD card through a small speaker. Since all nine usable GPIO pins on the C3 are used, there are no spare pins left.

Designing the PCB

Note: I have not included the full steps of designing a PCB on this page. You can view the full process in my week 6 (Electronics Design) page.

I first started with the schematic design. I ran the Electrical Rules Checker and came across a few errors. Most of them were because I had not assigned footprints to the symbols, and the others indicated that an input pin was not being driven by any output pin.

Extracted template files

To resolve this issue, I added power flags to indicate that the nets were being powered.
What is a power flag?
A Power Flag is a small marker you add in a PCB schematic (like in KiCad) to tell the software that a wire really has power on it.

Extracted template files

Here is the complete design with no errors ๐Ÿ˜:

Extracted template files

After completing the schematic design, I annotated it. Annotation assigns reference numbers (such as R1, C1, and U1) to the components so they can be properly identified in the PCB layout.

I then started assigning footprints to the components.


Editing website in VS Code Editing website in VS Code

Now for the routing part. These were all the components that I had to route.

Extracted template files

This was my first attempt, and it was nowhere near ready for routing. ๐Ÿฅฒ

Extracted template files

My second try turned out much better than the first, and I thought it might just work. ๐Ÿค”

Extracted template files

I still had to connect some ratsnest lines. ๐Ÿ™‚

Extracted template files

I did not know how to resolve this connection because placing a 0ฮฉ resistor in one of the power nets created additional connections. Sonam Tshering helped me and suggested adding a 0ฮฉ resistor with both ends connected to the 3.3V rail, which solved the issue. Thank you, Sonam Tshering!

Editing website in VS Code Editing website in VS Code

Here is the final PCB layout! ๐Ÿ˜

Extracted template files

Generating toolpath in MODS CE

After designing the PCB from the schematic, I used Mods CE to generate the toolpath. Detailed steps can be found in my Week 6 documentation. Even though generating the toolpath was not required for Week 6, I had already completed this step earlier, which made this weekโ€™s process much easier.

Editing website in VS Code Editing website in VS Code

After coming this far, I found out that my PCB had a LOT of short circuits (Thank you Sir Anith for helping me identify them). I also realized that I need to reduce the thickness of my power traces from 1.2 mm to 0.8 mm. Because of these issues, I might just have to re-route the whole thing again ๐Ÿ˜ฎโ€๐Ÿ’จ๐Ÿค—๐Ÿ˜ซ.

This process took up most of my week, so I do not have enough time to redo everything for my final project right now. Therefore, for this weekโ€™s assignment, I will focus on designing and fabricating a XIAO ESP32-C3 โ€œhello button blinkโ€ board with additional pin headers. I am really sad about not being able to mill out my final project pcb, but I HAVE TO finish the assignment first. ๐Ÿ˜‰


Hello Button Blink Board

I checked out the Fab Academy site and found this reference image on their embedded programming page:

Extracted template files

I first started with the schematic design and here is the final layout:

Extracted template files

I had less components to route this time so it didn't take a long time ๐Ÿ˜„ (Thank god)

Editing website in VS Code Editing website in VS Code

Milling

After I was done creating my rml file using MODS CE, I started with the milling process. The milling machine that we have in our Lab is the monoFab SRM-20. For a more detailed understanding, you can refer to the SRM-20 User Manual .

Extracted template files

The software used for operating the machine is VPanel for SRM-20

Extracted template files
Image source

For the PCB, I used FR-1 material. To hold the board in place on the Roland SRM-20, I attached double-sided tape to the back of the PCB and pressed it firmly onto the machine bed so that it does not shift during the milling process.

1. Selecting the endmill

First, the circuit traces have to be milled using a 1/64 (0.4 mm) end mill. After that, the tool was replaced with a 1/32 (0.8 mm) end mill to cut the edge cut outline. To change the tool, I loosened the collet, removed the smaller endmill, and then replaced it with the larger one (I made sure that it was screwed properly). The X and Y positions remained unchanged, while only the Z axis is adjusted to match the new tool height.

Since we're doing traces first, I used the 1/64 (0.4 mm) end mill.

Extracted template files

2. Setting the X and Y origin

I started by opening the software and ensuring the machine is powered on and connected. I used the control arrows to move the tool head to the position where I wanted the milling to begin. Once it was in the correct spot, I set that location as the X and Y origin using the Set Origin Point ([X/Y]) option.


3. Setting the Z origin

I slowly lowered the tool using the controls until it was just above the surface of the board. Then, I carefully adjusted it by hand using an Allen key until the tool lightly touched the surface. After setting the correct height, I saved this position as the Z origin by clicking on [Z] .

Extracted template files

4. Start cutting

I clicked on Cut and selected my rml file. Don't forget to delete any previously selected files before opening the actual one. You can then click on output and the spindle will start spinning. ๐Ÿค“

Extracted template files

It was so fascinating to watch the spindle move ๐Ÿ˜„.


Editing website in VS Code Editing website in VS Code

Soldering

Soldering is the process of joining ๐Ÿ™ electronic parts together using melted metal.


These are the components that I'll be working with ๐Ÿง‘โ€๐Ÿญ

Extracted template files

Here is how it looks now! ๐Ÿ˜„

Editing website in VS Code Editing website in VS Code

Soldering Tips & Precautions

  1. Heat both the PCB pad and the component leg before adding solder
  2. Apply solder to the joint, not directly to the iron
  3. Use a small amount of solder (avoid big blobs)
  4. Keep the soldering iron tip clean
  5. Donโ€™t overheat components (2โ€“3 seconds is enough)
  6. Keep the component still while the solder cools
  7. Check for solder bridges between nearby pins
  8. Reheat (reflow) joints if something is loose
  9. Use flux for cleaner and smoother joints
  10. Make sure connections look shiny and smooth

Programming

I will be using Arduino Ide to program my PCB. I also used it during week4 (Embedded programming week) ๐Ÿค 

I asked ChatGPT to generate a code for my board. This was the prompt I used: Can you write a basic program where an LED blinks whenever a button is pressed?


const int buttonPin = D1;
const int ledPin = D8;

void setup() {
  pinMode(buttonPin, INPUT_PULLUP);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  if (digitalRead(buttonPin) == LOW) {  // button pressed
    digitalWrite(ledPin, HIGH);
    delay(200);
    digitalWrite(ledPin, LOW);
    delay(200);
  } else {
    digitalWrite(ledPin, LOW);  // off when not pressed
  }
}
  

I pasted the code and selected my board, then selected the port.

After that, all I had to do was upload the code ๐Ÿ˜ƒ

Editing website in VS Code Editing website in VS Code

IT WORKED!!! ๐Ÿฅณ๐Ÿฅณ๐Ÿฅณ


This week, I felt real panic and and genuinely though that I wasn't going to finish my assignment on time ๐Ÿ˜…. Even with everything feeling rushed, I still managed to learn a lot. Iโ€™m now much more comfortable using the milling machine, which makes me really happy. However, I still need to make some changes to my Final Project PCB. ๐Ÿซ 

Thank you!!! O(โˆฉ_โˆฉ)O Bye~Bye~