Week 9: Output devices

Assignment: Add an output device to a microcontroller board you've designed, and program it to do something

I want to use this week's assignment to build up to my final project. Therefore, I want this week's PCB to contain a microcontroller (Xiao RP2040), a button, and a driver that connects to my stepper motor. Hopefully, if i get the one button-motor system working, I can later expand it to 4 buttons for the vending machine. I used my older work from the Embedded Programming week as a reference, and put together this schematic on KiCad.

schematic

Then, I transferred everything to the PCB editor and drew the traces. It was much easier than the 4-buttons version of the same thing. I am honestly still worried about how I am going to do that, but that is a problem for another day. Here is the simpler version!

PCB editor

Milling this board was actually so tough, for some reason. It defintiely tested my patience. I was in the Archshops at night, after Shah and Jen had left. I had only milled once before, with Diana and Javier, and had never done it totally alone. My first attempt was bad. I only realized after, but I was milling the traces while the "mill outline" setting was pressed. My first time doing this, it was already at the mill traces setting, so I completely forgot that I would need to make sure before checking. This is how it went:

first attempt

In fact, I still didn't realize why this happened, so I ran it again (so embarrassing!!), but this time I stopped it as soon as the telltale mini disks started being released from the rest of the copper plate.

second attempt

I'm keeping this as a souvenir:

souvenir.jpg

My third attempt, I finally caught on to the issue and milled the traces successfully! I then switched to the 1/32" bit, and to the edge cutting settings, but the same thing happened to me that happened to Diana and I the first time we tried milling my initial PCB. It cut through some of my traces, making them useless.

third attempt

My fourth attempt was more successful, but not without its speed bumps as well. After the machine was done milling the traces, it still looked like this:

fourth attempt

It stopped milling fully at some point along the way. I'm not sure what this means. Did the bit break? I was not sure, so I just ran it again, and it worked. Then, it was time to cut the edges, so I swapped the 1/64" bit with the 1/32" bit, changed the setting, and cut. This time, I changed the origin by decreasing X from 2 to 0.2. I hoped this 1.8mm offset would stop it from cutting into any traces. This had the desired effect, but something weird happened. One of the tape strips came off of the copper plate, and my PCB (which is practically finished at this point), starts rising up in the machine, trying to rotate with the milling bit. Upon a closer look, you can see that the puncture in the plate actually does not interrupt any of the traces. In a last effort to prevent having to mill another board, I asked Shah if it was still useable, and he said it was worth a shot!