System Integration¶
Much of the system integration was documented in the week 16 work. Putting those details again in the final project pages.
Card dealer integration¶
Project Overview¶
Project Name: Card Dealer
Goal: Deal playing cards to start a game, with selectors for number of cards and players
Subsystems List¶
In current design, the following subsystems are used in the card dealer
- Input Devices:
- Three buttons, one to select # of players, one for # of cards, and one to start dealing
- Output Devices:
- 2x16 LCD screen, 2 NEMA 14 Stepper Motors, with I2C hood
- Processing Unit:
- RP-2040
- Two A4988 motor driver boards
- Power Supply:
- USB power brick which supports QC power (Qualcomm Quick Charge). Two connections. One for the RP2040, another for the custom QC power delivery board (to deliver 12V to the stepper motors)
- Interface/Networking:
- Internal communication with the LCD via an I2C connection
- Mechanical Structure:
- Combination of 3D printed and laser cut pieces
- External laser cut box with finger joints
- 3d printed housing for the LCD and buttons, mounted on the box
- Internal 3d printed frame to hold the components
- 3d printed roller to move the cards
Wiring and Electrical Integration¶
- Include wiring diagram (created in Fritzing/KiCad).
- Confirm:
- Voltage levels (3.3V / 5V)
- Correct pin mapping
- Common ground for all devices
-
Pull-up/down resistors if needed
-
Two custom boards
- QC power board
- Variable power selection via potentiometer
- Tunable up to 20V
- Project control board
- Input for 3 buttons
- I2C connection for LCD
- Connections for A4988 boards
- Sockets for RP2040, A4988s, and QC power board
- QC power board
The design and fabrication for these are completed. The KiCad files are available on the final project page.
Schmatic for the QC power board
This board is based on a design from my instructor, who based his on a design from Nicolas de Coster.
PCB design for the QC power board
When in operation, the QC power board has an LED which is lit when in operation.
Finished QC power board in operation
Schematic for project control board
I included buttons on the board, which are helpful for testing. For the project use, I included pins to connect external buttons
PCB design for the project control board
Data Flow / Communication Protocols¶
Define how each subsystem communicates. | Source | Destination | Protocol | Purpose | |--------------|-------------|----------|-------------------| | Button 1 | RP-2040 | Digital | Select # players | | Button 2 | RP-2040 | Digital | Select # cards | | Button 3 | RP-2040 | Digital | Start dealing | | RP-2040 | 2x16 LCD | I2C | Display out | | RP-2040 | A4988 | Digital | Motor contol instructions | | A4988 | Stepper motor | Digital | Motor movement |
Mechanical Design and Assembly¶
Key aspects of mechanical assembly
- Fit components into the enclosure
- With several components, there is iterative design
- Functional needs
- Access to ports, buttons, display
- Robust attachments
- Motors held by screws
- Box held together with glue
Main project box. Design with pieces laid for laser cutting
Using the manufacturing interface in Fusion allows for box design updates to be propogated to the parts for laser cutting. I started with a simple box, but needed to add mounting holes, wiring holes and other features.
Wired LCD in control housing with buttons
Programming and Control¶
The project relies upon a custom Micropython script. Libraries are needed to control the motors and LCD.
- Main Micropython code
- Motor Control Library
- Library to run LCD
- Library to interact with buttions
All the code for this work can be seen in the project code page.