F19: Tower Defense in Space

From Embedded Systems Learning Academy
Revision as of 22:57, 18 December 2019 by Proj user10 (talk | contribs) (RGB LED MATRIX)

Jump to: navigation, search
Logo

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

Tower Defense...In Space!

Tower Defense ... In Space.

Abstract

My abstract goes here.

Introduction and Objectives

intro here please.

Team Members

TEAM MEMBERS & RESPONSIBILITIES

Team Members

Administrative Roles

Technical Roles

  • [Ryan Zelek]

Team Lead

  • Game Design Lead

Git Repo Manager

  • Hardware Design Lead
  • [Chong Hang Cheong]

Wiki Report Manager

  • LED Matrix API
  • [Polin Chen]

Bill of Materials Manager

  • Joy Sticker && Decoder API


Schedule

TEAM MEETING DATES & DELIVERABLES

Week#

Date Assigned

Deliverables

Status

1 10/15/19
  • Share team contact information
  • Create Git Repository
  • Set up group Slack channel
  • Invite Preet to Slack
  • Establish Code Guidelines and Standards
  • Complete
  • Complete
  • Complete
  • Complete
  • Complete
2 10/22/19
  • Identify major hardware components (BOM)
  • Begin purchasing major items
  • Finalize game architecture
  • Have Git Repo Setup
  • Complete
  • Complete
  • Complete
  • Complete
3 10/29/19
  • Solidify individual roles and responsibilities
  • Establish baseline software architecture design and guidelines going forward
  • Complete
  • Complete
4 11/5/19

Kelvin

  • Verify functionality of LED matrix and gather resources for further understanding


  • Complete
5 11/12/19

Kelvin

  • Find out feasibility of creating an LED matrix driver in C

Polin

  • Have APIs ready for joystick and buttons

Ryan

  • Have basic user interface for the game displayed through serial port

Zach

  • First controller PCB design complete
  • Specify any remaining hardware components and coordinate purchase


  • Complete


  • Complete


  • Complete


  • Complete
  • Complete
6 11/19/19

Kelvin

  • Complete baseline API for LED matrix

Polin

  • Determine feasibility of MP3 decoding and integration into system

Ryan

  • Complete first pass at basic tower defense level with straight pathway

Zach

  • Controller PCB sent out for fabrication
  • Design break-out PCB for LED matrix + IO expander />


  • Complete


  • Complete


  • Complete


  • Complete
  • Complete
7 11/26/19

Kelvin

  • LED matrix driver should be reviewed and complete

Polin

  • Work with Zach to identify remaining hardware components and, if applicable, MP3 decoder requirements

Ryan

  • Work with Kelvin to integrate his API into the game
  • Game should be running with LED matrix display involvement
  • Advanced game logic design/implementation is near feature complete

Zach

  • PCB assembled and tested. Problems identified and solutions proposed


  • Complete


  • Complete


  • Complete
  • Complete
  • Complete


  • Complete
8 12/3/19
  • Complete game testing and validation
  • Critical bugs (software AND hardware) identified and a clear path towards closure has been identified
  • Complete
  • Complete
9 12/10/19
  • Continuation of previous week activities (bug fixes, etc)
  • Implement any potential optimizations and/or expansions
  • Complete
  • Complete


Bill of Materials

Top Level

PART NAME

PART MODEL & SOURCE

QUANTITY

COST PER UNIT (USD)

32x64 RGB LED Matrix [1] 2 $49.95
64x64 RGB LED Matrix Sparkfun 1 $79.95
NovaeLED 64x64 RGB LED Matrix (2-Pack) Amazon 1 $80.99
64x64 RGB LED Matrix* Adafruit 1 $104.07
5V 4A PSU - 1 FREE


Breakout Board PCB**

Item #

PART NAME

PART SOURCE

QUANTITY

COST PER UNIT (USD)

1 IC REG LINEAR LD1117S33CTR DIGIKEY 5 $0.351
2 MHS16N-ND 16POS CONN 2.54MM DIGIKEY 2 $2.60
3 CAP CER 0.1UF 25V X7R 1206 DIGIKEY 5 $0.221
4 CAP CER 10UF 16V X5R 1206 DIGIKEY 5 $0.202
5 RES SMD 470 OHM 1% 1/4W 1206 DIGIKEY 10 $0.0267
6 PTC RESET FUSE 24V 500MA 1206 DIGIKEY 10 $0.1588
7 CONN SOCKET 40POS 0.1 TIN PCB DIGIKEY 2 $5.03
8 Manufacturing x 5 boards * JLCPCB 1 $29.81


Gamepad PCB**

