10. Electronics Production-output
This week, I designed a PCB in KiCad and documented the full workflow, from library setup and schematic design
to PCB layout, Gerber export, and PNG conversion for CNC milling.
Although the design workflow is complete, our Snapmaker currently lacks a proper clamp/fixture for stable
workholding, so precise in-house PCB milling is not reliable yet.
For now, I completed the circuit design and prepared the manufacturing files.
I also finished an output test circuit in Circuit Designer. When I press the button, the servo rotates by 10 degrees.
Test code:
/* * This Arduino Sketch controls a servo motor using a pushbutton. When the * button connected to pin D2 is pressed, the servo connected to pin D5 * rotates by 10 degrees. The servo is powered by the 5V pin and grounded * through the GND pin of the XIAO ESP32S3 microcontroller. */ #includeServo myServo; // Create a Servo object const int buttonPin = D2; // Pin where the button is connected const int servoPin = D5; // Pin where the servo is connected int buttonState = 0; // Variable for reading the button status void setup() { pinMode(buttonPin, INPUT); // Set button pin as input myServo.attach(servoPin); // Attach the servo to the servo pin myServo.write(0); // Initialize servo position to 0 degrees } void loop() { buttonState = digitalRead(buttonPin); // Read the state of the button if (buttonState == HIGH) { // Check if the button is pressed myServo.write(10); // Rotate servo to 10 degrees delay(500); // Wait for half a second } else { myServo.write(0); // Reset servo to 0 degrees } }
Output -servo motor comparision
For a robotic arm, the “best” servo depends on where it sits on the arm.
A simple rule is:
- Base / shoulder joints need the highest torque.
- Elbow needs medium torque.
- Wrist / gripper / lamp head can use smaller, lighter servos.
For a small desktop robotic arm, I compared these common options:
| Servo | Typical size/class | Stall torque | Weight | Good for | Main limitation |
|---|---|---|---|---|---|
| SG90 | micro | 1.8 kg·cm @ 4.8V | 9 g | tiny pointer, very light head | too weak for most arm joints |
| MG90S / MG90D | micro metal gear | 1.8–2.4 kg·cm | 13–13.4 g | wrist, light end-effector | still weak for shoulder/base on a real arm |
| SG92R | micro | 2.5 kg·cm @ 4.8V | 12 g | light wrist joint | still not ideal for heavy load joints |
| MG996R | standard servo | 9.4 kg·cm @ 4.8V | 55 g | base, shoulder, elbow on hobby arms | heavier, noisier, more current draw |
| Feetech STS3215 / SCS215 | smart bus servo | 16.5-19 kg·cm | 55 g | better robotic arms, feedback and control | more expensive, needs bus setup |
Finally, I decided to use the Feetech STS3215 because it offers the highest torque while keeping the weight low.
PCB Design
Step 1. Download and Install the Fab Academy Library
Before starting schematic design, I downloaded the Fab Academy KiCad library using:
git clone https://gitlab.fabcloud.org/pub/libraries/electronics/kicad.git
After downloading, I imported both symbol and footprint libraries in KiCad:
- Manage Symbol Libraries: add Fab Academy symbol library
- Manage Footprint Libraries: add Fab Academy footprint library
Then I opened Settings → Configure Paths and added a new path to the downloaded Fab library folder. This path setup is important, especially for correct 3D model display.
Step 2. Create the Schematic
I created the schematic in KiCad and added these components:
- One main MCU
- One LED (1206)
- One switch
- Two 6-pin socket headers from the Fab library
After placing all components, I connected them into a simple working circuit. I used a 499 ohm pull-down
resistor with the switch to improve circuit stability and reduce the risk of short circuits or unexpected behavior.
Step 4. Generate the PCB Layout
After finishing the schematic, I used Update Schematic to PCB to transfer the design to the PCB editor.
The PCB workflow was:
- Adjust PCB design rules
- Route all traces with the Route Tool
- Add text and emoji graphics for personalization
- Draw the board outline on the Edge.Cuts layer
- Run DRC checks for design-rule and layout errors
- Review the board in 3D Viewer
Step 5. Export Gerber Files
After confirming the board design, I exported Gerber files for fabrication and for the CNC toolpath workflow.
Step 6. Convert Gerber Files to PNG
To generate toolpaths in Mods, I converted Gerber files to PNG using an online tool (Gerber2PNG).
Uploaded files:
- F_Cu.gbr
- Edge_Cuts.gbr
Generated outputs:
- One PNG for trace milling
- One PNG for outline cutting
PCB Update
To better support PCB production requirements and Week 8 group assignment needs, I updated the design with the following improvements.
Step 7. Round the PCB Corners
I changed sharp corners to rounded corners (3 mm radius) on the Edge.Cuts layer to improve manufacturability and board appearance.
Step 8. Add Teardrops
I used Edit → Add Teardrops and adjusted the settings for CNC milling, to strengthen pad-trace connections.
Step 9. Add Copper Fill
I added a GND copper fill zone on the F.Cu layer, drew the fill around the board, and pressed B to refill all zones. I checked clearance to make sure the fill kept safe distance from signal traces.
Step 10. Export the Updated PCB Files
After these updates, I exported new Gerber files and converted updated F.Cu and Edge.Cuts files in Gerber2PNG again for Mods and CNC toolpath generation.
Current Fabrication Limitation
Although I completed the PCB design workflow, our Snapmaker currently does not have a proper clamp/fixture for stable workholding. Because of this, it may not guide or hold the PCB precisely during milling.
For now, I completed the circuit design in the circuit designer and prepared the manufacturing files, but I have not proceeded to precise in-house PCB milling yet.