05. ELECTRONIC PRODUCTION
GROUP WORK
PCB DESIGN RULES & PCB UPLOAD
Softwares: KiCAD, Mods (HTMAA), Gerber2Img
Devices: Architecture Milling Machine
Files: TarotTutorPCB.zip
ChatGPT:
00
01
02
03
04
05
06
07
08
5.1 PCB FINAL DESIGN
5.2 MILLING
5.3 TESTING
Code 1: Simple Tarot Card Meaning Pull Up: OLED
Design Rules -
Architecture Section
PCB Upload
TRIALS & TRIBULATIONS
LESSONS LEARNED
We did this milling test to see how small the end mill could make with gaps,
and went over how to mill by milling out Tyler’s board.
Stasya, Adin, and I then uploaded one of our board designs to JLCPCB. We
looked at the different options and ultimately were curious to see just how
expensive we could make the board.
Initally, I planned just to mill out the board I designed for last week and
my final project, but I realized I never properly saved my PCB Editor file
so I had to redo all of traces...
But before I started to work on my traces, I got a chance to talk to some
other people in the class, particularly Colletta, who let me know that I
used the wrong component to create my speakers! I used an MP3 player in my
schematic rather than an amplifier and speaker.
This became the second version of my board!
The components I initially used were 2 RFID Tag Readers, a Microphone, an
MP3 player, OLED, Button, and Xiao RP2040.
In hindsight, I was being SOOOO ambitious...
This board was so tough to create wiring routes for... there were too many
components, and my schematics were also messy and hard to parce out. I ended
up with a MESS of a board ;-; It had 10 (yes. TEN!) jumper resistors, six of
which were under the Xiao board. Both Gert and Anthony warned a LOT against
this, but I was firm on the idea of just propping the Xiao on header pins
and letting it hover over the resistors.
By this point, I had been in lab for about 5 hours trying to clean up the
board and make sure my traces were thick enough and made sense, and I had
gotten frustrated so I decided to simplify my board for a final version. I
got rid of the microphone and decided to only use a single RFID antenna,
OLED, button, and speaker just to start. This made my life so much easier...
To start milling, I exported my Gerber File from KiCAD to Gerber2Img and got
3 PNG files for the types of cuts made.
Then, with some help from Gert, I uploaded my images to Mods and loaded the
proper end mill into the machine. After calibrating the x, y, and z of the
machine, I sent it to mill. Since the board ended up being pretty close to
the edges, I decided not to do the edge cuts after the drill holes so that I
could make space for the next person who wanted to mill.
I taped my PCB to a piece of cardboard and clipped it to a microscope. To
assemble, I went from the smallest to largest components, starting from the
0 ohm resistors to button, to Xiao to OLED Display module.
With this board, I would like to first test loading randomized tarot card
meanings onto the OLED screen with the click of this button. Then I would
like to test a text to speech program to have the messages be vocalized.
Lastly, I would like to test the RFID system and see if I can tap regular
RFID tags (not cards) to load particular tarot card meanings.
Here is the code (written by
ChatGPT
) for a simple randomize card meaning pull up with the button as a
trigger. This code is simple and only looks at part of the Major Arcana
Cards. I did not get to test this out yet (i’m sorry... )
I think next steps for this board would be to create an excel sheet of all
the tarot cards and their simple meaning, export it as a CSV file that can
be used later to grab the text information about the card meanings to be
sent to the microcontroller. And thinking about how I will create the tags.
We ran out of both the Audio amplifier breakout board and chip, and my RFID
card reader is not on the class list, so I had to make an order for those
parts (coming in tomorrow morning)
But this would be the final layout!
My traces ended up being soooo much more legible, and the board fit
perfectly on the smaller plate.
This ended up being my final board!
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// OLED setup
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
// Button pin
const int buttonPin = 2;
// Debounce variables
unsigned long lastDebounceTime = 0;
unsigned long debounceDelay = 200;
int lastButtonState = HIGH;
int buttonState;
// Tarot meanings (you can expand this!)
String tarotCards[][2] = {
{"The Fool", "New beginnings, trust the
journey"},
{"The Magician", "Manifestation,
resourcefulness"},
{"The High Priestess", "Intuition, inner
voice"},
{"The Empress", "Growth, nurturing energy"},
{"The Emperor", "Structure, stability,
control"},
{"The Lovers", "Union, choices, harmony"},
{"The Hermit", "Reflection, inner guidance"},
{"Death", "Transformation, letting go"},
{"The Sun", "Joy, success, vitality"},
{"The Moon", "Illusion, subconscious"}
};
int numCards = sizeof(tarotCards) / sizeof(tarotCards[0]);
void setup() {
pinMode(buttonPin, INPUT_PULLUP);
Serial.begin(9600);
// Initialize OLED
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for (;;);
}
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println("Press the button");
display.println("to draw a card...");
display.display();
randomSeed(analogRead(0)); // Seed randomness
}
void loop() {
int reading = digitalRead(buttonPin);
if (reading == LOW && lastButtonState == HIGH && (millis() -
lastDebounceTime) > debounceDelay) {
lastDebounceTime = millis();
// Pick a random card
int index = random(numCards);
// Display card name + meaning
display.clearDisplay();
display.setTextSize(1);
display.setCursor(0, 0);
display.println(tarotCards[index][0]); // Card name
display.println("--------------------");
display.setTextSize(1);
display.println(tarotCards[index][1]); // Card meaning
display.display();
Serial.print("You drew: ");
Serial.println(tarotCards[index][0]);
}
lastButtonState = reading;
}
-
ALWAYS START SIMPLE - stressing out over a huge number of components and
thinning out as time passed was ultimately so stressful and time
consuming
-
DATA SHEETS ARE YOUR BEST FRIEND: always load up the datasheets and look
at the pinouts for every part you load!! Made wiring a lot easier.
-
Make sure routes to pads are straight connections and always give
yourself as much room as possible between routes