Item #

PART NAME

PART SOURCE

QUANTITY

COST PER UNIT (USD)

1 Analog 2-axis Thumb Joystick w/ select button Amazon 1 $7.67
2 SAM8205-ND 10POS 1.27MM DIGIKEY 5 $3.38
3 LED GREEN 1206 SMD DIGIKEY 5 $0.24
4 LED RED 1206 SMD DIGIKEY 5 $0.257
5 RES 1K OHM 1% 1/2W 1206 SMD DIGIKEY 5 0.0358
6 CAP CER 0.1UF 50V X7R 1206 DIGIKEY 5 $0.088
7 12x12x7.3mm Tactile Push Button w/ cap (pack of 25) Amazon 1 $7.89
8 Manufacturing x 5 boards * JLCPCB 1 $14.21


* Shipping and tax included in value shown in the cost per unit column
** Only parts that were purchased are displayed.


System Design

System Block Diagram

Hardware Design - Electrical

Overview

At a high level hardware integration requirements fell into two categories:

1. Reduce risk of unreliable cable connections and eliminate possibility of damage to components through unexpected disconnections, power surges, etc.
2. Provide a more fluid physical interface for the user to interact with the game via hardware


To accomplish these goals, two boards were designed: a breakout board and a gamepad controller. The breakout board serves as a connection hub between all system hardware components; power, the RGB matrix, the SJTWO board, etc. while the joystick provides a cleaner package to present the user with the games inputs. The diagram below shows the relationship between the main subsystems:


Tower defense in space hw block diagram.PNG


All board designs were done using EAGLE and manufactured by JLCPCB. Both boards were only two layers and used passive components for the most part.


Breakout Board Design

The breakout board design requirement was to interface all external hardware components with the embedded system (SJTWO). The hardware connections are:

1. The 64x64 RGB Matrix
2. Output power to the RGB Matrix
3. User game controller (see next section)
4. Input power supply (5V)
5. The SJTWO embedded system


Breakout Board Schematic


Breakout Board PCB Top Layout
Breakout Board PCB Bottom Layout
Breakout Board PCB Top Layout
Breakout Board PCB Bottom Layout
Populated and mounted to the SJTWO board

Gamepad Hardware Design

The gamepad board design requirement was to provide a more packaged interface for the user to interact with the game.

Gamepad Schematic


Gamepad PCB Top
Gamepad PCB Bottom
Gamepad PCB Fully Populated (no enclosure)

Hardware Design (Mechanical)

Only a few mechanical components were needed for this project. Namely simple brackets for mounting electrical hardware to the RGB matrix and displaying the matrix itself. All CAD designs were done using Onshape, a free CAD tool that can be used entirely through your web browser.

For displaying the RGB matrix, two brackets were 3D printed to prop it up. Their STL files can be found under our source repository.

Mounting bracket design used to prop up the RGB matrix

Hardware Integration

RGB LED MATRIX

The LED matrix that we have is 64 pixels by 64 pixels and is controlled through a 12-pin header consisting of the following pins: Pin Assignments:

  1. Five Mux pins (A,B,C,D,E) – Row Selection
    1. In order to select a specific row of the LED matrix, we need to control the output level of each mux pin. Since the LED matrix light up two rows of LEDs at one time, we only select 1 out of 32 rows.
  2. Two sets of RGB pins (R1,G1,B1,R2,G2,B2) – Color Selection
    1. Since we are driving two rows of LED matrix at once, we need 2 sets of RGB pins. One set is used to control the color pixels of the upper half of the display and the other set for the bottom half of the display.
  3. Output Enable Pin (OE)
    1. Output Enable (OE) pin is used to turn on or off the LEDs.
  4. Latch Pin (LAT)
    1. Latch pin is used to prevent the data being shifted into the shift registers and tells the shift register when it is time to switch to newly entered data
  5. Clock Pin (CLK)
    1. triggers a shift on the shift registers

All these pins are required to light up a specific LED pixel on the LED matrix display.

Pin Connections between SJtwo Board and RGB LED Matrix

Software Design

System Flow Charts

System Testing and Validation

Technical Challenges

The mp3 decoder1053b's document is a kind of confusing for the mode when 1032b have several modes, hence doing the survey on the GitHub is really important. For example, using the sin wave and hello binary example to test how the Initialization and HZ parameter would save a lot of time. Besides, we also have to be careful to check the SJBoard's SPI because of the SD card reader is using for reading SDcard. Hence, I would recommend using other SPI0, SPI1 instead of using SPI2.

Conclusion

Conculsion please.

Video Demonstration

Source Code

Advice for Future Students