Embedded Programming
This week I traveled to Columbus, OH to connect wtih Andrew Bruening and PAST Foundation Lab to explore embedded programming, design and create PCB, practice surface mount soldering, and install a simple blink code with Arduino.Our current lab has a limited selection of microcontrollers. We researched other microcontrollers such as ESP32 and SAMD21. However, our primary focus will be RP2040.

Individual Assignment
Group Assignment
Comparison: ESP32 vs. RP2040 vs. SAMD21
Similarities
- All three microcontrollers support programming with Arduino and MicroPython.
- They are widely used in embedded systems, IoT applications, and low-power designs.
- Each microcontroller has GPIOs for interfacing with sensors and peripherals.
Differences
- Processing Power:
- ESP32 has a dual-core Xtensa LX6 processor running up to 240 MHz.
- RP2040 has a dual-core Cortex-M0+ running at 133 MHz.
- SAMD21 has a single-core Cortex-M0+ running at 48 MHz.
- Memory:
- ESP32 has 520KB SRAM and supports external flash.
- RP2040 has 264KB SRAM and 2MB onboard flash.
- SAMD21 has 32KB SRAM and 256KB flash storage.
- Connectivity:
- ESP32 has built-in Wi-Fi and Bluetooth.
- RP2040 and SAMD21 lack native wireless connectivity.
- Power Consumption:
- ESP32 consumes more power due to its Wi-Fi and Bluetooth capabilities.
- RP2040 is more power-efficient but does not have built-in connectivity.
- SAMD21 is optimized for ultra-low power consumption.
- USB Support:
- ESP32 has native USB-to-serial communication.
- RP2040 supports USB device and host modes.
- SAMD21 has built-in USB support.

Research
- Getting Started With Seeed Studio
- RP2040 DataSheet
- First Iteration: The drill bit did not ptovide ample penetration, resulting in incomplete traces.
- Second Iteration: The drill bit was set too deep, causing overcut traces that compromised the circuit.
- Third Iteration: A finer-tipped drill bit was used, and the schematics were updated. This resulted in a successful PCB with well-defined traces.
- Finalize PCB assembly once components arrive and/or locate electronics store.
- Solder the button and other necessary components onto the PCB.
- Test the microcontroller’s interaction with input/output components.
- Program the microcontroller to establish remote communication.
- Document the results, including challenges faced and solutions implemented.
PCB Design Challenges
During the PCB design process, several challenges were encountered. The laser that we first tried to etch the PCB was the XTool F1 Ultra with a 20W fiber laser. The laser cutting was not successful. The laser did not cut with enough precision to make proper electrical connections.

Using CNC Milling for PCB Fabrication
Due to the limitations of laser cutting, CNC milling was used to create the PCB. We opted for the Forest Scientific ATC (auto tool changer) to assist us with this process.
Zeroing the X, Y, and Z Axes in CNC Milling
When using CNC milling, it was crucial to properly zero the X, Y, and Z axes before starting the milling process. Zeroing ensures that the machine knows the exact starting point, preventing misalignment and material wastage. The X and Y axes were set to define the origin of the PCB layout, while the Z-axis was carefully adjusted to control the cutting depth. Incorrect zeroing can lead to shallow cuts, which may not fully engrave the traces, or deep cuts, which can damage the board. By accurately zeroing all three axes, we ensured precise milling and a functional PCB.




Component Availability and Testing
For testing, a button needs to be soldered onto the PCB. However, the lab currently does not have buttons or sensors in stock. Orders have been placed for the necessary components, and testing will be finalized as soon as the parts arrive.